-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Progress bar #128
Comments
I don't know. Maybe the best is to ask the question on reddit/python, reddit/learnpython or stackoverflow. Your question would be: "How can I retrieve and display in a [Tkinter ?] GUI the progress bar printed in the console by the library tqdm ?" |
I made a patch that extends the *write_video methods with a parameter to specifying the filelike object tqdm writes to, makes it very simple to pipe the progress between threads/processes, would you be interested in a pull request for it? |
@BAXTER001 Thanks, but wouldn't it be simpler to run moviepy in a separate thread and get the stdout ? With your solution we would have to amend all the functions that use the progress bar at some point, in case someone needs to print it externally. |
That's interesting, but changing just the progress bar's file to we will have a kind "progress bar screenshots" as text, and to do get the actual data (current percentage, ETA, etc) we should parse it. I guess that a better approach should be to pass an optional 'callable' to the the progressbar function that receive This imply a pull-request to tqdm or, probably faster, handle this in our own way. I could make a pull-request with this refactor. What do you think? |
@Zulko I avoided that out of the perhaps irrational unease of doing the sys.stdout replacement dance when the specificity of just the tqdm output on a per-clip basis was possible. @mgaitan That does sound like a far cleaner and more useful method, in fact one could probably limit this to a setter on clip rather than altering all the existing methods. |
Ok, looks like we are progressing towards a solution. @BAXTER001 what do you mean by "setter on clip ?" I'd propose that, maybe that's what you and @mgaitan had in mind ?
then in the clip.iterframes method (which is used by write_videofile, write_gif, etc.) we would add |
That's precisely the sort of method I was thinking of. Rather than a providing a callback, perhaps providing a generator function to this method to be wrapped around the current generator() returned by iter_frames would be more powerful? As demonstrated by the implementation of tqdm itself it lends itself to a clean encapsulation of rate limiting of the progress message output, along with being a nice place to put any generic raw frame hackery :) |
status? |
I am also interested in this, since it would be make it easier to display progress when using MoviePy outside of terminal. |
I'm also interested in this |
Was just going to start hacking the internal generator() in write_videofile, but it seems a callback for the progressbar would be incredibly helpful. A simple usecase is for a web-based view of the renderer, which would allow callback to save state to a local cache. Certainly some examples of these workflows would be helpful, perhaps? |
For my other projects I am using a new approach where you provide a "logger" which can be either a console progress bar, a notebook progress bar, or a link to some website's database: https://github.com/Edinburgh-Genome-Foundry/Proglog It is a bit young , but it may be worth using this strategy for moviepy too. Any comments welcome :) |
@Zulko - thanks much for the reference to proglog. Looks very interesting! Could you clarify - are you suggesting that tqdm just be replaced with proglog for the tqdm wrapper around the generator? Or even monkey-patch my use of moviepy with an updated iter_frames() that uses proglog? |
In my case First of all, I use "proglog" import "ProgressBarLogger". ps. U can get progresssbar maximum by "fps*duration" |
Hi,
I am really fine with moviepy - its a really great toolbox! I´ve writed a prgramm with a GUI to cut some videos in a specific way. This works really well.
Now i want to display the status of the cutting process on the interface like its displayed on my ipython console. But unfortunally i am not able to display the progress bar on my GUI.
I´ve tried "verbose_print" - but i cant call it the correct way.
Does anybody know the solution?
Thanks a lot! P
The text was updated successfully, but these errors were encountered: