Get native video resolution of a video file

爱⌒轻易说出口 提交于 2019-12-08 14:10:31
persiflage

You can use IMediaDet in DirectShow to get information on the streams in a media file including the resolution of video streams.

There are come caveats though so you might want a backup method.

You need suitable DirectShow filters registered which understand the media file being examined. It's possible that you may have a filter installed that gives wrong results - e.g. an audio only filter is registered for a media type that ignores any video streams in the file.

It's currently deprecated with no indication on the MSDN reference page of what is replacing this functionality. It can also be a pain to build as the headers have been removed from the Windows SDK.

Here's one case in point where that method doesn't work... Get MP4 stream lengths

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!