DirectShow:从 MP4 容器中选择源视频流

发布于 2024-09-07 09:02:08 字数 371 浏览 3 评论 0原文

我正在构建一个应用程序,需要从 MP4 容器读取 H264 和 AC3 流并将它们混合到单个 ISMV 文件中。源MP4文件包含多个不同比特率的视频流和多个不同语言的音频流。

当我调用 IGraphBuilder::AddSourceFilter 时在我的源文件中,我得到一个只有两个输出引脚的过滤器:“视频”和“音频”。如何选择用于“视频”和“音频”的特定流(例如:视频流的比特率)?

我是否必须实例化多个源过滤器才能读取该文件并将它们混合到 ISMV 中,或者我是否遗漏了某些内容?

I am building an application that needs to read H264 and AC3 streams from a MP4 container and mux them into a single ISMV file. The source MP4 file contains a number of video streams of different bitrates and a number of audio streams of different languages.

When I call IGraphBuilder::AddSourceFilter for my source file, I get a filter that has just two output pins: "Video" and "Audio". How do I choose which particular stream (e.g.: which bitrate of a video stream) to use for "Video" and "Audio"?

Do I have to instantiate multiple source filters to read that file and mux them into ISMV, or am I missing something?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笑,眼淚并存 2024-09-14 09:02:08

这取决于您用于 MP4 的解复用器。我认为没有库存的 MP4 解复用器,因此您可能有一个作为解码器包的一部分,它既充当源又充当解复用器。

您可以在 www.gdcl.co.uk/mpeg4 上尝试免费的开源 MP4 解复用器。您将需要 AddSourceFilter(获取具有单个输出的文件源),然后将源输出显式连接到解复用器输入。然后,您将拥有与解复用器理解的所有启用的流相对应的输出引脚,并且您可以选择所需的输出引脚。

G

That depends on the demux you are using for MP4. I don't think there is a stock MP4 demux, so you have probably got one as part of a decoder package, and that is acting as both source and demux.

You can try the free open-source MP4 demux at www.gdcl.co.uk/mpeg4. You will need to AddSourceFilter (getting a file source with a single output) and then explicitly connect the source output to the demux input. Then you will have output pins corresponding to all enabled streams that the demux understands, and you can select the ones you want.

G

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文