Creating thumbnails from video files with Python on my website
Question: I need to create thumbnails for a video file which users uploaded to web site
running django.

How would I go about this...which function can do this ? I can display
thumbnail images but I cant capture a view from a video. Thanks for helps.


Answer: Videos are tricky business due to the vastness of codecs, containers, etc. I
would recommend to use [`ffmpeg`](http://ffmpeg.org/) due to it's vast support
and call it in Python using
[subprocess](http://docs.python.org/2/library/subprocess.html) module.
Following the [first](http://blog.prashanthellina.com/2008/03/29/creating-
video-thumbnails-using-ffmpeg/) Google hit for `ffmpeg video thumbnail`, you
can do it like:

    
    
    from subprocess import check_output
    check_output('ffmpeg  -itsoffset -4  -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg', shell=True)
    

Obviously you have to change the command string but this should get you
started.

