Documentation Index
Fetch the complete documentation index at: https://docs.livepeer.org/llms.txt
Use this file to discover all available pages before exploring further.
PyTrickle’s processing surface is the
FrameProcessor base class. Subclass it, implement the async methods below, and pass an instance to StreamServer. The SDK manages connection lifecycle, decoding, encoding, and transport.
FrameProcessor
Initialize Method
Process Video Async Method
VideoFrame to include it in the output stream, or None to drop the frame.
Blocking operations (model inference on CPU, disk I/O) stall the processing loop and increase output latency. Run them in a thread pool:
Process Audio Async Method
AudioFrame objects (pass-through returns [frame]), or None to drop the frame. The SDK automatically detects and converts between mono, stereo, and multi-channel formats.
Update Params Method
params is a plain dict; the schema is defined by your service. Updates are applied immediately to the running processor without interrupting the stream.
Example:
VideoFrame
Represents a single decoded video frame.AudioFrame
Represents a decoded audio buffer.StreamServer
HTTP endpoints
Framerate and Throughput
Themax_framerate parameter in the /api/stream/start request body controls the maximum number of frames passed to process_video_async per second. Frames arriving faster than max_framerate are dropped before the processor sees them. This prevents backpressure from accumulating when model inference is slower than the input frame rate.
Set max_framerate to the throughput your model can sustain. For StreamDiffusion workflows on an RTX 4090, this is typically 15-30 FPS depending on resolution. For lighter processing, match the input stream frame rate.
The PyTrickle quickstart walks through a complete FrameProcessor from scratch. The PyTrickle reference covers the full API surface.
Related Pages
PyTrickle Quickstart
Working example of a FrameProcessor running against a local test stream.
ComfyStream as BYOC
How to register a trickle service with a Livepeer orchestrator.