检查文件是否有视频流
我使用的是 Mac OS X (Objective-C),我正在寻找一种方法来确定文件是否具有视频流。更具体地说,是可以由 FFmpeg 解码的视频流。我可能可以将一些东西与 Objective-C 结合起来来查看文件是否具有与 QuickTime 兼容的视频流,但这还不够。我可以尝试 MediaInfo,但我不知道它可以打开哪些文件。另一个选择是运行 FFmpeg 和 grep 以查看是否有视频流。但这相对较慢,所以我查看了 FFmpeg 的源代码,看看他们是如何检测它的,我什至找不到在哪个文件中启动。
I'm on Mac OS X (Objective-C) and I'm looking for a way to determine if a file has a video stream. More specifically, a video stream that can be decoded by FFmpeg. I probably can put something together with Objective-C to see if a file has a QuickTime-compatible video stream but that's not enough. I could try MediaInfo but I don't know which files it can open.. Another option would be running FFmpeg and grep to see if there's a video stream. But this is relatively slow so I looked at FFmpeg's source code to see how they detect it and I couldn't even find out in which file to start.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里是使用 libavformat 和 libavcodec 的教程(两者都是FFMpeg)来获取视频流信息。
Here is a tutorial on using libavformat and libavcodec (both part of FFMpeg) to get video stream info.