Challenge Overview
The Hercules Player is an application that allows customers to download videos to their computer or device for offline playback, along with streaming playback of videos for online playback.
The Hercules Fog project has stripped out some key portions of the Hercules Player application into a new test application for downloading videos from a server, modifying the manifest, and then playing back on various mobile and TV devices.
The current implementation is C++ and will run on:
- Windows
Linux
Mac
Currently, the codebase works only with HLS / M3U8 streams. This challenge will continue to add support for MPEG Dash / MPD streams.
Requirements
The main goal of this challenge is to support the existing REST API for *only* live TV recordings. This will only be for configured bitrates. Bitrate switching will come later, along with all the other smaller pieces of functionality, like the “tsb” endpoint, and culling. For this challenge, the scope is as follows:
• Recording using the "/recording" endpoint
• Culling according to the configured cull time, similar to what's already done for HLS
• VOD recording (downloading all fragments quickly)
• Validate recording works against the new sample the client provided (URL in the forum)
MPEG Dash format
A sample manifest from a client system will be available in the forum.
You can find details on the format here:
• http://www.encoding.com/mpeg-dash/
• https://en.wikipedia.org/wiki/Dynamic_Adaptive_Streaming_over_HTTP
• https://www.brendanlong.com/the-structure-of-an-mpeg-dash-mpd.html
• http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip
Sample player
This site is what will be used by reviewers to test playback:
http://mediapm.edgesuite.net/dash/public/support-player/current/index.html
It is expected that reviewers will need to run Google Chrome with web security disabled to get around XSS / CORS issues when playing back from a Fog recorded URL. Feel free to use any of the live test streams there for testing, but please use at least one with video so we can ensure video *and* audio are working properly.
Manifest rewrite
For a live recording, the Fog application will load the remote URL manifest on a regular basis and will look for new fragments to add to the queue for downloading. The new MPD implementation should do the same, ensuring that it keeps up with the live recording, and ensuring that the manifest published by the recorder for playing back the recording contains all downloaded fragments for playback. The folder structure of the downloaded segments should roughly match what we do with the current HLS implementation, where we have the main manifest and then multiple “subManifest*” folders with the individual fragments.
Bitrates
The current HLS implementation can be configured for a single bitrate or multiple bitrates. The MPEG Dash implementation should be the same, where the recorder can download one or more bitrate streams simultaneously.
Implementation
This should have already been done previously, but it's kept here for reference on the work that's already been completed.
• Extend BaseDownloader for a “DashDownload” class, similar to what is done for HLSDownload
• Make MediaPlaylistDownload a generic class
• Extend MediaPlaylistDownload for two implementations:
• HLSPlaylistDownload
• DashPlaylistDownload
• Add code in the RecordingManager to detect the type of the URL - either by extension (.mpd vs. .m3u8) or by the MIME type of the manifest file. Dash MIME type is application/dash+xml
• Update FogRecording to work with both HLSDownload and DashDownload Right now MediaPlaylistDownload is targeted at just HLS, but we need to make it generic for any manifest type and then add concrete implementations for both HLS and Dash.
How to test
Testing for HLS will be documented in the forum. Testing for MPD will be similar, but we will use the player documented above instead of the viper player for HLS.
Steps include:
1. Start an MPD recording
2. Get the playback URL from the “/recordings” endpoint
3. Put the playback URL into the test player
4. Start playback For validation, we want to make sure that playback is smooth and that the MPD segments are served properly to the player.
HLS
After the changes, the HLS implementation should still work as normal, including the things not in scope for Dash, like logging, “recording” endpoint, adaptive bitrate, culling, etc…
Submission
Your code must be submitted as a Git patch file against the "dash_support" branch
https://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git/
Base your patch file against commit hash 180b62ffd23e02dce3045fc71c424ab2b00cd896.
Please make sure to test your patch before submission!