Send and Receive Video
This guide shows how to set up a WebRTC connection for video-to-video mode - sending input video (webcam, screen, or file) and receiving generated video.Overview
In video-to-video mode:- You send video frames as input (e.g., webcam, screen capture)
- The server transforms the video based on your prompts
- Generated video is streamed back in real-time
Prerequisites
- Server is running:
uv run daydream-scope - Models are downloaded for your pipeline
- Pipeline is loaded (see Load Pipeline)
Complete Example
Step-by-Step Breakdown
Get ICE Servers
HF_TOKEN or Twilio), this enables connections through firewalls.Create Data Channel
- Client to Server: Send parameter updates (prompts, settings)
- Server to Client: Receive notifications (stream stopped, errors)
Add Input Video Track
addTransceiver("video"), video-to-video mode adds an actual video track from your input source. This can be:- Webcam:
navigator.mediaDevices.getUserMedia({ video: true }) - Screen capture:
navigator.mediaDevices.getDisplayMedia({ video: true }) - File/canvas: Using a
<canvas>element withcaptureStream()
Send Offer with Initial Parameters
input_mode: "video" parameter which tells the server to expect input video.Update Parameters During Streaming
After connection is established:Stopping the Stream
Error Handling
VACE vs Standard V2V
When VACE is enabled on the pipeline (default), input video is routed through VACE for structural guidance. When disabled, input video is encoded and used for denoising.Performance Tips
Match Resolution
Set input resolution to match pipeline resolution for best quality:Frame Rate
Lower frame rates reduce bandwidth and processing load:See Also
Receive Video
Text-to-video mode (no input)
Send Parameters
Update parameters during streaming
VACE
Reference image conditioning
Load Pipeline
Configure pipeline before streaming