Skip to content

HLS stream output

Alaric Senat requested to merge asenat/vlc:sout-hls.3 into master

Context

This HLS module is introduced to be used as a backend for a chromecast output rework, it will provide a more stable a predictable stream source and add subtitle support for the Chromecast.
For a more detailed context about HLS and Chromecast, please refer to #27391.

What's new since the POC version

This MR bring a new stream output module rewritten after my work on a more POC project [1] validating that an HLS backend could be usable and working as a Chromecast output.

Several points on this supposedly cleaner implementation of the HLS module:

It has a low set of features right now

To make the reviews incremental, this first version has a basic set of features. It should be specifically noted that:

  • It only supports H264 and AAC contained in MPEG-TS
  • Segments can be stored in memory (This is needed by chromecast)
  • Video segments aren't guaranteed to start with an I-Frame

These points will be addressed in future merge requests, but it's still usable as is.

It lacks a way to identify tracks from user input

As explained in bb1886b9, ES ids aren't unique and with "input-slaves" they usually clash. This is a problem for specifying a subtitle track. I'm looking forward to the stream output workshop to expose and talk about the issue.

It's monolithic compared to the POC

The first version I made used the already written livehttp access output module which is feature-proof and allowed me to focus only on the stream output.
It turned out that sharing the stream output context with the access out and allowing the segmentation to happen inside the sout module (SetPCR is used for that), led to a cleaner and more accurate implementation.

The stream output could definitely replace the livehttp access out once it has the same set of features, for now encryption, filesystem and a lot of options are still missing.

It's designed to support subtitle and multiple tracks

Having HLS implemented as a stream output allows a lot of flexibility on how we mux and expose tracks. The proposed module allows having a main Manifest and several tracks exposed in parallel. The newly introduced PCR allow to properly split segments without having to worry about non-continuous data stream like subtitles.

What's next ?

While the first version of the module is reviewed, I'll continue to work on expanding the features of the stream output notably, in that order of priority:

  • Add subtitle support (already implemented in the POC [1])
  • Expand codec support (HEVC,VP9/8)
  • Support filesystem output (Done for this version)

[1] https://code.videolan.org/asenat/vlc/-/tree/chromecast-hls

Edited by Alaric Senat

Merge request reports