3

I want to extract images from a video I want thous images to be extracted from specific time for example 0:30 1:15 1:45 and I would love them to be in PNG format as well

Thank you in advanced

Update Thank you rechengehirn and Rmano Sadly I can not except both of your answer and I selected it randomly sorry for that but I thought it would be fair like that because both of your answers work so Thank you again

2

This works for me:

ffmpeg -i input_movie.mp4 -ss 00:00:05 -f image2 -vframes 1 imagename.png

Where the options are:

-i              > The input video file
-ss  00:00:05   > Start at Second 5 of movie
-f image2       > Force image output
-vframes 1      > Set the number of video frames to record

You can read the ffmpeg documentation on: http://ffmpeg.org/ffmpeg.html

  • -f image2 is not needed. It is usually used in scripts where the output file name may be ambiguous to ffmpeg. – llogan Nov 12 '13 at 18:40
1

I am using a static build of a recent ffmpeg, but it should not matter. What I use is

ffmpeg -i videoin.avi -ss 30 -r 1 -t 1 myimage.png

that skips the first 30 seconds, then use a framerate of 1 frame/sec and creates images for 1 second.

Googling around I found this: http://linuxers.org/tutorial/how-extract-images-video-using-ffmpeg with a bit more options.

  • 1
    -vframes 1 or -frames:v 1 is usually recommended instead of -r 1 -t 1. – llogan Nov 12 '13 at 18:41

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.