I have an ffmpeg newbie question, I am extracting keyframes from streams using this command: ffmpeg -skip_frame nokey -i {0} -vsync 0 -r 30 -f image2 keyframe-%09d.jpeg

However, instead of an auto-incrementing counter, I would like to save by frame pts. for example keyframe-0003456.jpg as the pts. How can I mod the command?

1 Answer 1



ffmpeg -copyts -skip_frame nokey -i {0} -vsync 0 -r 1000 -f image2 -frame_pts 1 keyframe-%09d.jpeg

This will print the pts as milliseconds in the filename.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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