Hybrid Broadcast Broadband Demonstrators using GPAC

Overview

The users' demand for more content with more features has made broadcasters investigate worldwide how to enhance their broadcast services while not overloading their bandwidth capacities. In the course of the H2B2VS project, some use cases of hybrid MPEG-2 TS and MPEG-DASH delivery have been studied and developped into demonstrators, using GPAC as a technical framework for experimenting with hybrid broadcast broadband delivery. This test bed can be reproduced from scratch using GPAC and the instructions given in this page.

Before going any further, please make sure you have a recent version of GPAC installed on your system. Check our download page.


Content Production

GPAC comes with two useful tools in the context of content production for these demonstrations:
- MP42TS, an MPEG-2 TS multiplexer
- MP4Box, an MP4 packager, streamer and DASH segmenter

In this section, it is assumed that the content has already been encoded and is packaged into MP4. To package content in MP4, use MP4Box as follows:
MP4Box -add SOURCE -new DEST.MP4
MP4Box supports a large set of source files, including TS files, raw elementary stream for video, MP3 and AAC (ADTS or LATM). Cf here for more information, and MP4Box -h import.

MP42TS General Usage

To produce a TS file from a source file: MP42TS -src source.mp4 -dst-file test.ts
To produce a multicast TS from a source file: MP42TS -src source.mp4 -dst-udp 224.0.0.1:1234
To produce a multicast TS at rate 2 mbps from a source file: MP42TS -src source.mp4 -rate 2000 -dst-udp 224.0.0.1:1234
To produce a multicast TS with 5 packets per IP datagram from a source file: MP42TS -src source.mp4 -nb-pack 5 -dst-udp 224.0.0.1:1234
To produce a TS with a single AU per PES packet (as required by most DVB implementations): MP42TS -src source.mp4 -single-au [DST]
For more options check MP42TS -h

When setting up hybrid demonstrators using TEMI as the media clock, GPAC will require the TEMI location descriptor to locate the source content associated with the multicast. The typical command used is:
MP42TS -src SOURCE -single-au -temi http://foo.bar/manifest.mpd [DST]

By default the URL will be inserted every second, but this can be adjusted using the -temi-delay option. This will set the delay to 5 seconds:
MP42TS -src SOURCE -single-au -temi-delai 5000 -temi http://foo.bar/manifest.mpd [DST]

By default the TEMI timeline will loop when the source content loops in live multicast mode. This is typically used for cases where the associated content is a static resource. If the associated content is also live, the TEMI timeline must keep increasing after the loop:
MP42TS -src SOURCE -single-au -temi-noloop -temi http://foo.bar/manifest.mpd [DST]

Note: it is possible to generate a TS file (not multicast) containing TEMI codes for later playback/muxing/broadcasting.

DASH Packaging using MP4Box

For a detailed review of DASH options, check MP4Box -h dash. For some general information on DASH and MP4Box, please check GPAC website and associated posts.

For the time being, GPAC only supports hybrid demonstrators where the DASH content is packaged into ISOBMFF files. It should be possible to use MPEG-2 TS files for the DASH content as long as the initial PCR and PTS are 0, or that the DASH MPD is modified to insert the presentationTimeOffset attribute in the TS representation(s) (ie, TEMI in the addon streams is not supported).

DASH onDemand session setup

To prepare an on-demand session conforming to the DASH Live profile, use:
MP4Box -dash DASH_DUR -profile live -out session.mpd source1.mp4 ... sourceN.mp4

To prepare an on-demand session conforming to the DASH onDemand profile, use:
MP4Box -dash DASH_DUR -profile onDemand -out session.mpd source1.mp4 ... sourceN.mp4

The parameter DASH_DUR is the duration of each dash segment, and shall be close to the GOP length of the media. If you plan to do adaptive streaming (several bitrates/resolution of the same content), make sure the GOPs are aligned in each source. If you plan to use the DASH session with a PCR-based synchronisation, you will have to specify the PTS of the TS stream corresponding to the first AU of your DASH session, if different from 0. This shall be done by editing the MPD file produced and adding the attribute presentationTimeOffset in each representation, with the value V = PTS / 90000 * timescale. timescale is given in the AdaptationSet or Representation, or is 1000 if not present.

DASH live session setup

To prepare a live session conforming to the DASH Live profile, use:
MP4Box -dash-live DASH_DUR -profile live -out session.mpd source1.mp4 ... sourceN.mp4

