7

I am trying to extract frames using FFMPEG using the following command:

 ffmpeg.exe ' -i ' videoFile ' -r 1/5 ' imgsFolder '\%5d.png'

Its extracting frames and assigning frame names in a sequential manner such 0, 1, ...

Is it possible to assign the actual frame number as part of the extraction?

For example, if the ffmpeg extracts 10th, 20th ...frames, it should name it img00010, img00020 instead of img00000, img00001....

ssk
  • 9,045
  • 26
  • 96
  • 169
  • Not sure on the question. Isn't the number in the name the frame number? – av501 Aug 09 '12 at 06:07
  • @user1559108 For example, if the ffmpeg extracts 10th, 20th ...frames, it should name it img00010, img00020 instead of img00000, img00002.... – ssk Aug 09 '12 at 17:06

1 Answers1

1

You can change the start number, by using '-start_number XX'.

But you can not change the increment of that number (I double checked with source code of ffmpeg).

Probably, it would be better to run a shell script that will rename your files. I can see that you are running in under Windows, so I'm not sure if you have bash there. But under linux it would look like this:

index=0
increment=10
prefix="new_"
for i in *.png; do printf "%s_%05d.png" $prefix $index; index=$[index+$increment]; done
Dmitry
  • 2,837
  • 1
  • 30
  • 48