使用 Python 从视频文件创建缩略图 [英] Creating thumbnails from video files with Python

查看:56
本文介绍了使用 Python 从视频文件创建缩略图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上传到运行 python 的网络应用程序后,我需要为视频文件创建缩略图.

I need to create thumbnails for a video file once I've uploaded to a webapp running python.

我该怎么做...我需要一个库,它基本上可以为我做这件事,或者可以自动从视频文件(多种格式)中读取图像帧.

How would I go about this... I need a library that can basically either do this for me, or that can read the image frames out of video files (of several formats) automatically.

推荐答案

PyMedia 的简单组合href="http://www.pythonware.com/products/pil/" rel="nofollow noreferrer">PIL 可以处理 AVI、ASF 或 MPEG 文件.PyMedia 允许您提取帧(使用decoder() 例程),而PIL 有一个简单的thumbnail() 例程.

A simple combination of PyMedia and PIL would do the trick for AVI, ASF, or MPEG files. PyMedia lets you extract the frames (using the decoder() routine), while PIL has a simple thumbnail() routine.

这篇关于使用 Python 从视频文件创建缩略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