Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

total amount of frames in progress bar is approximated #27

Open
joshinils opened this issue Aug 1, 2022 · 1 comment
Open

total amount of frames in progress bar is approximated #27

joshinils opened this issue Aug 1, 2022 · 1 comment

Comments

@joshinils
Copy link
Contributor

joshinils commented Aug 1, 2022

length = int(duration * fps)
audio_present = "audio_codec" in meta
# save the video to a file
with imageio.get_writer(
temp_output, codec="libx264", fps=fps, quality=quality
) as writer:
with tqdm(
total=length, desc="Processing video", unit="frames", dynamic_ncols=True

this sometimes leads to the progress bar never being closed (properly)

see https://stackoverflow.com/questions/2017843/fetch-frame-count-with-ffmpeg
for potential solution (idk if the current codebase can get the total framecount without looking at the file in another subprocess)

@tfaehse
Copy link
Owner

tfaehse commented Aug 2, 2022

Can you send me the file? I'd like to check what information is there, the length estimation is an ugly workaround indeed. "Proper" input files have a length attribute anyway, but unfortunately it's not always set...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants