Skip to main content

Receive Video

This guide shows how to set up a WebRTC connection to receive video from the Scope API in text-to-video mode (no input video, just prompts).

Overview

In receive-only mode:
  • You send text prompts to control generation
  • The server generates video and streams it back
  • No input video required

Prerequisites

  1. Server is running: uv run daydream-scope
  2. Models are downloaded for your pipeline
  3. Pipeline is loaded (see Load Pipeline)

Complete Example


Step-by-Step Breakdown

1

Get ICE Servers

The server returns STUN/TURN server configuration. If TURN credentials are configured (via HF_TOKEN or Twilio), this enables connections through firewalls.
2

Create Peer Connection

3

Create Data Channel

The data channel allows bidirectional communication:
  • Client to Server: Send parameter updates (prompts, settings)
  • Server to Client: Receive notifications (stream stopped, errors)
4

Add Video Transceiver

For receive-only mode (no input video), we add a video transceiver instead of a track. This tells WebRTC we want to receive video.
5

Handle Incoming Track

6

Send Offer with Initial Parameters

7

Complete Signaling


Update Parameters During Streaming

After connection is established:

Stopping the Stream


Error Handling


See Also

Send & Receive Video

Bidirectional video streaming (V2V)

Send Parameters

All available parameters

Load Pipeline

Configure pipeline before streaming

VACE

Reference image conditioning