Moviepy: Thoughts on re-routing tqdm progress bar for external use?

Created on 15 Feb 2017  路  5Comments  路  Source: Zulko/moviepy

Do we have any thoughts on adjusting the tqdm iterator in write_videofile to re-route progress bar elsewhere e.g. tkinter widget?

So it can by other threads/processes in the same program...

See here, here, here and here for interest

enhancement feature-request

Most helpful comment

I think the best way to do it would be to add a "progress_callback" parameter to "write_videofile". This parameter would be a function which will be run that would be run inside the main loops of "write_audiofile" and "write_videofile".

progress_callback("audioclip", current_frame, current_frame_number, total_frames_number)
progress_callback("videoclip", current_frame, current_frame_number, total_frames_number)

This would enable to do a lot of things such as sending the progress back to a web client, and even get a preview of what is being written down, as it is being written down.

All 5 comments

see no reason why we shouldn't.

I think the best way to do it would be to add a "progress_callback" parameter to "write_videofile". This parameter would be a function which will be run that would be run inside the main loops of "write_audiofile" and "write_videofile".

progress_callback("audioclip", current_frame, current_frame_number, total_frames_number)
progress_callback("videoclip", current_frame, current_frame_number, total_frames_number)

This would enable to do a lot of things such as sending the progress back to a web client, and even get a preview of what is being written down, as it is being written down.

Another related issue #278

278 just talks about disabling the progress bar in write_videofile and we have a update for that in PR #380 (and #300 for write_images_sequence)

Implemented in v1.0. See #1020

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Netherdrake picture Netherdrake  路  4Comments

skizzy picture skizzy  路  3Comments

Netherdrake picture Netherdrake  路  5Comments

keikoro picture keikoro  路  4Comments

Gicehajunior picture Gicehajunior  路  3Comments