尝试确定 h.264 配置文件和务实的水平
理想情况下,解决方案是在 python 和跨平台中,但这可能不太可能,所以我所需要的只是它在 Linux 中工作,并且如果需要,我可以使用 ac 扩展来与 python 接口。我看到有一个用于 ffmpeg 的 python 绑定,我正在考虑使用它,但是我无法弄清楚如何使用 fmmpeg 或其他任何东西来确定配置文件和级别,更不用说实用了。谷歌在这件事上也没有提供太多帮助。
我已经能够确定我要寻找的功能,如果我需要手动确定配置文件和级别,那么我可以这样做,但这会导致问题,ffmpeg 可以确定视频是否用该编码进行编码吗?功能集?我想我想知道的是,编码后是否可能无法完全确定级别和特定配置文件?我认为你必须知道才能解码它,但也许不是;这可以解释为什么我找不到任何相关信息。我已经断断续续地考虑这个问题有一段时间了,但最近决定考虑一个我一直在考虑的项目,但这是阻碍我的大事之一。
Ideally the solution would be in python and cross platform, but that's probably not too likely, so all I require is it work in linux, and I can use a c extension to interface w/python if necessary. I see there is a python binding for ffmpeg which I was thinking about using, however I can't figure out how to determine the profile and level as it is, with fmmpeg or anything else, much less do it pragmatically. Google is not much help on the matter either.
I've been able to determine what features I'd be looking for if I needed to determine the profile and levels manually then I can do that, but then that leads to the question, can ffmpeg then determine if the video was encoded with that feature set? I guess what I'm wondering to that effect is, is it perhaps not possible to fully determine the level and specific profile after encoding? I would think you'd have to know in order to decode it, but maybe not; that would explain why I can't find any information on it. I've been toying with this on and off for awhile, but recently decided to consider a project I'd been thinking about, but this is one of this big things holding me back.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是我写的一个小程序。它打印使用 h264 作为视频编解码器的 MP4 文件的配置文件和级别。
您可以使用以下命令行编译它:
这是 C 源代码:
Here is a small program I wrote. It prints the profile and level of MP4 files that use h264 as the video codec.
You can compile it with the following command line:
Here is the C source :
基本上,您需要识别比特流中的 SPS(序列参数集)并解码其前导字节。
请参阅 H.264 流标头 及其链接。
Basically you need to identify SPS (Sequence Parameter Set) in the bitstream and decode a couple of its leading bytes.
See H.264 stream header and links there.