0

I need to process some videos with ffmpeg, and I found an example command that does almost everything I need it to:

ffmpeg -i example.avi -vf fps=1/30 example_%03d.jpg

I've figured out what all of this command does, but I've been unable to figure out the meaning of %03d in the output file format. What does %03d mean in a ffmpeg file output format mean? What other special sequences are allowed in an ffmpeg output?

Dan
  • 12,157
  • 12
  • 50
  • 84
  • 1
    formatting chars, look up C's `printf()` function... `%03d` is a (d)ecimal (aka integer), `3` digits long, padded with `0` to the left. – Marc B Feb 03 '16 at 19:56

1 Answers1

4

According to the documentation:

The syntax foo-%03d.jpeg specifies to use a decimal number composed of three digits padded with zeroes to express the sequence number. It is the same syntax supported by the C printf function, but only formats accepting a normal integer are suitable.

So the resulting file names are example_001.jpg, example_002.jpg, … , example_123.jpg.

See also the "image sequence" entry in the FFMPEG An Intermediate Guide for details and examples.

DarkDust
  • 90,870
  • 19
  • 190
  • 224