Skip to main content
Processors analyze, transform, or publish audio and video streams in real-time. Build custom processors or use built-in ones like YOLO pose detection. For lip-synced avatars, use the LiveAvatar integration via the agent’s avatar parameter.
For the base class API reference, see Processors Class.

How Video Processing Works

When a participant publishes video, the agent creates a VideoForwarder that reads frames from the track. This forwarder is shared with all video processors via the process_video() method. Each processor registers a frame handler with its desired FPS.

Building a Custom Processor

A minimal video processor that logs frames:
Key patterns:
  • Set name as a class attribute
  • Store a reference to shared_forwarder to remove handlers later
  • Register handlers with add_frame_handler(callback, fps, name)
  • Clean up in stop_processing() (called when tracks are removed) and close()

Publishing Transformed Video

Use VideoProcessorPublisher with QueuedVideoTrack to publish transformed video back to the call:
Key utilities:
  • QueuedVideoTrack — Writable video track. Call add_frame() to queue frames for publishing.
  • VideoForwarder — Distributes incoming frames to handlers at independent FPS rates.

Emitting Custom Events

Use attach_agent() to register custom events that other parts of your application can subscribe to:

YOLO Pose Detection

The Ultralytics plugin provides YOLOPoseProcessor for real-time pose detection with skeleton overlays:
Use cases: Golf coaching, fitness form checking, dance instruction, physical therapy. See Ultralytics for parameters and model options.

LiveAvatar

The LiveAvatar plugin provides liveavatar.Avatar() for lip-syncing AI avatars that speak agent responses. Use cases: Virtual presenters, customer service avatars, interactive tutors. See LiveAvatar for setup and examples.

Next Steps

Processors Class

Base class API reference

Ultralytics YOLO

Pose detection reference

LiveAvatar

Avatar integration reference

Event System

Custom events reference