feat(lib): add basic VideoMobject class
Hello, I actually implemented this for a personal need, but I guess other people could enjoy such feature, as in #760.
The current implementation is very minimalist, and may be improved, or tested / better documented.
If OpenCV is added as a dependency, then we could also directly load videos from video files, which could be a nice feature.
Thanks for the proposal, this looks like a good idea -- and we do get requests for this reasonably often indeed.
I'd be somewhat unhappy with adding OpenCV as a new dependency (we're currently rather trying to reduce dependencies), and OpenCV is not a particularly lightweight one either. However, it should be possible to achieve similar things with the ffmpeg bindings for Python, and as ffmpeg is a dependency already, adding the Python bindings would not hurt too much.
Something like that https://github.com/kkroening/ffmpeg-python/blob/master/examples/ffmpeg-numpy.ipynb?
it seems quite easy to load all frames into one large array
Instead of the ffmpeg python bindings it is possible that we finally tackle #442 and include av as a dependency. It would be similarly easy with that.
Instead of the ffmpeg python bindings it is possible that we finally tackle #442 and include
avas a dependency. It would be similarly easy with that.
Oh! That's a super nice feature if we support av :D I might try to implement this later this month :-)
@behackl looks like the av module is quite heavy, maybe it already includes ffmpeg https://pypi.org/project/av/11.0.0/#files?
I don't know how to interpret (from their READMDE):
Due to the complexity of the dependencies, PyAV is not always the easiest Python package to > install from source. Since release 8.0.0 binary wheels are provided on [PyPI][pypi] for Linux, Mac and Windows linked against a modern FFmpeg. You can install these wheels by running:
pip install avIf you want to use your existing FFmpeg, the source version of PyAV is on [PyPI][pypi] too:
pip install av --no-binary av
@behackl looks like the
avmodule is quite heavy, maybe it already includesffmpeghttps://pypi.org/project/av/11.0.0/#files?I don't know how to interpret (from their READMDE):
Haha, fun to see that you ran into the exact same question as I did. :-)
From my current understanding: yes, they provide wheels which include a statically linked version of ffmpeg (which would be actually amazing for us as it eliminates the biggest pain point about installing manim for our users).
I have planned to investigate in more detail over the coming days, perhaps we are in luck.
Let’s see how much it can improve the speed, the thing I am the most interested in!
Related PR: https://github.com/ManimCommunity/manim/pull/3501