[FFmpeg-user] workaround for wrong timings when combining still images?

fred konkin fredkonkin at yahoo.ca
Thu Jan 6 22:36:39 EET 2022


I'm trying to combine several png images into a gif or mp4 animation, but with frame durations set individually for each frame.  Using concat, with a command line such as:

ffmpeg -f concat -i concat_list.txt anim.gif

the durations specified for each png in concat_list.txt are rounded to the nearest 0.04s (ie 1/25 s) in anim.gif, as pointed out in this bug report:

https://trac.ffmpeg.org/ticket/9210

Can anyone suggest a workaround to specify frame timestamps more precisely than this 1/25 s timebase?

As an alternative I also tried to set the modification times for the png files to the desired intervals using touch -d, and then ran

ffmpeg -f image2 -pattern_type glob -i '*.png' -ts_from_file 2 anim.gif

but again the intervals are rounded to 0.04s in anim.gif, according to

ffprobe -show_frames anim.gif

This suggests the problem isn't just with concat.

Perhaps as a workaround a second pass over anim.gif could somehow fix the timings?

Thanks!


More information about the ffmpeg-user mailing list