简体   繁体   English

如何使用Python将AVI视频表示为一组矩阵?

[英]How can I represent avi video as set of matrices using Python?

I have video files written in avi format and I would like to analyze these videos using Python. 我有以avi格式编写的视频文件,我想使用Python分析这些视频。 For that I would like to represent every frame of the video as a 2D matrix. 为此,我想将视频的每一帧表示为2D矩阵。

How can I do that? 我怎样才能做到这一点? Google search gives me PyMedia as a way to go? 谷歌搜索给我PyMedia作为一种方式? Is it really the best choice or there some other approaches that I should to considered? 确实是最佳选择还是我应该考虑其他一些方法?

If the PyMedia is a good choice, could anybody pleas to give me a link where I can get exe files to install the module on Windows from binaries? 如果PyMedia是一个不错的选择,请问有人可以给我一个链接,让我可以从其中通过二进制文件获取exe文件以在Windows上安装模块吗?

By the way, is it a good idea, in general, to use Python for these purposes? 顺便说一句,通常将Python用于这些目的是个好主意吗? I like Python very much because of its simplicity and I prefer to use it, but if it is really not suitable for analysis of video, I am ready to use something else. 我非常喜欢Python,因为它简单易用,我更喜欢使用它,但是如果它真的不适合视频分析,那么我准备使用其他东西。

ADDED Some people claim that PyMedia is "dead". 添加有些人声称PyMedia是“死亡”的。 Is it true? 是真的吗

Yeah, the latest news on the PyMedia web site is dated 01 Feb 2006. That's a pretty bad sign. 是的,PyMedia网站上的最新消息发布于2006年2月1日。这是一个非常糟糕的信号。

The most active and up-to-date open project for manipulating video is ffmpeg . ffmpeg是最活跃,最新的视频处理开放项目。 Apparently there is a recently updated python wrapper for it: http://code.google.com/p/pyffmpeg/ 显然有一个最近更新的python包装器: http : //code.google.com/p/pyffmpeg/

In general Python is much too slow for doing any sort of pixel analysis of video. 通常,Python对于进行视频的任何像素分析都太慢了。 Therefore there will be practically zero libraries of any reasonable level of quality and support for helping at the pixel level of granularity. 因此,实际上将有零个具有任何合理水平的质量和支持在像素级粒度上提供支持的库。 There are well supported libraries for working at an image level of granularity though. 但是,有很好的支持库可以在图像的粒度级别上工作。 PIL seems to be a popular choice: http://www.pythonware.com/products/pil/ PIL似乎是一个受欢迎的选择: http : //www.pythonware.com/products/pil/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM