How mpegts works

Can someone explain how mpeg-ts works. I went through the doc specification, but did not understand why several threads combine to form one stream.

I also opened the .ts file using the media information tool, and for Audio it showed 2 audio streams. So which audio stream will be used during playback of the content.

+4
source share
2 answers

Why it’s easy to explain: transfer multiple media on the same bitstream. Consider DVB (digital television): each transponder (= frequency) provides one bit stream. But for a television channel, you already need at least two streams: audio and video. And then it’s much more that you will never see the meta information. Therefore, instead of transferring each of these streams at a separate frequency, they are multiplexed into one bit stream. This is MPEG-TS (transport stream). Then the demultiplexer takes this stream and splits it into sub-streams that carry real information.

Thanks to this, a typical DVB-T transponder in Europe can carry four television channels (called a bouquet). The quantity may vary, this is the decision of the flow supplier (a compromise between higher quality = less channels = more expensive or less quality = more channels = cheaper, I think).

Regarding the playback of the audio stream: a television channel can have several audio streams (for example, ordinary sound, audio with descriptions for people with visual impairments, another language, etc.). By default, the player is likely to play the first audio stream, but can switch audio streams at any time.

+8
source

Mpeg2 TS is a container. Containers contain one or more audio / video streams, and also contain metadata describing how this data (mutttimedia streams) are stored in a file. Containers greatly simplify the display application by interleaving, synchronizing, inter alia.

In particular, mpeg2-ts is intended for streaming content (for example, Video On Demand). In such applications, the server must simultaneously transmit several video streams (for example, different camera angles during a football match) and several audio streams (for example, in different languages). They are multiplexed into a single mpeg2-ts file (uniquely identified by something called a program identifier). On the client site, the player’s application must select the PID of the video and audio stream for rendering. Alternatively, the player may request the user (for example, by selecting a language).

+4
source

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


All Articles