WHIP

WHIP allows you to ingest media streams over WebRTC directly from OBS, ffmpeg and other video clients.Compared to other protocols supported to ingest video such as RTMP and SRT, WHIP has two main advantages: it comes with no additional ingress charges and it has a much lower latency.

Quickstart

Acquire credentials

To get the endpoint and token, you can use the following API:
call := client.Video().Call("default", uuid.New().String())
// create the call where the WHIP will be sent to
response, err := call.GetOrCreate(ctx, &getstream.GetOrCreateCallRequest{})

// ensure we have a user for the host to send video via WHIP
client.UpdateUsers(ctx, &getstream.UpdateUsersRequest{
	Users: map[string]getstream.UserRequest{
		"whip-user": {
		  ID: "whip-user",
	  },
  },
})

// create a token for the user sending video
streamKey, err := client.CreateToken("whip-user-id")

whipURL := response.Data.Call.Ingress.Whip.Address
fmt.Println("WHIP Server URL:", whipURL, "Bearer token:", streamKey)

OBS Setup

Show how to configure OBS to use WHIP.

  1. Open OBS and go to the “Stream” settings.
  2. Select “WHIP” Service.
  3. Enter Server URL obtained from SDK.
  4. Enter Bearer token obtained from SDK.
  5. Press OK

FFMPEG

Some ffmpeg installation from package managers do not have WHIP enabled. So ffmpeg should be compiled with WHIP support. To check if your installation supports WHIP run ffmpeg -muxers and check if there is whip in the list.

This is minimal example required to work with whip:

Download code from official repo or github mirror.

In this directory run:

./configure --enable-openssl --enable-protocol=dtls --enable-muxer=whip \
    --enable-libx264 --enable-gpl --enable-libopus --enable-version3
make install ## or make build

Example command to publish video with ffmpeg using WHIP:

ffmpeg -i input.mp4 -strict -2 -vcodec libx264 -profile:v baseline -b\:v 2000k \
    -maxrate 2500k -bufsize 5000k -c\:a opus -ar 48000 -ac 2 \
    -f whip -authorization $BEARER_TOKEN "$SERVER_URL"

RTMP vs WHIP

Stream supports both RTMP and WHIP, here’s a quick comparison to better understand when to use one or the other.

  1. WHIP is free-of-charge
  2. RTMP ingress creates additional video tracks in different resolutions and bitrates
  3. WHIP has much lower latency than RTMP
  4. WHIP is a recent protocol, expect adoption on clients and libraries to be more limited
© Getstream.io, Inc. All Rights Reserved.