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.

migrated from stackoverflow.com Oct 5 '14 at 4:00

This question came from our site for professional and enthusiast programmers.


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


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.