Go Live Using WHIP and WHEP

Last update:2024-12-05 16:46:30

About WHIP and WHEP

WHIP (WebRTC-HTTP Ingest Protocol) is a standardized protocol that simplifies WebRTC streaming access. Utilizing an HTTP-based signaling mechanism, it allows broadcasters to efficiently publish WebRTC streams to media servers. Compared to traditional WebRTC configurations, WHIP offers lower latency, greater scalability, and end-to-end encrypted communication, ensuring more secure and reliable streaming services.

WHEP (WebRTC HTTP Egress Protocol) is focusing on optimizing outbound stream transmission from servers to clients. Similar to WHIP, WHEP employs an HTTP-based signaling approach, streamlining the connection process and significantly enhancing transmission performance. With modern media transmission solutions, WHEP ensures smooth and efficient data streams, thereby improving the user viewing experience.

Streaming with WHIP Using OBS

Preparation

  1. Activate Low-Latency Live Streaming Service: Ensure that the low-latency live streaming service is activated and add both the streaming (push) domain and playback (pull) domain to the console.
  2. Enable WHIP Streaming Mode: WHIP streaming is disabled by default and cannot be enabled via the console. Please contact our technical support team to activate this feature.
  3. Install OBS: Make sure OBS version 30.x or higher is installed. You can download it from the OBS Studio Official Website.

Step 1: Configure WHIP Server Address and WebRTC Streaming URL

  1. Open OBS: Launch OBS and select “Settings” to open the settings interface.

  2. Access Stream Settings: In the settings interface, choose “Stream” to navigate to the stream URL settings.

  3. Set Service Type to WHIP: In the service type dropdown, select “WHIP” and enter the streaming domain, application name, and stream name. The server address should be formatted as: domain + application name + stream name.sdp.


Step 2: Configure Streaming Parameters

  1. Navigate to Output Settings: Go to “Settings” > “Output” , and select “Advanced” under “Output Mode”.

  2. Set Recommended Streaming Parameters:

    • Audio Encoding: WebRTC requires Opus audio encoding. Using other audio encoding formats may result in the live audio being unplayable. In OBS, the Opus encoding is selected by default when the service is WHIP.

    • Video Encoding: It is recommended to use H.264 encoding. Some formats, such as H.265, may cause the video to be unplayable.

    • Remove B-Frames: To prevent video stuttering during playback on web pages, it is advisable to remove B-frames from the video encoding.


Step 3: Start Streaming

  1. Begin Streaming: Click “Start Streaming” in the “Control” section of the OBS bottom toolbar to push the media stream to the configured WebRTC address.

  2. Verify Streaming Status: When the indicator light below OBS turns green and remains steady, it indicates that the streaming is successful.


Testing WHEP Pull Streams with the Demo Player

  1. Visit our Demo Player.

  2. In the playback URL field, enter your pull stream domain using the format: pull domain + application name + stream name.sdp. Ensure that the application name and stream name match the settings used for stream input.

  3. Click the “Play” button. If the live content displays correctly, the pull stream is successful.


Frequently Asked Questions (FAQ)

  1. Q: What should I do if my streaming encoder does not support Opus audio encoding?
    A: You can use CDNetworks’ transcoding service. We will automatically convert the audio encoding to Opus format, ensuring that your live content plays correctly.

  2. Q: Why can’t I play the stream when I choose H.265 video encoding?
    A: Currently, WHIP and WHEP do not support H.265 video encoding. It is recommended to use H.264 encoding or utilize CDNetworks’ transcoding service to convert the video encoding to H.264 format.

  3. Q: Why should B-frames be removed?
    A: B-frames can cause video streams to stutter during playback on web pages. While removing B-frames is recommended to ensure smooth playback, it is not mandatory. If your streaming encoder cannot remove B-frames, you may choose to retain them for streaming.

Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!