[FFmpeg-user] Frame padding

Jacob Harris jacob at jacobharris.org
Mon Aug 13 21:16:58 CEST 2012

We view all of our image sequences and movies in either Nuke or RV. Both of
these apps can use %04d for reading images--be it 1-100 or 1001-1100.
FFmpeg, however, needs two different paddings for those two ranges: %04d
and 1%03d, respectively. This leaves me needing to do a switch based on the
input frame length.

In pseudo-code:

    outputFrames = '%04d'
    if max(inputFrames) > 999:
        outputFrames = '1%03d'

Of course, if I have 900-1001, I'm screwed :)

There's got to be a better way of doing this. What am I missing?

More information about the ffmpeg-user mailing list