Ffmpeg Backend
FFmpeg backend for the deinterlace processor family.
Owns FFmpeg yadif helpers, tunable params, and
FFmpegDeinterlaceProcessor.
FFmpegDeinterlaceConfig
Bases: DeinterlaceConfig
FFmpeg-specific stable config (inherits shared DeinterlaceConfig).
Attributes:
| Name | Type | Description |
|---|---|---|
yadif_mode |
int
|
Yadif mode (0=send_frame, 1=send_field, 2=send_frame_nospatial, 3=send_field_nospatial). 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 only flagged (1). Defaults to 0. |
video_codec |
str
|
Video encoder name. Defaults to |
preset |
str
|
x264 preset. Defaults to |
crf |
int
|
Constant rate factor (0–51). Defaults to 23. |
filter_override |
str | None
|
Full |
validate_non_empty(value)
classmethod
Reject blank codec/preset strings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
Candidate string. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Validated string. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
yadif_filter()
Build the -vf filter string.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Filter graph for FFmpeg |
FFmpegDeinterlaceProcessConfig
Bases: DeinterlaceProcessConfig
Per-invocation FFmpeg overrides (inherits shared DeinterlaceProcessConfig).
Any field left as None falls back to the stable constructor config.
FFmpegDeinterlaceProcessor(config=None)
Bases: BaseFFmpegProcessor, DeinterlaceProcessor
Deinterlace video with FFmpeg yadif.
Attributes:
| Name | Type | Description |
|---|---|---|
config |
FFmpegDeinterlaceConfig
|
Stable constructor configuration. |
Initialize the FFmpeg deinterlace processor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
dict[str, Any] | DeinterlaceConfig | FFmpegDeinterlaceConfig | None
|
Shared |
None
|
config_model()
classmethod
Return the stable configuration model.
deinterlace_video(video_path, output_path=None, *, params=None)
Deinterlace a video path with FFmpeg yadif into a progressive file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
video_path
|
str
|
Source video path. |
required |
output_path
|
str | None
|
Destination path. When None, a
temporary |
None
|
params
|
FFmpegDeinterlaceConfig | None
|
Effective options for
this call. Defaults to |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Path to the progressive output video. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If |
RuntimeError
|
If FFmpeg deinterlace fails. |
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 |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
Attachment |
Attachment
|
Progressive video attachment. |
process_config_model()
classmethod
Return the per-invocation configuration model.