Topic outline

  • In this assignment, your task is to set up a WebRTC server for forwarding a live WebRTC stream, an HLS server for receiving the WebRTC stream and serving it as an HLS stream, and a website for viewing the WebRTC stream.

    Background

    WebRTC is a collection of protocols which provides applications low-latency secure direct communication over the internet. It is used through its application programming interface, which many browsers support using JavaScript, and which has libraries in several other programming languages, including C, Java and Python. The transmitted data can vary from simple text to encoded multimedia streams. The low latency of WebRTC makes it well suited for video live streaming.

    If you want a good understanding of the basic concepts of WebRTC, it is recommended to watch this WebRTC Crash Course on YouTube: https://www.youtube.com/watch?v=FExZvpVvYxA

    While peer-to-peer communication is a valid technique for connections between two endpoints, the amount of connections required rapidly increases, if you add more participants. This increases the computational resources required at the streamer-side, as the stream needs to be transmitted to all viewers. To make the stream more scalable, it can be sent to a streaming server, which forwards it to viewers, or other servers, further increasing the capacity of the system.

    Such low latency streaming works well in stable network conditions. However, if minimal latency is not required for the use-case, increased buffering can provide better viewing experience in less stable network conditions. In such cases, it can be beneficial to convert your stream into an HTTP based streaming protocol instead. This allows the clients to more easily control the buffering length, as well as the quality of the stream, if it is transcoded into multiple qualities. It can also help in situations, where you need to scale the stream to multiple hundreds or thousands of viewers, as the segments can be distributed using a CDN.

    In the last assignment, you worked with Dynamic Adaptive Streaming over HTTP (DASH). In this assignment, convert your video into HTTP Live Streaming (HLS), which is a similar segmented adaptive bitrate streaming protocol.

    Assignment Requirements

    Streamer connected to WebRTC server connected to HLS server. Both servers connected to client.First install and configure a WebRTC server capable of receiving and forwarding a WebRTC stream. The recommended tool is Janus, as it comes bundled with plugins and demo pages suitable for this. Specifically, the VideoRoom-plugin includes both streaming and RTP-forwarding capabilities suited for this task. You can edit the bundled demo page to create a streamer page, a viewer page, and enable forwarding when a stream is active.

    Receiving and HLS conversion of the RTP stream can be done using ffmpeg, an open-source tool capable of handling a vast amount of multimedia-tasks, including streaming and receiving video, transcoding, and file type conversions. Create an SDP-file matching the stream settings you configured for the forwarded stream. Once you are able to receive the stream, convert it into HLS segments and a manifest file. If your server has the available processing power, you can transcode the video into multiple qualities. Finally, serve the files using an HTTP server, and use an HLS client such as VLC player or HLS.js to view the stream

    Once you have both streams working, measure the delay of the streams. You can adjust parameters such as the network latency between your server and client, the segment size of the HLS stream, and the buffering time on the client. Try to form an idea of how the latency is formed.

    Grading

    • 30% of the grade is awarded for successfully setting up the WebRTC stream with the streamer and viewer pages.
    • 30% of the grade is awarded for successfully forwarding the RTP stream, and receiving it with your own SDP file.
    • 30% of the grade is awarded for converting the stream into HLS, hosting the segments, and viewing the HLS stream.
    • 10% of the grade is awarded for the measurement and analysis of the stream delay.

    The assignment is submitted by demoing your setup to a TA via Zoom during a slot reserved on MyCourses. During that demo, show your streaming system working by sharing your screen, explain how you implemented it, and present your analysis of the delay.

    Hosting your system locally, for example in virtual machines, is advised, as that lowers the risk of system failure due to external factors. It also gives you greater control over the system
    • Not available unless: You are a(n) Student
      Scheduler icon
      Assignment 3 Demos Scheduler