Support for variant streams & alternative renditions with HLS
HLS support for variant stream and alternate renditions
Motivation
HTTP Live Streaming specification in RFC 8216 defines alternate renditions and variant streams.
Variant streams are different encodings of the same presentation.
- Each Variant Stream MUST present the same content.
- Matching content in Variant Streams MUST have matching timestamps which allows clients to synchronize the media.
- Variant Streams SHOULD contain the same encoded audio bitstream.
Alternative rendition provides an alternative for one of the media or variant stream, an example of which would be supporting multiple languages using different audio streams.
Section 8.6 and 8.7 of the RFC show an example of both.
As of this writing, the existing HLS sink elements don't support variant streams and alternate renditions.
Proposal
Introduce a new element hlssink4
with support for
- Generating master playlist
- Variant streams
- Alternate renditions
This then enables support for subtitles and closed captions as well.
The work has similarities with what's being done in the yet to be merged encs3hlsbin
with two primary differences.
- Not tied to S3
- Encoding or bit rate ladder isn't implemented inside
hlssink4
While one could also extend hlssink3
, with the existence of HlsBaseSink
,
-
hlssink4
can be built on top ofHlsBaseSink
- keep the management of master playlist and thus variant stream, alternate renditions separate and outside
hlssink3
- Introduce pad naming on the same lines as
splitmuxsink