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?
Asked
Active
Viewed 1,301 times
2 Answers
1
You can use --format=png
so that manim outputs each frame as a png.
Example:
manim test.py -ql --format=png

Yuchen
- 30,852
- 26
- 164
- 234

huguesdvmx
- 26
- 2
0
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.

Muhammad Mohsin Khan
- 1,444
- 7
- 16
- 23

Prasanna P
- 64
- 1
- 6
-
Thank you so much for giving the solution. It worked well. One minor doubt is that can I use same procedure if I am using any cloud platform such as Google colab? – Ajinkya Anjikar Aug 11 '21 at 15:21
-
I have not worked on Google colab extensively but looks like support for it is available, pls check whether you are able to install ffmpeg using "apt install ffmpeg" in google colab. Refer https://stackoverflow.com/questions/51856340/how-to-install-package-ffmpeg-in-google-colab – Prasanna P Aug 11 '21 at 17:04
-
I have tried the information as suggested in the link but it did not work. – Ajinkya Anjikar Aug 12 '21 at 06:07