Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate video screencaps of video files via linux commandline

Is there a command line program for linux (ubuntu) which can generate a large image containing say 6 caps from a given video (e.g. WMV) laid out storyboard style (I know on Windows media player classic can do this)? I need this for part of a script I am writing.

like image 790
Robin Barnes Avatar asked Jul 19 '09 20:07

Robin Barnes


3 Answers

I pulled the answer from this site: http://blog.prashanthellina.com/2008/03/29/creating-video-thumbnails-using-ffmpeg/

ffmpeg -itsoffset -4 -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg

Where -4 is the number of seconds into the file to grab the screenshot, 320x240 is the screenshot size, and test.jpg is the output file.

Hope this helps.

like image 72
John Ledbetter Avatar answered Nov 06 '22 13:11

John Ledbetter


Use SlickSlice

./slickslice.sh -x video.avi -s 5x3 -e
like image 44
doomatel Avatar answered Nov 06 '22 13:11

doomatel


I've used MPlayer to save frames as images and ImageMagick to combine them:

mplayer -nosound -sstep 15 -vo png video.mkv
montage *.png -tile 3x3 -geometry 300x+0+0 screencaps.png
like image 40
Lri Avatar answered Nov 06 '22 15:11

Lri