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....
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With