pipeline_source

GStreamer pipeline source integration for Pipecat.

class pipecat.processors.gstreamer.pipeline_source.GStreamerPipelineSource(*, pipeline: str, out_params: OutputParams | None = None, **kwargs)[source]

Bases: FrameProcessor

A frame processor that uses GStreamer pipelines as media sources.

This processor creates and manages GStreamer pipelines to generate audio and video output frames. It handles pipeline lifecycle, decoding, format conversion, and frame generation with configurable output parameters.

class OutputParams(*, video_width: int = 1280, video_height: int = 720, audio_sample_rate: int | None = None, audio_channels: int = 1, clock_sync: bool = True)[source]

Bases: BaseModel

Output configuration parameters for GStreamer pipeline.

Parameters:
  • video_width – Width of output video frames in pixels.

  • video_height – Height of output video frames in pixels.

  • audio_sample_rate – Sample rate for audio output. If None, uses frame sample rate.

  • audio_channels – Number of audio channels for output.

  • clock_sync – Whether to synchronize output with pipeline clock.

video_width: int
video_height: int
audio_sample_rate: int | None
audio_channels: int
clock_sync: bool
__init__(*, pipeline: str, out_params: OutputParams | None = None, **kwargs)[source]

Initialize the GStreamer pipeline source.

Parameters:
  • pipeline – GStreamer pipeline description string for the source.

  • out_params – Output configuration parameters. If None, uses defaults.

  • **kwargs – Additional arguments passed to parent FrameProcessor.

async process_frame(frame: Frame, direction: FrameDirection)[source]

Process incoming frames and manage GStreamer pipeline lifecycle.

Parameters:
  • frame – The frame to process.

  • direction – The direction of frame processing.