Extract an image screenshot from a Video with ffmpeg 3

Posted by Antonin AMAND Mon, 27 Nov 2006 18:17:00 GMT

Here is a way to extract a sample image from a video with ffmpeg :

$ ffmpeg  -itsoffset -4  -i sample.mov -vcodec png -vframes 1 -an -f rawvideo -s 320x240 test.png
  • -itsoffset -4 : means that you want to extract the image 4 seconds after video starts.
Comments

Leave a comment

  1. passcheckbot@yahoo.com about 1 year later:

    It works gloriously! I tried it with mpg,avi, and wmv files so far. Here is a way to pull four thumbnails from a movie (on systems with mdls)

    !/bin/sh

    It works gloriously! I tried it with mpg,avi, and wmv files so far. Here is a way to pull four thumbnails from a movie (on systems with mdls)

    movie=$1 seconds=mdls $movie | grep DurationSeconds | sed 's/..* = ([0-9][0-9]*)..*/\1/' seconds=expr $seconds - 1 qsec=expr $seconds / 4 start=1 while [ $start -lt $seconds ] do echo “start $start qsec $qsec movie $movie still ${movie}.${start}sec.png” ffmpeg -itsoffset -${start} -i $movie -vcodec png -vframes 1 -an -f rawvideo -s 320x240 ${movie}.${start}sec.png start=expr $start + $qsec done

  2. Ericson Wilkinson about 1 year later:

    great resource, this really saved me some time searching through the ffmpeg command line docs :)

  3. Stefan Johne about 1 year later:

    Thank you very much =D I use my own FFMPEG code for uploading different files and taking screens, but forget how to take shots after xxx seconds :-x sometimes FFMPEG is very… crude :(

Comments