Skip to content

Gst Backend

GStreamer backend for the deinterlace processor family.

Uses yadif (or deinterlace fallback) plus x264enc to mirror the FFmpeg yadif + libx264 recipe from FFmpegDeinterlaceProcessor.

GstDeinterlaceConfig

Bases: DeinterlaceConfig, GstBaseConfig

GStreamer-specific stable config (inherits shared DeinterlaceConfig).

Yadif / encode defaults mirror FFmpegDeinterlaceConfig so both backends produce comparable progressive output.

Attributes:

Name Type Description
yadif_mode int

Yadif mode (0–3). Defaults to 0.

yadif_parity int

Field parity (-1=auto, 0=tff, 1=bff). Defaults to -1.

yadif_deint int

Deinterlace all frames (0) or flagged-only (1). Defaults to 0.

crf int

Quantizer passed to the video encoder (CRF analogue). Defaults to 23.

preset str

x264 speed preset name. Defaults to ultrafast.

video_encoder str | None

Inherited from GstBaseConfig; None auto-selects the first available encoder (x264enc preferred), matching sibling Gst backends.

validate_preset(value) classmethod

Reject blank preset strings.

Parameters:

Name Type Description Default
value str

Candidate preset name.

required

Returns:

Name Type Description
str str

Validated preset name.

Raises:

Type Description
ValueError

If value is blank.

yadif_filter()

Return an FFmpeg-style yadif filter label for metadata parity.

Returns:

Name Type Description
str str

Filter description aligned with the FFmpeg backend.

GstDeinterlaceProcessConfig

Bases: DeinterlaceProcessConfig

Per-invocation GStreamer overrides (inherits shared DeinterlaceProcessConfig).

GstDeinterlaceProcessor(config=None)

Bases: BaseGstreamerProcessor, DeinterlaceProcessor

Deinterlace video with GStreamer yadif + x264enc.

Pipeline topology::

filesrc → decodebin → queue → videoconvert → yadif → videoconvert
    → x264enc → mp4mux → filesink

Audio pads are dropped when strip_audio is True.

Initialize the GStreamer deinterlace processor.

Parameters:

Name Type Description Default
config dict[str, Any] | DeinterlaceConfig | GstDeinterlaceConfig | None

Shared or GStreamer-specific config. Defaults to None.

None

config_model() classmethod

Return the stable configuration model.

process(attachment, **kwargs) async

Deinterlace one video attachment.

Parameters:

Name Type Description Default
attachment Attachment

Input interlaced (or progressive) video.

required
**kwargs Any

May include process_config overrides.

{}

Returns:

Name Type Description
Attachment Attachment

Progressive video attachment.

process_config_model() classmethod

Return the per-invocation configuration model.