开发者

Get MP4 stream lengths

开发者 https://www.devze.com 2023-01-10 22:26 出处:网络
I\'m working in an app in wich we use IMediaDet to get stream lengths. Now we\'re starting to work with MP4 containers. The problem is, when I try an IMediaDet::put_fileName() with the MP4 file, I get

I'm working in an app in wich we use IMediaDet to get stream lengths. Now we're starting to work with MP4 containers. The problem is, when I try an IMediaDet::put_fileName() with the MP4 file, I get HRESULT = -2147024770 (ERROR_MOD_NOT_FOUND). Using a comercial mp4 demuxer, I see the video stream uses mpg2 encoding.

My questions: How to get the stream length of a stream insid开发者_Go百科e a MP4 container? Is there a way to make IMediaDet accept these files? Is there a way to point what demuxer IMediaDet should use?

Any help would be much appreciated.

Thanks.


Unfortunately, DirectShow does not contain an MP4 parser, even in Windows 7. In Win7, the MP4 functionality was added to media foundation.

So you have a few options. You can buy or build a directshow filter that implements an MP4 demux and associate it with the "mp4" file extension, which should allow IMediaDet to properly demux the file. Or you can use Media Foundation, which should be able to return this info. Or you could use a separate library entirely for MP4 files, like MP4v2. (note you could also implement an MP4 demux filter with MP4v2, if you want to use DirectShow instead of MP4v2 directly)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号