Demultiplexing is the core function in multimedia development.
The demultiplexing function is used to extract different audio and video streams from the audio and video signal sources. In addition, demultiplexing is generally an active operation, that is, extracting from the audio and video signal sources.
The data stream structure is source-> Demux-> stream
The main implementation modes include:
1) Direct mode: Obtain audio or video data from the signal source. This method is suitable for reading data sources in sequence and having frame position metadata.
In this mode, the data is directly obtained from Demux. Of course, the data can also be obtained from stream and then indirectly called Demux.
2) Indexing mode: if the direct mode does not contain the information of the frame position metadata (or the recorded real-time stream file), seek cannot be performed.
To solve this problem, you can index the audio or video streams during file parsing. In this mode, Demux's function is weakened after data parsing, and the data obtained is actually source-> stream.
3) cache mode: demultiplexing audio and video data, caching them separately, and then obtaining data through the corresponding data stream interface. This mode is used to dereuse network streams.
In this mode, source-> Demux-> stream.