'Is it possible to export the pictures in png format from a Manim animation video?
I am just curious to know whether it is possible to export some final graphs or pictures after the successful animation of any object. I have used "Mathematica" and I know that a video can be exported as a sequence of images. If it is possible in Manim, then what is the proper way to do it?
Solution 1:[1]
You can use --format=png so that manim outputs each frame as a png.
Example:
manim test.py -ql --format=png
Solution 2:[2]
One possible way is to use ffmpeg. Using FFmpeg you can convert the video file into images. After downloading FFmpeg, navigate to the path where FFmpeg exe is available and from the command prompt, you can try the below command.
ffmpeg -i input file path output file path
Ex: ffmpeg -i input file path C:\images\img%04d.png
The above command will convert each frame of the video to a png image in the path specified. "img%04d" is for the output file name format. In the output file path, you will be able to observe files like img0001, img0002. Each png file will represent a particular frame in the video.
I had tried with an mp4 file and it works fine.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Yuchen |
| Solution 2 | Muhammad Mohsin Khan |
