jkhadka
jkhadka

Reputation: 2553

ffmpeg making gif from serially numbered images

my files are named :

file1.png
file2.png
file3.png
....
file11.png
...
file123.png
...
file200.png

now I want to make a gif of these images. I tired with

ffmpeg -framerate 10  -pattern_type glob -i 'file*.png' -c:v libx264 -pix_fmt yuv420p growth.avi

but it does not work properly. What am i doing wrong?

Upvotes: 0

Views: 3747

Answers (1)

budthapa
budthapa

Reputation: 1022

Convert to gif.

cd /home/user/Pictures && convert -delay 20 -loop 0 *.png result.gif

Based upon your output to video format (.avi), you can use the commands directly in console to output to video format

ffmpeg -f image2 -pattern_type glob -framerate 12 -i 'file*.png' -s 420x360 output.avi

ffmpeg -framerate 29 -i file%d.png output.avi

If you want to concat from file, first create file and give the location of the pictures. You can define duration in the file

Eg. Create imageList.txt in your picture folder. Put the location of picture like this.

file 'file4.png'
duration 2
file 'file5.png'
duration 2
file 'file6.png'
duration 3
file 'file7.png'
duration 2
file 'file8.png'

In console,

ffmpeg -f concat -i imageList.txt -vsync vfr -pix_fmt yuv420p asf.avi

Upvotes: 3

Related Questions