DirectShow: select a video stream source from an MP4 container

I am creating an application that should read H264 and AC3 streams from an MP4 container and move them to a single ISMV file. The MP4 source file contains several video streams with different bitrates and several audio streams of different languages.

When I call IGraphBuilder :: AddSourceFilter for my source file, I get a filter with two output pins: "Video" and "Audio". How to choose which specific stream (for example: what bitrate of a video stream) to use for "Video" and "Audio"?

Should I create several source filters to read this file and move them to ISMV, or am I missing something?

+3
source share
1 answer

It depends on what you use for MP4. I don’t think there is a demo version of MP4 with a margin, so you probably got it as part of the decoder package, and it acts as a source and a demo.

You can try the free open source MP4 demo at www.gdcl.co.uk/mpeg4. You will need AddSourceFilter (getting the source of the file with one output), and then explicitly connect the original output to the demultiplexing input. Then you will have output outputs corresponding to all the included threads that demux understands, and you can choose the ones you want.

WITH

+4
source

Source: https://habr.com/ru/post/1751737/


All Articles