<div align="center">
[](https://pypistats.org/packages/better-ffmpeg-progress)
[](https://pypistats.org/packages/better-ffmpeg-progress)

[](LICENSE.txt)
# Better FFmpeg Progress
Runs an FFmpeg command and shows a progress bar with percentage progress, time elapsed and ETA.
The [Rich](https://github.com/Textualize/rich) library is used for the progress bar by default, [tqdm](https://github.com/tqdm/tqdm) will be used if you pass `use_tqdm=True` to the `run` method.
</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 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 completed successfully, otherwise it will be 1
return_code = process.run()
```
## 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. Default: `<input filename>_log.txt`
- `print_detected_duration` - Print the detected duration of the input file. Default: `False`
- `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** arguments:
- `print_command` - Print the FFmpeg command being executed. Default: `False`
- `use_tqdm` - Use [tqdm](https://github.com/tqdm/tqdm) instead of [Rich](https://github.com/Textualize/rich) for the progress bar. 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/a0/13/c08e80974e9a56ab0fb3455c28178e5b02751b207dbbd41ef56b39cc706d/better_ffmpeg_progress-3.2.5.tar.gz",
"platform": null,
"description": "<div align=\"center\">\r\n\r\n[](https://pypistats.org/packages/better-ffmpeg-progress)\r\n[](https://pypistats.org/packages/better-ffmpeg-progress)\r\n\r\n[](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\r\nThe [Rich](https://github.com/Textualize/rich) library is used for the progress bar by default, [tqdm](https://github.com/tqdm/tqdm) will be used if you pass `use_tqdm=True` to the `run` method.\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 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# return_code will be 0 if the process completed successfully, otherwise it will be 1\r\nreturn_code = process.run()\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. Default: `<input filename>_log.txt`\r\n- `print_detected_duration` - Print the detected duration of the input file. Default: `False`\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** arguments:\r\n- `print_command` - Print the FFmpeg command being executed. Default: `False`\r\n- `use_tqdm` - Use [tqdm](https://github.com/tqdm/tqdm) instead of [Rich](https://github.com/Textualize/rich) for the progress bar. Default: `False`\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Run FFmpeg & see percentage progress + ETA.",
"version": "3.2.5",
"project_urls": {
"Homepage": "https://github.com/CrypticSignal/better-ffmpeg-progress"
},
"split_keywords": [
"ffmpeg",
" progress"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9c34727d441056120cee132e0d5114c3eeac3d057fb727b69af9685b039f33f0",
"md5": "2f78543dcfce8036fd71a77d4225ffbb",
"sha256": "371a6657ced9ced08f0ab0957fe552e5229c22591bac9b73a1044a019b384a82"
},
"downloads": -1,
"filename": "better_ffmpeg_progress-3.2.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2f78543dcfce8036fd71a77d4225ffbb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 7130,
"upload_time": "2025-02-27T15:55:45",
"upload_time_iso_8601": "2025-02-27T15:55:45.425682Z",
"url": "https://files.pythonhosted.org/packages/9c/34/727d441056120cee132e0d5114c3eeac3d057fb727b69af9685b039f33f0/better_ffmpeg_progress-3.2.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a013c08e80974e9a56ab0fb3455c28178e5b02751b207dbbd41ef56b39cc706d",
"md5": "3ff25fa81620a0deaa46ebce6e6bf9d2",
"sha256": "3b8ef75d7ac4457ceac668298130a2847b078b3a8d07fc74a85d3c0f1d82ba30"
},
"downloads": -1,
"filename": "better_ffmpeg_progress-3.2.5.tar.gz",
"has_sig": false,
"md5_digest": "3ff25fa81620a0deaa46ebce6e6bf9d2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 6360,
"upload_time": "2025-02-27T15:55:47",
"upload_time_iso_8601": "2025-02-27T15:55:47.288563Z",
"url": "https://files.pythonhosted.org/packages/a0/13/c08e80974e9a56ab0fb3455c28178e5b02751b207dbbd41ef56b39cc706d/better_ffmpeg_progress-3.2.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-27 15:55:47",
"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"
}