This command will make MP4Box run forever or until 'q' is typed in the prompt, generating a live session starting at the current UTC clock on the machine. The parameter DASH_DUR is the duration of each dash segment, and shall be close to the GOP length of the media. If you plan to do adaptive streaming (several bitrates/resolution of the same content), make sure the GOPs are aligned in each source. If you plan to use the DASH session with a PCR-based synchronisation, you will have to specify the PTS of the TS stream corresponding to the first AU of your DASH session, if different from 0. This shall be done by editing the MPD file produced and adding the attribute presentationTimeOffset in each representation, with the value V = PTS / 90000 * timescale. timescale is given in the AdaptationSet or Representation, or is 1000 if not present.

Hybrid Distribution of UHD content

Use Case Overview

In this use case, an SHVC encoded 4K video with a base layer of HD resolution will be distributed as follows:

The DASH session may be either live or onDemand.

For this use case, you will need an SHVC stream compatible with SHM4.1, in byte-stream format (Annex B of HEVC). Upgrade to final version of the specification will be made soon. Sample streams are available here, with an audio track

Use Case Test Bed

The following content preparation is required:

You can then use the command lines given in the previous section. For example to simulate a live DASH and broadcast, run at the same time the following commands:
MP42TS -src demo_base.mp4 -single-au -dst-udp 239.0.0.1:1234 -temi http://foo.bar/dash.mpd -temi-noloop
MP4Box -dash-live 1000 -subdur 1000 -mpd-refresh 1 -profile live -out dash.mpd demo_scal.mp4

To simulate a static DASH and broadcast, run once the following command to generate the DASH session:
MP4Box -dash 1000 -profile live -out dash.mpd demo_scal.mp4

and then run
MP42TS -src demo_base.mp4 -single-au -dst-udp 239.0.0.1:1234 -temi http://foo.bar/dash.mpd

You can then playback the result using
MP4Client udp://239.0.0.1:1234 or in GUI mode MP4Client -guid udp://239.0.0.1:1234

Broadband Distribution of Alternate views of a broadcast video

Use Case Overview

In this use case, a secondary view is send over broadband and displayed in sync with the live TS. For example, the 1080p and 360p versions of Telecom ParisTech test counter (you may want to add the audio stream of the counter.

Use Case Test Bed

You can use the command lines given in the previous section. For example to simulate a live DASH and broadcast, run at the same time the following commands:
MP42TS -src counter_video_1080.mp4 -single-au -dst-udp 239.0.0.1:1234 -temi http://foo.bar/dash.mpd -temi-noloop
MP4Box -dash-live 1000 -subdur 1000 -mpd-refresh 1 -profile live -out dash.mpd counter_video_360.mp4:role="Alternate"

To simulate a static DASH and broadcast, run once the following command to generate the DASH session:
MP4Box -dash 1000 -profile live -out dash.mpd counter_video_360.mp4:role="Alternate"

and then run
MP42TS -src counter_video_1080.mp4 -single-au -dst-udp 239.0.0.1:1234 -temi http://foo.bar/dash.mpd

You can then playback the result using
MP4Client udp://239.0.0.1:1234 or in GUI mode MP4Client -guid udp://239.0.0.1:1234

Trick modes on a broadcast video without local timeshifting

Use Case Overview

In this use case, the live content is sent over broadcast and also available over broadband. The player is able to use the broadband version to navigate in the past (fast rewind, seek, pause), and can resume back to live.

Use Case Test Bed

You can use the command lines given in the previous section, but you need to specify a role of "main" for the DASH representation. For example to simulate a live DASH and broadcast, run at the same time the following commands:
MP42TS -src source_content.mp4 -single-au -dst-udp 239.0.0.1:1234 -temi http://foo.bar/dash.mpd -temi-noloop
MP4Box -dash-live 1000 -subdur 1000 -mpd-refresh 1 -time-shift 60 -profile live -out dash.mpd source_content.mp4:role="main"

To simulate a static DASH and broadcast, run once the following command to generate the DASH session:
MP4Box -dash 1000 -profile live -out dash.mpd source_content.mp4:role="main"

and then run
MP42TS -src source_content.mp4 -single-au -dst-udp 239.0.0.1:1234 -temi http://foo.bar/dash.mpd

You can then playback the result using
MP4Client udp://239.0.0.1:1234 or in GUI mode MP4Client -guid udp://239.0.0.1:1234

This work was developped in the course of the project