Is it possible to count from a given number when extracting images from a video with FFmpeg?

0

I am using ffmpeg to extract still images from a video. First from the beginning of the video, to a given time and then from the end of the video from a given time. So I am using two ffmpeg command line to achieve my goal. My problem is when I save the images both sequence start from 1 or 00000001, and I want to start the second sequence at some different (but greater) number than the first sequence ends. My command are:

wine avs2yuv.exe input1.avs - | ffmpeg -y -f yuv4mpegpipe -i - -f image2 -vf fps=fps=0.1 -q:v 2 ./thumb001/%09d.jpg"

wine avs2yuv.exe input2.avs - | ffmpeg -y -f yuv4mpegpipe -i - -f image2 -vf fps=fps=15 -q:v 2 ./thumb002/%09d.jpg"

I made my avisynth files to yield the appropriate parts of the video I need. For example when the first command extarct 1500 images, name of the last file is 000001500.jpg I want the second command to start the counting from 1501 or maybe more, to get file names from 000001501.jpg, 000001502.jpg, etc.

Konstantin

Posted 2014-09-09T22:44:32.347

Reputation: 515

Answers

1

Use the -start_number option for the image2 muxer. From the documentation:

-start_number

Start the sequence from the specified number. Default value is 1. Must be a non-negative number.

Your command would then look like:

wine avs2yuv.exe input2.avs - | ffmpeg -y -f yuv4mpegpipe -i - \
-vf fps=fps=15 -q:v 2 -start_number 1501 ./thumb002/%09d.jpg

llogan

Posted 2014-09-09T22:44:32.347

Reputation: 31 929