Extract an image screenshot from a Video with ffmpeg 3
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.


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 - 1qsec=expr $seconds / 4start=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 + $qsecdonegreat resource, this really saved me some time searching through the ffmpeg command line docs :)
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 :(