Python SDK
Video Sources

Video Sources

The Python SDK provides 7 source types for feeding video into a stream. All FFmpeg-based sources require ffmpeg and ffprobe to be available on your PATH.

Source Summary

SourceInputRequires FFmpeg
FileSource(path, loop=False)Local video fileYes
RTSPSource(url)RTSP camera/serverYes
HLSSource(url)HLS live streamYes
RTMPSource(url)RTMP streamYes
CameraSource(device, width, height)Local cameraYes
FrameSource(width, height)Programmatic (push frames)No
LiveKitSource(url, token)User-managed LiveKit roomNo

FileSource

Play a local video file. Set loop=True to restart the video when it ends.

source = overshoot.FileSource(path="/path/to/video.mp4", loop=True)

RTSPSource

Connect to an RTSP camera or server. Uses TCP transport for reliability.

source = overshoot.RTSPSource(url="rtsp://user:pass@192.168.1.10/stream")

HLSSource

Connect to an HLS live stream.

source = overshoot.HLSSource(url="https://example.com/live.m3u8")

RTMPSource

Connect to an RTMP stream.

source = overshoot.RTMPSource(url="rtmp://example.com/live/stream")

CameraSource

Capture from a local camera. The SDK is platform-aware and auto-detects the correct input format: /dev/video0 on Linux, avfoundation on macOS, and dshow on Windows. Resolution is capped at 1280x720.

source = overshoot.CameraSource()  # default camera
source = overshoot.CameraSource(device="/dev/video0", width=1280, height=720)

FrameSource

Push frames programmatically from OpenCV, PIL, numpy, or any pipeline that produces image data. No FFmpeg required.

import cv2
import overshoot
 
source = overshoot.FrameSource(width=640, height=480)
stream = await client.streams.create(
    source=source,
    prompt="Count the people",
    model="Qwen/Qwen3.5-9B",
    on_result=lambda r: print(r.result),
)
 
cap = cv2.VideoCapture(0)
while True:
    ret, bgr = cap.read()
    if not ret:
        break
    rgba = cv2.cvtColor(bgr, cv2.COLOR_BGR2RGBA)
    rgba = cv2.resize(rgba, (640, 480))
    source.push_frame(rgba)  # accepts numpy arrays or raw bytes

FrameSource works well with OpenCV, PIL, numpy, and robotics pipelines.

LiveKitSource

Connect using a user-managed LiveKit room. No FFmpeg required.

source = overshoot.LiveKitSource(
    url="wss://your-livekit-server.com",
    token="your-livekit-token",
)