如何使用FFmpeg将所有png文件从特定数字转换为gif [英] How to convert all png files from a particular number to gif using FFmpeg
问题描述
我在一个名为image0101到image200的文件夹中有一个图像列表.我想将所有图像合并到一个gif文件中,其索引帧与图像中的索引相同,即image0101是第一帧,image0102是第二帧,依此类推.我在ubuntu 16.04中使用了命令,但出现错误
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
找不到路径为'image%04d.png'且索引范围为0-4 image%04d.png的文件:没有此类文件或目录
Could find no file with path 'image%04d.png' and index in the range 0-4 image%04d.png: No such file or directory
我的命令中有任何错误,我猜图像的名称应该来自image0001,但是我无法重命名.我想ffmpeg有一些选择可以做到
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
推荐答案
image2多路分配器为此具有一个start_number选项:
The image2 demuxer has a start_number option for this:
ffmpeg -framerate 1 -start_number 0101 -i image%04d.png output.gif
这篇关于如何使用FFmpeg将所有png文件从特定数字转换为gif的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!