Skip to main content

What is Delivery and Outputs?

Delivery is the mechanism that transports your livestream from the server to the viewers watching the stream. The platform takes the ingested stream and sends it to viewers at scale using CDNs (Content Delivery Networks) with servers around the world and handles transcoding (creating multiple quality versions) along with optimizing routing to get video to viewers quickly.

Why This Matters

After you create your AI-generated stream in Daydream, there’s one more important decision: how will you get it to your viewers? Think of it like choosing how to deliver a package. You could use overnight express shipping (fast but expensive) or standard shipping (slower but handles more volume). With streaming, you’re choosing between speed and scale.

WHEP Output (Low Latency)

WHEP (WebRTC HTTP Egress Protocol) is designed for ultra-low latency streaming — typically under 1 second of delay. How it works: Uses WebRTC technology (the same technology used for video calls) creates direct peer-to-peer-style connections between your stream and viewers. Data travels quickly with minimal buffering.
Best ForTrade-offs
Live auctions or betting where every second countsSmaller audience capacity (harder to scale to thousands of viewers)
Interactive streams (gaming, live Q&A, reactions)Requires more server resources per viewer
Video conferencing or webinar-style broadcastsLess compatible with traditional CDNs
Real-time collaboration where immediate feedback mattersMay have more connection stability issues on poor networks

HLS Output (CDN Distribution)

HLS (HTTP Live Streaming) is the industry standard for scalable, reliable delivery to large audiences. How it works: Breaks your stream into small video chunks (typically 2-10 seconds each) Distributes these chunks across CDN (Content Delivery Network) servers worldwide Viewers download and play chunks sequentially
Best ForTrade-offs
Large-scale events (concerts, conferences, sports)Higher latency (typically 10-30 seconds delay)
On-demand playback and DVR featuresNot suitable for real-time interaction
Mobile apps and broad device compatibilityThe chunked nature means slight quality adjustments as network conditions change

Choosing the right output

WHEPHLS
Latency under 2 seconds is criticalYou need to reach a large audience (thousands or millions of viewers)
You have a smaller, engaged audience (dozens to hundreds)A few seconds of delay won’t impact the experience
Interaction is a key part of the experienceYou want maximum device/platform compatibility
You’re okay with higher infrastructure costs per viewerReliability and scale matter more than instant feedback

API Examples

Create a Output with WHEP

WHEP output is provided when you create a stream with the Daydream API. The output_playback_id provided in the response is used to pull the stream from Daydream.

How It Works

Make sure to keep your API Key safe and secure and not exposed to the public
# Step 1: Create a Daydream stream
DAYDREAM_API_KEY="<YOUR_DAYDREAM_API_KEY>"
RESPONSE=$(curl -s -X POST "https://api.daydream.live/v1/streams" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${DAYDREAM_API_KEY}" \
  -d '{
    "pipeline_id":"pip_SD-turbo",
    "params": {
      "prompt": "a serene mountain landscape at sunset",
      "num_inference_steps": 4,
      "guidance_scale": 0.0
    }
  }')

echo "=== Daydream Response ==="
echo $RESPONSE | jq '.'

PLAYBACK_ID=$(echo $RESPONSE | jq -r '.output_playback_id')
echo "=== Playback ID ==="
echo $PLAYBACK_ID

# Debug: See the full Livepeer response
echo "=== Livepeer Response ==="
LIVEPEER_RESPONSE=$(curl -s "https://livepeer.studio/api/playback/${PLAYBACK_ID}")
echo $LIVEPEER_RESPONSE | jq '.'

# Use the URL for under the WebRTC source
{
  "type": "live",
  "meta": {
    "live": 0,
    "source": [
      {
        "hrn": "WebRTC (H264)",
        "type": "html5/video/h264",
        "url": "https://livepeercdn.studio/webrtc/8a5eiih6kev07buv"
      },
    ]
  }
}

Create a Output with HLS

HLS output is provided when you create a stream with the Daydream API. The output_playback_id provided in the response is used to pull the stream from Daydream for scalable CDN distribution.

How It Works

Make sure to keep your API Key safe and secure and not exposed to the public
# Step 1: Create a Daydream stream
DAYDREAM_API_KEY="<YOUR_DAYDREAM_API_KEY>"
RESPONSE=$(curl -s -X POST "https://api.daydream.live/v1/streams" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${DAYDREAM_API_KEY}" \
  -d '{
    "pipeline_id":"pip_SD-turbo",
    "params": {
      "prompt": "a serene mountain landscape at sunset",
      "num_inference_steps": 4,
      "guidance_scale": 0.0
    }
  }')

echo "=== Daydream Response ==="
echo $RESPONSE | jq '.'

PLAYBACK_ID=$(echo $RESPONSE | jq -r '.output_playback_id')
echo "=== Playback ID ==="
echo $PLAYBACK_ID

# Debug: See the full Livepeer response
echo "=== Livepeer Response ==="
LIVEPEER_RESPONSE=$(curl -s "https://livepeer.studio/api/playback/${PLAYBACK_ID}")
echo $LIVEPEER_RESPONSE | jq '.'

# Use the URL for under the HLS source
{
  "type": "live",
  "meta": {
    "live": 0,
    "source": [
      {
        "hrn": "HLS (TS)",
        "type": "html5/application/vnd.apple.mpegurl",
        "url": "https://livepeercdn.studio/hls/8a5eiih6kev07buv/index.m3u8"
      },
    ]
  }
}

Create a Output with RTMP

Using Streaming Platforms to deliver your stream.
You are only able to change the output_playback_id when creating a NEW stream. You cannot change it on an existing stream.
Make sure to keep your API Key safe and secure and not exposed to the public
curl -X POST \
  "https://api.daydream.live/v1/streams" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <YOUR_DAYDREAM_API_KEY>" \
  -d '{
    "pipeline_id": "pip_SDXL-turbo",
    "output_rtmp_url": "rtmp://a.rtmp.youtube.com/live2/<YOUR_YOUTUBE_STREAM_KEY>",
    "params": {
      "prompt": "a serene mountain landscape at sunset",
      "num_inference_steps": 4,
      "guidance_scale": 0.0
    }
  }'

How It Works