convert all the png files in a folder to video
7,745
Option 1: Rename
First rename all of the inputs so they have zero-padding (
001.png
...450.png
).-
Then run
ffmpeg
:ffmpeg -framerate 25 -i %03d.png output.avi
or
ffmpeg -framerate 25 -pattern_type glob -i "*.png" output.avi
Option 2: Sort
Use a more complicated command to sort the files and then pipe to ffmpeg
:
cat $(find . -maxdepth 1 -name "*.png" | sort -V) | ffmpeg -framerate 25 -i - output.avi
Related videos on Youtube
Author by
Mona Jalal
contact me at [email protected] I am a 5th-year computer science Ph.D. Candidate at Boston University advised by Professor Vijaya Kolachalama in computer vision as the area of study. Currently, I am working on my proposal exam and thesis on the use of efficient computer vision and deep learning for cancer detection in H&E stained digital pathology images.
Updated on September 18, 2022Comments
-
Mona Jalal over 1 year
I have ~450 frames named 1...450. However, there are some missing frames for example frame 10, 30, and so on do not exists.
I want to create an AVI video in the same order as 1...450.png. How should I do that?
-
schrodingerscatcuriosity over 4 yearsCheck this
-
-
Mona Jalal over 4 yearsif I use sort, I don't need to use zero-padding right?
-
llogan over 4 years@MonaJalal Yes. You can run
find . -maxdepth 1 -name "*.png" | sort -V
and it will show you the order that will be given toffmpeg
.