获取MP4流的长度 [英] Get MP4 stream lengths

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

问题描述

我在一个应用程序中工作,我们使用IMediaDet来获取流的长度。现在我们开始使用MP4容器。问题是,当我尝试IMediaDet :: put_fileName()与MP4文件,我得到HRESULT = -2147024770(ERROR_MOD_NOT_FOUND)。使用comercial mp4解码器,我看到视频流使用mpg2编码。

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.

我的问题:如何获得MP4容器内流的流长度?有没有办法使IMediaDet接受这些文件?有没有办法指出什么demuxer IMediaDet应该使用?

My questions: How to get the stream length of a stream inside a MP4 container? Is there a way to make IMediaDet accept these files? Is there a way to point what demuxer IMediaDet should use?

任何帮助将非常感激。

推荐答案

不幸的是, DirectShow不包含MP4解析器,即使在Windows 7中。在Win7中,MP4功能已添加到媒体基金会。

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

因此,您有几个选项。您可以购买或构建一个directshow过滤器,实现MP4 demux和将其与mp4文件扩展名相关联,这样应该允许IMediaDet正确地对文件进行解复用。或者你可以使用Media Foundation,它应该能够返回这个信息。或者,您可以使用单独的库完全用于MP4文件,像MP4v2 。 (注意,如果您想直接使用DirectShow而不是MP4v2,也可以使用MP4v2实现MP4 demux过滤器)

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)

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

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