Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
embed clip in a jupyter notebook #160
using a video clip generated by:
I am trying to embed it in the notebook using:
This was working nicely when I was using python 2, but seems to be broken when using python 3:
(The video generated by
would show fine in the browser when opened directly)
(and thanks a lot for this excellent piece of code!)
I just tried that exact line and it works for me on my jupyter... are you using firefox or chrome ?
Also, hint: instead of first writing to a file and then importing in the notebook, you can directly preview the clip with
which is faster to write in the notebook.
it would work while
Is this code linked to the previous problem ? The code you showed is not from moviepy (in moviepy I use the base64 module, I hope it doesn't bug in python3).
The previous problem seems to be that your browser can't open the video, but we don't see any moviepy-related bug... Also, does it work when you use clip.ipython_display() ?
It seems to be a problem in the way python 3 handles byte objects (for a nice and comprehensive description of the changes, see https://docs.python.org/3.3/whatsnew/3.0.html#text-vs-data-instead-of-unicode-vs-8-bit ). I have submitted a PR to solve this.