Closed janciev closed 1 year ago
better-ffmpeg-progress==2.0.5 ffmpeg-python==0.2.0 future==0.18.2 tqdm==4.64.1
What might be the issue is that the duration of your file was incorrectly determined to be 0, in which case division by 0 will occur on this line.
I'll add a conditional to only run (seconds_processed / self._duration_secs) * 100
if self._can_get_duration
is True
. I'll let you know when I have added this change, after which please upgrade to the latest version of better-ffmpeg-progress and let me know if this fixes the issue.
Can you upgrade to version 2.0.6
with pip3 install better-ffmpeg-progress --upgrade
and let me know if this fixes the issue?
Hi,
when I run the script with the progress_handler I see the error message:
(env) [xxxx]$ /Users/[xxxx]/env/bin/python [xxxx]test_runner.py Running: ffmpeg -y -i [xxxx] -c:a libmp3lame -y output.mp3 -loglevel verbose -progress pipe:1 -nostats 0%| | 0/384.304 [00:00<?, ?s/s] [Error] float division by zero Exiting Better FFmpeg Progress.
The code below:
from better_ffmpeg_progress import FfmpegProcess
def handle_progress_info(percentage): print(f"The FFmpeg process is {percentage}% complete. ETA is / seconds.")
process = FfmpegProcess(["ffmpeg", "-i", "[xxxx]", "-c:a", "libmp3lame", "-y", "output.mp3"], ) process.run(progress_handler=handle_progress_info)