[FFmpeg-user] Controlling Numbering of Extracted Still Frames?

Moritz Barsnick barsnick at gmx.net
Sat Jun 14 12:05:06 CEST 2014


Hi Sam,

On Fri, Jun 13, 2014 at 20:24:04 -0400, Sam Logan wrote:
> When you convert a video to still frames via:
> ffmpeg -i "Foobar.mp4" "Frame%05d.png"
[...]
> How can I get FFmpeg to instead number the outputted files starting at
> some other value besides 1, such as 0?

What you are creating implies the "image2" muxer. Check its documentation:
https://www.ffmpeg.org/ffmpeg-formats.html#image2-1

So this should do the right thing for you:
ffmpeg -i "Foobar.mp4" -f image2 -start_number 0 "Frame%05d.png"

And in this case, you can continue to omit the implicit muxer:
ffmpeg -i "Foobar.mp4" -start_number 0 "Frame%05d.png" 

Moritz

P.S.: Despite being a programmer, it often riddles me why anyone would
      like to start counting with 0. ;-)


More information about the ffmpeg-user mailing list