python获取视频缩略图_在python中从视频源创建视频缩略图

I have url of a video files and I want to generate the thumbnail each of this video source url.I'm using Django.

My application does this:-

1. Crawl the some webpage

2. Extract all the video link from it.

3. If there are thumbnails, get those thumbnails.

4. if not thumbnails:

#here I need to generate video thumbnails from the

#links I extracted in 2nd step.

Is there any way to do this without downloading the complete video and generating thumbnails.

If I download each video, then there will be lot of bandwidth wastage and require lot time.

Thanks

解决方案

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.

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"

Hope it helps. Let us know about results.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值