- 1 year ago
ffmpeg extracted frames with zero indexed filename
Comment
1 / 1
When extracting frames using FFmpeg, you can use the %d
format specifier in the output file name to generate zero-indexed frame numbers. Here's an example command:
bashffmpeg -i input.mp4 -vf "select='gte(n\,10)', setpts=N/FRAME_RATE/TB" output_%d.png
In this example, the %d
format specifier is used in the output file name, which will be replaced with the zero-indexed frame number. The select
filter is used to skip the first 10 frames, and the setpts
filter is used to set the correct timestamps for the extracted frames.
After running this command, FFmpeg will extract frames from the input video (input.mp4
) starting from frame index 0 and save them as output_0.png
, output_1.png
, output_2.png
, and so on.
Adjust the command and options as per your requirements, such as input file name, desired frame range, and output format.