Skip to main content

Streaming with WHIP, WHEP and HLS

MediaSFU rooms can take media from outside tools and send it back out, all controlled from your server over HTTP:

I want to…UseGuide
Go live from OBS or a hardware encoder into a roomWHIP ingestStream from OBS
Watch a stream in a low-latency WebRTC playerWHEP playbackPlay with WHEP
Reach a large audience on any deviceHLS broadcastBroadcast with HLS
Run a whole call without the SDKWHIP + WHEP per participantParticipants over HTTP

How it fits together​

  1. A room is always the starting point. Create one with the rooms endpoint or an SDK, and keep its meetingID.
  2. Your server creates a streaming resource for that room: an external session (WHIP), a playback (WHEP) or a broadcast (HLS).
  3. MediaSFU returns a URL and a short-lived token for that resource. Hand them to the encoder or player; they expire, so create a new resource each time you go live.
  4. Delete the resource when the stream ends.

Every request uses the same authentication as rooms: Authorization: Bearer <api-username>:<api-key>. Make these calls from your server, never from a browser or mobile app.

A WHIP stream appears in the room as a participant, so people in the room see and hear it like anyone else, and it can feed an HLS broadcast.

Choosing WHEP or HLS for viewers​

WHEPHLS
LatencySub-secondA few seconds
Audience sizeSmall, interactive audiences (one connection per viewer)Large audiences; put a CDN in front
PlayerA WHEP-capable WebRTC playerAny HLS player, including Safari and hls.js

Availability​

WHIP, WHEP and HLS are covered in these guides. RTMP, RTMPS and SRT are not enabled by default; contact support@mediasfu.com with your use case to discuss access. OBS Studio 30 and later publishes over WHIP, so OBS does not need RTMP.

For every route, field and cleanup rule in one place, see the streaming HTTP reference.