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

Progress bar newline error in Jupyter #740

Closed
jarmitage opened this issue Mar 13, 2018 · 6 comments
Closed

Progress bar newline error in Jupyter #740

jarmitage opened this issue Mar 13, 2018 · 6 comments

Comments

@jarmitage
Copy link

jarmitage commented Mar 13, 2018

Problem

  1. Progress bar works fine initially:

2018-03-13 at 13 45 12

2. Stop the process (using toolbar) and get a huge KeyboardInterrupt dump:

2018-03-13 at 13 45 21

3. Run again and the progress bar prints to a new line:

2018-03-13 at 13 45 43

Code

import moviepy.editor as mpy
import os

clip1 = mpy.VideoFileClip("a.mp4").subclip(10,15).set_pos((0,0)).set_start(0)
clip2 = mpy.VideoFileClip("a.mp4").subclip(20,25).set_pos((0,1080)).set_start(5)
clip3 = mpy.VideoFileClip("a.mp4").subclip(30,35).set_pos((0,2160)).set_start(10)

comp = mpy.CompositeVideoClip([clip1, clip2, clip3], size=(3000,3240))

Versions

  • Jupyter 4.4.0, Notebook 5.4.0, Lab 0.31.12 (same problem in Notebook as Lab)

Comments

Thanks for any support in advance!

@jarmitage
Copy link
Author

jarmitage commented Mar 13, 2018

I was able to solve this problem by switching to tqdm_notebook at these locations:

return tqdm(generator(), total=nframes)

return tqdm(generator(), total=nchunks)

If using Jupyter Lab this requires installing the extension: jupyter labextension install @jupyter-widgets/jupyterlab-manager: http://ipywidgets.readthedocs.io/en/latest/user_install.html#installing-the-jupyterlab-extension

2018-03-13 at 14 34 46

@Zulko
Copy link
Owner

Zulko commented Mar 13, 2018

This would also be solved by my other library Proglog, which allows users to specify whether they want console/notebook/web progress bars. @tburrows13 I just saw that you pushed a commit related to progress callbacks, does that exclude proglog ?

@tburrows13
Copy link
Collaborator

@Zulko, no the commit I just pushed was to solve merging conflicts in #701 so that it could be used as a workaround before we implement a proper solution. I still haven’t done anything with Proglog yet, but I think I will.

@keikoro
Copy link
Collaborator

keikoro commented Dec 16, 2018

Any progress on this? (Not sure how to tag this...)

@danmash
Copy link

danmash commented Jul 6, 2019

#740 (comment)
is there a way to do this with no modification of the source?

@tburrows13
Copy link
Collaborator

Proglog support has been added as of v1.0. See #1020.

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

5 participants