<div align="center">
[![PyPI downloads](https://img.shields.io/pypi/dm/better-ffmpeg-progress?label=PyPI&color=blue)](https://pypistats.org/packages/better-ffmpeg-progress)
[![PyPI downloads](https://img.shields.io/pypi/dd/better-ffmpeg-progress?label=PyPI&color=blue)](https://pypistats.org/packages/better-ffmpeg-progress)
![PyPI - Version](https://img.shields.io/pypi/v/better-ffmpeg-progress)
[![GitHub](https://img.shields.io/github/license/crypticsignal/better-ffmpeg-progress?label=License&color=blue)](LICENSE.txt)
# Better FFmpeg Progress
Runs an FFmpeg command and shows a progress bar with percentage progress, time elapsed and ETA.
</div>
FFmpeg outputs something like:
```
frame= 692 fps= 58 q=28.0 size= 5376KiB time=00:00:28.77 bitrate=1530.3kbits/s speed=2.43x
```
Better FFmpeg Progress outputs something like:
```
⠏ Processing abc.webm ━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 23% 0:00:04 00:15
```
Where:
- `Processing abc.webm` is the description of the progresss bar.
- `23%` is the percentage progress.
- `0:00:04` is the time (H:MM:SS) elapsed.
- `00:15` is the estimated time until the FFmpeg process completes.
As you can see, the output of Better FFmpeg Progress is much more useful.
## Installation
```
pip install better-ffmpeg-progress --upgrade
```
## Usage
Create an instance of the `FfmpegProcess` class and supply a list of arguments like you would to `subprocess.run()` or `subprocess.Popen()`.
Here's a simple example:
```py
from better_ffmpeg_progress import FfmpegProcess
process = FfmpegProcess(["ffmpeg", "-i", "input.mp4", "-c:v", "libx265", "output.mp4"])
# return_code will be 0 if the process was successful
return_code = process.run()
if return_code == 0:
# Code to run if the process was successful
pass
else:
# Code to run if the process was unsuccessful
pass
```
## Optional Arguments
An instance of the `FfmpegProcess` class takes the following **optional** arguments:
- `ffmpeg_log_level` - Desired FFmpeg log level. Default: `"verbose"`
- `ffmpeg_log_file` - The filepath to save the FFmpeg log to.
- `print_detected_duration` - Print the detected duration of the input file. Default: `True`
- `print_stderr_new_line` - If better progress information cannot be shown, print FFmpeg stderr in a new line instead of replacing the current line in the terminal. Default: `False`
The `run` method takes the following **optional** argument:
- `print_command` - Print the FFmpeg command being executed. Default: `False`
Raw data
{
"_id": null,
"home_page": "https://github.com/CrypticSignal/better-ffmpeg-progress",
"name": "better-ffmpeg-progress",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "ffmpeg, progress",
"author": "GitHub.com/CrypticSignal",
"author_email": "theaudiophile@outlook.com",
"download_url": "https://files.pythonhosted.org/packages/22/67/4db309ef599c70b4491e74984a7081647ae193b7da072189578b800dc8ce/better_ffmpeg_progress-3.1.0.tar.gz",
"platform": null,
"description": "<div align=\"center\">\r\n\r\n[![PyPI downloads](https://img.shields.io/pypi/dm/better-ffmpeg-progress?label=PyPI&color=blue)](https://pypistats.org/packages/better-ffmpeg-progress)\r\n[![PyPI downloads](https://img.shields.io/pypi/dd/better-ffmpeg-progress?label=PyPI&color=blue)](https://pypistats.org/packages/better-ffmpeg-progress)\r\n![PyPI - Version](https://img.shields.io/pypi/v/better-ffmpeg-progress)\r\n[![GitHub](https://img.shields.io/github/license/crypticsignal/better-ffmpeg-progress?label=License&color=blue)](LICENSE.txt)\r\n\r\n# Better FFmpeg Progress\r\nRuns an FFmpeg command and shows a progress bar with percentage progress, time elapsed and ETA.\r\n</div>\r\n\r\nFFmpeg outputs something like:\r\n```\r\nframe= 692 fps= 58 q=28.0 size= 5376KiB time=00:00:28.77 bitrate=1530.3kbits/s speed=2.43x\r\n```\r\nBetter FFmpeg Progress outputs something like:\r\n```\r\n\u280f Processing abc.webm \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u257a\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 23% 0:00:04 00:15\r\n```\r\nWhere:\r\n- `Processing abc.webm` is the description of the progresss bar.\r\n- `23%` is the percentage progress.\r\n- `0:00:04` is the time (H:MM:SS) elapsed.\r\n- `00:15` is the estimated time until the FFmpeg process completes.\r\n\r\nAs you can see, the output of Better FFmpeg Progress is much more useful.\r\n\r\n## Installation\r\n```\r\npip install better-ffmpeg-progress --upgrade\r\n```\r\n\r\n## Usage\r\nCreate an instance of the `FfmpegProcess` class and supply a list of arguments like you would to `subprocess.run()` or `subprocess.Popen()`.\r\n\r\nHere's a simple example:\r\n```py\r\nfrom better_ffmpeg_progress import FfmpegProcess\r\n\r\nprocess = FfmpegProcess([\"ffmpeg\", \"-i\", \"input.mp4\", \"-c:v\", \"libx265\", \"output.mp4\"])\r\n\r\n# return_code will be 0 if the process was successful\r\nreturn_code = process.run()\r\n\r\nif return_code == 0:\r\n # Code to run if the process was successful\r\n pass\r\nelse:\r\n # Code to run if the process was unsuccessful\r\n pass\r\n```\r\n## Optional Arguments\r\nAn instance of the `FfmpegProcess` class takes the following **optional** arguments:\r\n\r\n- `ffmpeg_log_level` - Desired FFmpeg log level. Default: `\"verbose\"`\r\n- `ffmpeg_log_file` - The filepath to save the FFmpeg log to.\r\n- `print_detected_duration` - Print the detected duration of the input file. Default: `True`\r\n- `print_stderr_new_line` - If better progress information cannot be shown, print FFmpeg stderr in a new line instead of replacing the current line in the terminal. Default: `False`\r\n\r\nThe `run` method takes the following **optional** argument:\r\n- `print_command` - Print the FFmpeg command being executed. Default: `False`\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Run FFmpeg & see percentage progress + ETA.",
"version": "3.1.0",
"project_urls": {
"Homepage": "https://github.com/CrypticSignal/better-ffmpeg-progress"
},
"split_keywords": [
"ffmpeg",
" progress"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c591d9f16e96355c46d2ace5a8e90af29d8ae45f46a97b0d53788c3ef9ce998d",
"md5": "b80b4732fe8cc14520e69188a5d440ac",
"sha256": "b976b8058517969b87513e4e03d933f156e14b4b76fb637ba7813a36665e7ead"
},
"downloads": -1,
"filename": "better_ffmpeg_progress-3.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b80b4732fe8cc14520e69188a5d440ac",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 6575,
"upload_time": "2024-12-27T16:45:10",
"upload_time_iso_8601": "2024-12-27T16:45:10.691475Z",
"url": "https://files.pythonhosted.org/packages/c5/91/d9f16e96355c46d2ace5a8e90af29d8ae45f46a97b0d53788c3ef9ce998d/better_ffmpeg_progress-3.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "22674db309ef599c70b4491e74984a7081647ae193b7da072189578b800dc8ce",
"md5": "b0dd6164315ec45dc0f983d3dcdbd4f3",
"sha256": "fb09d123cd345d8cb1bb4c8ab2d6ec272aa834efe7fa88f97b3d0fd271f739a2"
},
"downloads": -1,
"filename": "better_ffmpeg_progress-3.1.0.tar.gz",
"has_sig": false,
"md5_digest": "b0dd6164315ec45dc0f983d3dcdbd4f3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 5842,
"upload_time": "2024-12-27T16:45:12",
"upload_time_iso_8601": "2024-12-27T16:45:12.970270Z",
"url": "https://files.pythonhosted.org/packages/22/67/4db309ef599c70b4491e74984a7081647ae193b7da072189578b800dc8ce/better_ffmpeg_progress-3.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-27 16:45:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "CrypticSignal",
"github_project": "better-ffmpeg-progress",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "better-ffmpeg-progress"
}