获取视频文件的尺寸 [英] Get dimensions of a video file

查看:49
本文介绍了获取视频文件的尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

python 中有没有办法获取视频文件的尺寸或其他一些可以实现这一点的库?相当于 Media Info 什么的?谢谢.

Is there a way in python to get the dimensions of a video file or some other library that would accomplish this? The equivalent of a Media Info or something? Thank you.

推荐答案

在我上一家公司,我们遇到了类似的问题,我找不到任何 Python 库来解决这个问题.所以我最终使用了 python 中的 mediainfo,媒体信息也有一个命令行选项,很容易解析输出,所以实际上你使用 media-info 的 python 模块就足够了.它还有更多优势,因为最终您会发现所有媒体信息类型的软件都不支持所有编解码器/格式,因此您可以使用单个 Python 包装器在幕后使用多个软件/库.

In my last company we had similar problem and I couldn't find any python library to do this. So I ended up using mediainfo from python, media info also has a command line option and it is very easy to parse the output, so practically your python module which uses media-info will be sufficient. It has further advantage because eventually you will find all media-info type software doesn't support all codecs/format so you can use multiple software/libs under the hood with single python wrapper.

这篇关于获取视频文件的尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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