Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upload video and create thumbnail from video in django

Is there any model field for video in django? Any suggestion for plugin or snippets will be appreciated.

like image 433
TheNone Avatar asked May 10 '12 17:05

TheNone


People also ask

How do I create a thumbnail image in Django?

2) How to create the thumbnails of Image ?.. In Django , have the 'PIL' Package which is used modify/resize/create thumbnail of image files, while saving to databse. That means we have to do code while saving the images to server in Models file of Django as in below.

How do you make a video thumbnail in Python?

You can use ffmpeg-python to create a thumbnail and upload it for use with your video. If you don't want to get into learning FFMPEG, you can also use api. video's endpoint that allows you to pick a time from the video, and have it set as the video thumbnail for you automatically.

What is thumbnail in Django?

django-thumbnail-works provides an enhanced version of the default Django's ImageField, which supports: Processing the original image before it is saved on the remote server. Generating thumbnails of the source image and a mechanism of accessing the thumbnails as attributes of the source image.


1 Answers

MoviePy doesn't handle uploading in Django, but it can do thumbnail generation very easily:

from moviepy.editor import *
clip = VideoFileClip("example.mp4")
clip.save_frame("thumbnail.jpg",t=1.00)

http://zulko.github.io/moviepy/index.html

like image 82
Jeremiah Rose Avatar answered Sep 21 '22 00:09

Jeremiah Rose