GSoC-2021 With Shaka Streamer
Student: Omer Yacine
Shaka Streamer is a tool that simplifies media transcoding and packaging by utilizing FFmpeg and Shaka Packager and managing the command line arguments that should be fed to them using simple and reusable configuration files.
The two features concerning this project:
- Adding a
PeriodConcatnode that will make Shaka Streamer capable of producing multi-period DASH manifests using the single-period manifests outputted by Shaka Packager(which yet doesn't support multi-period DASH). A workaround can be done for HLS since it doesn't support periods, by using
#EXT-X-DISCONTINUITYtag as a separator between different periods.
- Bundling hermetic copies of FFmpeg and Shaka Packager and allowing the user to specify whether Shaka Streamer should use the hermetic versions or the system-wide versions instead.
- Multi-period for DASH (Merged)
This commit manipulated the structure of the input configuration to let it accept the new multi-period option. The field
multiperiod_inputs_listwas added to the input configuration. This commit also implemented the DASH period concatenation, in which, the streamer would manage multiple PackagerNodes and concatenate their output when they finish using python's native
- Multi-period for HLS (Merged)
In this PR, a minimal HLS parser was implemented. It searches only for the tags we care about and keep the rest of the playlist untouched. After all the master and media playlists are parsed and represented as python objects, all the media playlists are then sorted out into the appropriate type(video-audio-subtitles) and get fed to one of the four concatenation methods. These methods will make the best concatenation choices based on a playlist's attributes: codec, resolution, channel layout, and language.
- Bringing Windows Support (Merged)
This commit has introduced a new
Pipeobject that would abstract POSIX pipes(which are made using the
os.mkfifo()system call), Windows pipes(implemented as two named pipes between two processes and a server thread that moves the data between the two pipes), and file paths. With all the platform-dependent code being isolated away in a new file(
pipe.py), the rest of the project could then use the
Pipeobject without needing to know the platform it operates on.
- Offering hermetic platform-specific binaries (Merged)
This PR implements the integration between Shaka Streamer and the new PyPi package
shaka-streamer-binaries. It also has a build script to automate building
shaka-streamer-binariesfor all our supported platforms, and a download script to download and sort out the latest versions of the binaries we need for the building process.
Other relating changes:
channel_layoutsfield to the pipeline config (Merged)
This commit helped simplifying the multi-period for HLS task. Prior to this, the implementation of the audio concatenation for HLS was more complex and would sometimes produce multiple media playlists with the same attributes but different period characteristics in some periods, which an HLS player could not differentiate between. In this commit, the field
channel_countwas removed and replaced with
channel_layoutswhich offered more audio encoding flexibility.
here.All my PRs to Shaka Streamer can be found
- Writing documentation about the new package
shaka-streamer-binariesin Shaka Streamer's docs.
- Writing documentation on how to use multi-period concatenation and the prerequisites to carry out a successful concatenation.
- Integrating the Streamer's multi-period support with Shaka Packager's HTTP PUT support.
posixpathmodule instead of
os.pathfor period concatenation as these manifests will be used on the web on windows.