[FFmpeg-user] ffmpeg generate the video from non-sequential images

Carl Eugen Hoyos ceffmpeg at gmail.com
Mon Oct 29 22:46:26 EET 2018


2018-10-29 16:21 GMT+01:00, Moritz Barsnick <barsnick at gmx.net>:
> On Mon, Oct 29, 2018 at 14:59:43 +0100, Ayush Narsaria wrote:
>> My png files are numbered from res-5.png to res-180.png.
>>
>> The command I give is :
>> ffmpeg -framerate 5 -pattern_type glob -i '*.png' -c:v libx264 output.mp4

pattern_glob should be a last resort, better use %d if possible.

> The globbing will probably order your files alphabetically, making
> res-1*.png come before res-2.png. resulting in incorrect order.
>
> I suggest:
> $ ffmpeg -framerate 5 -i 'res-%d.png' -start_number 5 -c:v libx264
> output.mp4

Should be:
$ ffmpeg -start_number 5 -framerate 5 -i res-%d.png out.mp4

Carl Eugen


More information about the ffmpeg-user mailing list