9

I use ffmpeg to capture screenshot from video. Here is the command code:

ffmpeg -i /my_video_file_dir/video.flv -y -f image2 -ss 8 -sameq -t 0.001 
-s 320*240 /image_dir/screenshot.jpg

And I want to capture the screenshot at a fine time unit 8.344 for example

But it does not output screenshot image by the above command

In my test, -ss 1,1.5,2,2.5 ... works fine and others not such as 1.1,1.11

Does andbody know why it happens and how can I capture screenshot at a x.xxx time

0

1 Answer 1

21

Try this instead:

ffmpeg -ss 00:00:01.01 -i /my_video_file_dir/video.flv -y -f image2 \
   -vcodec mjpeg -vframes 1 /image_dir/screenshot.jpg

Note that very small increments will not normally result in different images, due to lower frame rates of most videos. 0.001s increments only work with videos of 1000fps framerates :) 0.03 increments should work with a 30fps video, etc.

5
  • I get the corresponding relation between increments and framerates, thanks a lot!
    – hyperion
    Commented Feb 23, 2011 at 2:47
  • Take a look to the following shot:
    – user352353
    Commented May 6, 2013 at 16:50
  • 2
    This is a real solution: ffmpeg -i input.flv -ss 00:00:14.435 -f image2 -vframes 1 out.png
    – user352353
    Commented May 6, 2013 at 16:53
  • could you look at my question please stackoverflow.com/questions/27189948/…
    – Hitesh
    Commented Nov 28, 2014 at 13:56
  • 2
    I second @user352353's note, but per trac.ffmpeg.org/wiki/Seeking put the -ss flag before the -i flag for much faster performance! If someone wants to make an account on FFMPEG's Trac and update this wiki page, please do: trac.ffmpeg.org/wiki/… Commented Dec 25, 2014 at 19:01

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