You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let SceneFileWriter access ffmpeg via av instead of via external process (#3501)
* added av as a dependency
* make partial movie files use av instead of piping to external ffmpeg
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* opengl rendering: use av for movie files
* no need to check for ffmpeg executable
* refactor: *_movie_pipe -> *_partial_movie_stream
* improve (oneline) documentation
* pass more options to partial movie file rendering
* move ffmpeg verbosity settings to config; renamed option dict
* replaced call to ffmpeg in combine_files by using av
Co-authored-by: Jérome Eertmans <[email protected]>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* there was one examples saved as a gif?
* chore(deps): re-order av
* chore(lib): simplify `write_frame` method
Reduces the overall code complexity
* chore(lib): add audio
* fix(lib): same issue for conversion
* fix(lib): webm export
* fix(lib): transparent export
Though the output video is weird
* try(lib): fix gif + TODOs
* chore(deps): lower dep crit
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* feat(lib): add support for GIF
* fix(ci): rewrite tests
* fix
* chore(ci): prevent calling concat on empty list
* add missing dot
* fix(ci): update frame comparison ?
* fix(log): add handler to libav logger
* chore: add TODO
* fix(lib): concat issue
* Revert "fix(ci): update frame comparison ?"
This reverts commit 904cfb4.
* fix(ci): make it pass tests
* chore(lib/docs/ci): remove FFMPEG entirely
This removes any reference to FFMPEG, except in translation files
* added av as a dependency
* make partial movie files use av instead of piping to external ffmpeg
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* opengl rendering: use av for movie files
* no need to check for ffmpeg executable
* refactor: *_movie_pipe -> *_partial_movie_stream
* improve (oneline) documentation
* pass more options to partial movie file rendering
* move ffmpeg verbosity settings to config; renamed option dict
* replaced call to ffmpeg in combine_files by using av
Co-authored-by: Jérome Eertmans <[email protected]>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* there was one examples saved as a gif?
* chore(deps): re-order av
* chore(lib): simplify `write_frame` method
Reduces the overall code complexity
* chore(lib): add audio
* fix(lib): same issue for conversion
* fix(lib): webm export
* fix(lib): transparent export
Though the output video is weird
* try(lib): fix gif + TODOs
* chore(deps): lower dep crit
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* feat(lib): add support for GIF
* fix(ci): rewrite tests
* fix
* chore(ci): prevent calling concat on empty list
* add missing dot
* fix(ci): update frame comparison ?
* fix(log): add handler to libav logger
* chore: add TODO
* fix(lib): concat issue
* Revert "fix(ci): update frame comparison ?"
This reverts commit 904cfb4.
* fix(ci): make it pass tests
* chore(lib/docs/ci): remove FFMPEG entirely
This removes any reference to FFMPEG, except in translation files
* chore(deps): update lockfile
* chore(lib): rewrite ffprobe
* fix typo
* slightly more aggressive removal of ffmpeg in docs; minor language changes
* fix gif output stream dimensions
* minor style change
* fix encoding of (transparent) mov files
* fixed metadata / comment
* set frame rate for --format=gif in output_stream
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* more video tests for different render settings, also test pix_fmt
* improve default bitrate setting via crf
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* parametrized format/transparency rendering test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* context managers for (some) av.open
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update manim/utils/commands.py
Co-authored-by: Jérome Eertmans <[email protected]>
* fixed segfault
* update test data involving implicit functions (output improved!)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* explicity set pix_fmt for transparent webms
* special-special case extracting frame from vp9-encoded file with transparency
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix transparent gifs, more special casing in parametrized video format test
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* run tests on macos-latest again
* removed old control data
* Revert "run tests on macos-latest again"
This reverts commit f50efa4.
* added sound to codec test; fixed issue with sound track in gif (disabled) and webm (now via opus)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* manual wav -> ogg transcoding
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed f-string
* refactored codec test, split out gif
* check for non-zero audio samples
* more cleanup
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* remove ffmpeg from readthedocs apt_packages
* round up run_time if positive and shorter than current frame rate
* added more run_time tests
* black
* improve implementation of test
* removed some unused imports
* improve wording of logged warning
Co-authored-by: Jérome Eertmans <[email protected]>
* move run_time checks from Animation.begin to Scene.get_run_time
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* remove unused import
* flake: PT012
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jérome Eertmans <[email protected]>
Copy file name to clipboardExpand all lines: docs/source/guides/deep_dive.rst
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -266,7 +266,7 @@ The scene then asks its renderer to initialize the scene by calling
266
266
267
267
Inspecting both the default Cairo renderer and the OpenGL renderer shows that the ``init_scene``
268
268
method effectively makes the renderer instantiate a :class:`.SceneFileWriter` object, which
269
-
basically is Manim's interface to ``ffmpeg`` and actually writes the movie file. The Cairo
269
+
basically is Manim's interface to ``libav`` (FFMPEG) and actually writes the movie file. The Cairo
270
270
renderer (see the implementation `here <https://github.com/ManimCommunity/manim/blob/main/manim/renderer/cairo_renderer.py>`__) does not require any further initialization. The OpenGL renderer
271
271
does some additional setup to enable the realtime rendering preview window, which we do not go
272
272
into detail further here.
@@ -310,8 +310,8 @@ the order they are called, these customizable methods are:
310
310
After these three methods are run, the animations have been fully rendered,
311
311
and Manim calls :meth:`.CairoRenderer.scene_finished` to gracefully
312
312
complete the rendering process. This checks whether any animations have been
313
-
played -- and if so, it tells the :class:`.SceneFileWriter` to close the pipe
314
-
to ``ffmpeg``. If not, Manim assumes that a static image should be output
313
+
played -- and if so, it tells the :class:`.SceneFileWriter` to close the output
314
+
file. If not, Manim assumes that a static image should be output
315
315
which it then renders using the same strategy by calling the render loop
316
316
(see below) once.
317
317
@@ -762,10 +762,10 @@ to learn more, the :func:`.get_hash_from_play_call` function in the
762
762
mechanism.
763
763
764
764
In the event that the animation has to be rendered, the renderer asks
765
-
its :class:`.SceneFileWriter` to start a writing process. The process
766
-
is started by a call to ``ffmpeg`` and opens a pipe to which rendered
767
-
raw frames can be written. As long as the pipe is open, the process
768
-
can be accessed via the ``writing_process`` attribute of the file writer.
765
+
its :class:`.SceneFileWriter` to open an output container. The process
766
+
is started by a call to ``libav`` and opens a container to which rendered
767
+
raw frames can be written. As long as the output is open, the container
768
+
can be accessed via the ``output_container`` attribute of the file writer.
769
769
With the writing process in place, the renderer then asks the scene
770
770
to "begin" the animations.
771
771
@@ -815,7 +815,7 @@ time is extracted (3 seconds long) and stored in
815
815
skip (it should not), then whether the animation is already
816
816
cached (it is not). The corresponding animation hash value is
817
817
determined and passed to the file writer, which then also calls
818
-
``ffmpeg`` to start the writing process which waits for rendered
818
+
``libav`` to start the writing process which waits for rendered
819
819
frames from the library.
820
820
821
821
The scene then ``begin``\ s the animation: for the
@@ -1001,7 +1001,7 @@ and :meth:`.Animation.clean_up_from_scene` methods are called.
1001
1001
In the end, the time progression is closed (which completes the displayed progress bar)
1002
1002
in the terminal. With the closing of the time progression, the
1003
1003
:meth:`.Scene.play_internal` call is completed, and we return to the renderer,
1004
-
which now orders the :class:`.SceneFileWriter` to close the movie pipe that has
1004
+
which now orders the :class:`.SceneFileWriter` to close the output container that has
1005
1005
been opened for this animation: a partial movie file is written.
1006
1006
1007
1007
This pretty much concludes the walkthrough of a :class:`.Scene.play` call,
0 commit comments