Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'd like to repeat one frame from a source video to output. I've tried the following

avconv -ss 00:20:00 -i INPUT_VIDEO -t 0.5 -vsync 1 -an -r 1 -vcodec libx264 VIDEO_1F
avconv -i VIDEO_1F -t 10 -r 1 -vcodec libx264 OUTPUT_VIDEO

But I found that -ss doesn't work in the former command, and it would always extract the first frame of input video; in the latter -t has no effects and the duration of the output video will be 2 seconds.

Any suggestion? Or, is there a better approach?

share|improve this question

1 Answer 1

I've got a way out, with also 2 steps.

First extract the frame

avconv -ss 00:20:00 -i INPUT_VIDEO -vsync 1 -t 0.01 output.png

There is a chance that avconv extracts more than one frame within 0.01s, and terminates with an error "... Could not get frame filename number 2 from pattern 'output.png' ...". But don't mind since we need only the first frame.

Then convert the image to video

avconv -loop 1 -i output.png -vcodec libx264 -tune stillimage -t 10 OUTPUT_VIDEO
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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