
Sometimes, you might just want to quickly add a thumbnail that represents a frame from the video, and move on. But sometimes, you might not have the time to manually choose the perfect thumbnail for every video you create. If you have time, the best thumbnail for a video is going to be one where you choose something representative of the video’s content, and then add it. Thumbnails give people an initial impression of what your video is about. Video thumbnails have the power to make a video more watchable.

It should do the complete job for you.Get the Code! Copied! Use a different Browser Blog Ĭreate a Thumbnail For Your Video with Python and FFMPEGĪp– Erikka Innes in Videos – Upload a Thumbnail, Python You can use the Python script pyvideothumbnailer found on GitHub, which uses MoviePy, MediaInfo and the PIL fork Pillow. (Disclaimer: I haven't used the Python interface before, but I know ImageMagick is good mojo.) Look into PythonMagick, a Python interface to ImageMagick. Honestly, that's the easiest way to handle online video and I'm not just shilling a 3rd party service, I'm a very happy user of that API and the internal video paths I was able to delete thanks to it. You could use the Youtube API for storage and transcoding and grab the feed thumbnails for free. When you get a video frame it can be very black, white etc to get some good thumbnail you can specify the mean value of all the pixel in the frame. Res, thumb_buf = cv2.imencode('.png', im_ar) #2)save on a buffer for direct transmission Im_ar = cv2.resize(im_ar, (thumb_width, thumb_height), 0, 0, cv2.INTER_LINEAR) Pil_image = VideoStream('0.flv').get_frame_at_sec(5).image() You can use ffvideo from ffvideo import VideoStream

I could not install ffvideo on OSX Sierra so i decided to work with ffmpeg. PyMedia lets you extract the frames (using the decoder() routine), while PIL has a simple thumbnail() routine.

A simple combination of PyMedia and PIL would do the trick for AVI, ASF, or MPEG files.
