Playing with WHIP for WebRTC Ingestion in Broadcasting

While we love and praise WebRTC here at WebRTC.ventures, I admit there are some broadcasting use cases that could benefit from a standard protocol. One way streaming is a good example. I might be joining a bit late to the WHIP party, but I love the idea of using WHIP as an WebRTC ingestion mechanism and wanted to give it a try. 

Why WHIP?

WHIP, now known as WISH (WebRTC Ingest Signaling over HTTPS), was proposed by the Millicast team to simplify video ingestion when using WebRTC. When you want to stream a live stream to, for example, YouTube, you can use YouTube Studio for that and send your RTMP stream by pointing to the desired URL. This Life of a Broadcast article provides more information on how this works using the YouTube Live Streaming API and the YouTube Content ID API.

By implementing WISH protocol, YouTube (or any other video platform) could support ingesting WebRTC streams following the same approach. The user could simply pass a URL endpoint and password to broadcast WebRTC video to the video platform!

Using YouTube Studio for live broadcasting, without WHIP

How does WHIP work?

To use WHIP as a WebRTC ingestion mechanism, you need an intermediate service that will communicate with the WebRTC media server and handle operations like creating an endpoint, trickle ICE, or destroying an endpoint. 

Basic flow diagram showing how a WebRTC client can communicate with a WHIP server to establish a one-way WebRTC connection to a media server

If you are saying this looks very similar to establishing a one way connection using a HTTP signaling server, you are right! The main difference here is that by using an agreed standard, multiple 3rd party platforms can be integrated together. 

Using Janus simple WHIP server

A while ago, the Janus team developed a simple WHIP server. In conjunction with Janus, it can provide this functionality and broadcast to a video room.

Simple WHIP Server (Janus)

Once you have the WHIP server and Janus server running, you just need a client to:

  1. Create a RTCPeerConnection
  2. Add the desired media to the track
  3. Create the offer
  4. Send the offer to the WHIP server
  5. Capture the response with the answer that will allow us to establish the one way media DTLS/RTP connection

Once that is complete, we should be getting the video stream in the video room. 

In this demo app I built based on aiortc, we can choose to send video. If you don’t send anything, we get a green screen by default.

Our experienced team is ready to build your broadcasting tool! Stream live events and conferences to viewers to large audiences around the world. Contact us today!

©2022 KLEO Template a premium and multipurpose theme from Seventh Queen

Log in with your credentials

Forgot your details?