What is the format of the mpeg-dash (.m4s generally) segment?

I'm new to the multimedia programming, I'm trying to produce live mpeg-dash content from a transport stream buffer by parsing the packets individually.

I want to create .m4s segments but i'm confused about their structure.

In other words, if we combine multiple segments, will we produce a mpeg transport stream, an mpeg program stream or individual elementary streams?


Solution 1:

MPEG-2 Transport Streams and MPEG-DASH segments are different things. The former is a specification for packetized transmission of audiovisual content over unreliable networks, whereas the latter are used for transmission over reliable HTTP. Therefore, the concept is a bit different.

In contrast to MPEG-TS, there are different ways to prepare media for MPEG-DASH transmission. .m4s files are one option—in fact, MPEG-TS is another one.

.m4s files are individual media segments of one complete file. They are in the ISO Base Media File (ISOBMFF) format. The idea is to split one longer file (e.g. think of one movie encoded as an .mp4 file) into individual files that can be downloaded independently via HTTP.

If you concatenate multiple .m4s segments, you will get a complete, playable file again—the media segments themselves are not playable on their own, as they require the first initialization segment to be decoded first. Please read the linked specification for more info. You can also find some older information on that topic from GPAC.

You may choose to combine video and audio tracks in one file, but usually, for HTTP Adaptive Streaming, audio and video are transmitted in separate streams.

In your specific case, if you have existing MPEG-TS content and want to re-mux it into ISOBMFF segments, bento4 may be a good framework to use, if you want to do that programmatically. Also, the dashcast program can take any input and create live DASH output streams.