Create video thumbnail from video source in python

♀尐吖头ヾ 提交于 2019-12-01 13:33:49
martincpt

You should try ffmpeg. sudo apt-get install ffmpeg

I haven't tested this solution but I was just interested so I looked around a bit.

ffmpeg -ss 00:03:00 -i Underworld.Awakening.avi -frames:v 1 out1.jpg

This example will produce one image frame (out1.jpg) somewhere around the third minute from the beginning of the movie. The input will be parsed using keyframes, which is very fast. The drawback is that it will also finish the seeking at some keyframe, not necessarily located at specified time (00:03:00), so the seeking will not be as accurate as expected.

Source: Fastest way to extract a specific frame from a video (PHP/ffmpeg/anything)

Another answer claims it's possible to use it via http on remote videos so it may worth a try.

ffmpeg -i "http://subdomain.cloudfront.net/video.mp4" -ss 00:00:10 -vframes 1 -f image2     
"image%03d.jpg"

Source: How to read remote video on Amazon S3 using ffmpeg

Hope it helps. Let us know about results.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!