How to convert all png files from a particular num

2020-05-07 05:13发布

问题:

I have a list of images in a folder with the name image0101 to image200. I want to merge all images to a gif file with index frame is same as an index in the image, i.e image0101 is the first frame, image0102 is the second frame and so on. I used the command in the ubuntu 16.04 but I got the error

ffmpeg -framerate 1  -i image%4d.png output.gif

Could find no file with path 'image%04d.png' and index in the range 0-4 image%04d.png: No such file or directory

Anything wrong in my command, I guess the name of the image should be from image0001 but I cannot rename it. I guess the ffmpeg has some option to do it

回答1:

The image2 demuxer has a start_number option for this:

ffmpeg -framerate 1 -start_number 0101 -i image%04d.png output.gif