Skip to content

filters

FFmpeg filters.

Functions:

Name Description
acrossfade

Cross fade two input audio streams.

ainterleave

Temporally interleave audio inputs.

alphamerge

Copy the luma value of the second input into the alpha channel of the first input.

amerge

Merge two or more audio streams into a single multi-channel stream.

amix

Audio mixing.

amultiply

Multiply two audio streams.

anlmf

Apply Normalized Least-Mean-Fourth algorithm to first audio stream.

anlms

Apply Normalized Least-Mean-Squares algorithm to first audio stream.

apsnr

Measure Audio Peak Signal-to-Noise Ratio.

arls

Apply Recursive Least Squares algorithm to first audio stream.

asdr

Measure Audio Signal-to-Distortion Ratio.

asisdr

Measure Audio Scale-Invariant Signal-to-Distortion Ratio.

astreamselect

Select audio streams.

axcorrelate

Cross-correlate two audio streams.

blend

Blend two video frames into each other.

blend_vulkan

Blend two video frames in Vulkan.

bm3d

Block-Matching 3D denoiser.

colormap

Apply custom Color Maps to video stream.

concat

Concatenate audio and video streams.

convolve

Convolve first video stream with second video stream.

corr

Calculate the correlation between two video streams.

decimate

Decimate frames (post field matching filter).

deconvolve

Deconvolve first video stream with second video stream.

displace

Displace pixels.

feedback

Apply feedback video filter.

fieldmatch

Field matching for inverse telecine.

framepack

Generate a frame packed stereoscopic video.

freezeframes

Freeze video frames.

guided

Apply Guided filter.

haldclut

Adjust colors using a Hald CLUT.

headphone

Apply headphone binaural spatialization with HRTFs in additional streams.

hstack

Stack video inputs horizontally.

hstack_vaapi

"VA-API" hstack.

hysteresis

Grow first stream into second stream by connecting components.

identity

Calculate the Identity between two video streams.

interleave

Temporally interleave video inputs.

join

Join multiple audio streams into multi-channel output.

ladspa

Apply LADSPA effect.

libplacebo

Apply various GPU filters from libplacebo.

limitdiff

Apply filtering with limiting difference.

lut2

Compute and apply a lookup table from two video inputs.

lv2

Apply LV2 effect.

maskedclamp

Clamp first stream with second stream and third stream.

maskedmax

Apply filtering with maximum difference of two streams.

maskedmerge

Merge first stream with second stream using third stream as mask.

maskedmin

Apply filtering with minimum difference of two streams.

maskedthreshold

Pick pixels comparing absolute difference of two streams with threshold.

mergeplanes

Merge planes.

midequalizer

Apply Midway Equalization.

mix

Mix video inputs.

morpho

Apply Morphological filter.

msad

Calculate the MSAD between two video streams.

multiply

Multiply first video stream with second video stream.

overlay

Overlay a video source on top of the input.

overlay_cuda

Overlay one video on top of another using CUDA.

overlay_opencl

Overlay one video on top of another.

overlay_vaapi

Overlay one video on top of another.

overlay_vulkan

Overlay a source on top of another.

paletteuse

Use a palette to downsample an input video stream.

premultiply

PreMultiply first stream with first plane of second stream.

program_opencl

Filter video using an OpenCL program.

psnr

Calculate the PSNR between two video streams.

remap

Remap pixels.

remap_opencl

Remap pixels using OpenCL.

sidechaincompress

Sidechain compressor.

sidechaingate

Audio sidechain gate.

signature

Calculate the MPEG-7 video signature.

spectrumsynth

Convert input spectrum videos to audio output.

ssim

Calculate the SSIM between two video streams.

streamselect

Select video streams.

threshold

Threshold first video stream using other video streams.

unpremultiply

UnPreMultiply first stream with first plane of second stream.

varblur

Apply Variable Blur filter.

vif

Calculate the VIF between two video streams.

vstack

Stack video inputs vertically.

vstack_vaapi

"VA-API" vstack.

xcorrelate

Cross-correlate first video stream with second video stream.

xfade

Cross fade one video with another video.

xfade_opencl

Cross fade one video with another video.

xmedian

Pick median pixels from several video inputs.

xstack

Stack video inputs into custom layout.

xstack_vaapi

"VA-API" xstack.

acrossfade

acrossfade(
    _crossfade0: AudioStream,
    _crossfade1: AudioStream,
    *,
    nb_samples: Int = Default("44100"),
    duration: Duration = Default("0"),
    overlap: Boolean = Default("true"),
    curve1: (
        Int
        | Literal[
            "nofade",
            "tri",
            "qsin",
            "esin",
            "hsin",
            "log",
            "ipar",
            "qua",
            "cub",
            "squ",
            "cbr",
            "par",
            "exp",
            "iqsin",
            "ihsin",
            "dese",
            "desi",
            "losi",
            "sinc",
            "isinc",
            "quat",
            "quatr",
            "qsin2",
            "hsin2",
        ]
        | Default
    ) = Default("tri"),
    curve2: (
        Int
        | Literal[
            "nofade",
            "tri",
            "qsin",
            "esin",
            "hsin",
            "log",
            "ipar",
            "qua",
            "cub",
            "squ",
            "cbr",
            "par",
            "exp",
            "iqsin",
            "ihsin",
            "dese",
            "desi",
            "losi",
            "sinc",
            "isinc",
            "quat",
            "quatr",
            "qsin2",
            "hsin2",
        ]
        | Default
    ) = Default("tri"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Cross fade two input audio streams.

Parameters:

Name Type Description Default
nb_samples Int

set number of samples for cross fade duration (from 1 to 2.14748e+08) (default 44100)

Default('44100')
duration Duration

set cross fade duration (default 0)

Default('0')
overlap Boolean

overlap 1st stream end with 2nd stream start (default true)

Default('true')
curve1 Int | Literal['nofade', 'tri', 'qsin', 'esin', 'hsin', 'log', 'ipar', 'qua', 'cub', 'squ', 'cbr', 'par', 'exp', 'iqsin', 'ihsin', 'dese', 'desi', 'losi', 'sinc', 'isinc', 'quat', 'quatr', 'qsin2', 'hsin2'] | Default

set fade curve type for 1st stream (from -1 to 22) (default tri)

Default('tri')
curve2 Int | Literal['nofade', 'tri', 'qsin', 'esin', 'hsin', 'log', 'ipar', 'qua', 'cub', 'squ', 'cbr', 'par', 'exp', 'iqsin', 'ihsin', 'dese', 'desi', 'losi', 'sinc', 'isinc', 'quat', 'quatr', 'qsin2', 'hsin2'] | Default

set fade curve type for 2nd stream (from -1 to 22) (default tri)

Default('tri')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

ainterleave

ainterleave(
    *streams: AudioStream,
    nb_inputs: Int = Auto("len(streams)"),
    duration: (
        Int
        | Literal["longest", "shortest", "first"]
        | Default
    ) = Default("longest"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Temporally interleave audio inputs.

Parameters:

Name Type Description Default
nb_inputs Int

set number of inputs (from 1 to INT_MAX) (default 2)

Auto('len(streams)')
duration Int | Literal['longest', 'shortest', 'first'] | Default

how to determine the end-of-stream (from 0 to 2) (default longest)

Default('longest')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

alphamerge

alphamerge(
    _main: VideoStream,
    _alpha: VideoStream,
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None,
) -> VideoStream

Copy the luma value of the second input into the alpha channel of the first input.

Parameters:

Name Type Description Default
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

amerge

amerge(
    *streams: AudioStream,
    inputs: Int = Auto("len(streams)"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Merge two or more audio streams into a single multi-channel stream.

Parameters:

Name Type Description Default
inputs Int

specify the number of inputs (from 1 to 64) (default 2)

Auto('len(streams)')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

amix

amix(
    *streams: AudioStream,
    inputs: Int = Auto("len(streams)"),
    duration: (
        Int
        | Literal["longest", "shortest", "first"]
        | Default
    ) = Default("longest"),
    dropout_transition: Float = Default("2"),
    weights: String = Default("1 1"),
    normalize: Boolean = Default("true"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Audio mixing.

Parameters:

Name Type Description Default
inputs Int

Number of inputs. (from 1 to 32767) (default 2)

Auto('len(streams)')
duration Int | Literal['longest', 'shortest', 'first'] | Default

How to determine the end-of-stream. (from 0 to 2) (default longest)

Default('longest')
dropout_transition Float

Transition time, in seconds, for volume renormalization when an input stream ends. (from 0 to INT_MAX) (default 2)

Default('2')
weights String

Set weight for each input. (default "1 1")

Default('1 1')
normalize Boolean

Scale inputs (default true)

Default('true')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

amultiply

amultiply(
    _multiply0: AudioStream,
    _multiply1: AudioStream,
    extra_options: dict[str, Any] | None = None,
) -> AudioStream

Multiply two audio streams.

Parameters:

Name Type Description Default
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

anlmf

anlmf(
    _input: AudioStream,
    _desired: AudioStream,
    *,
    order: Int = Default("256"),
    mu: Float = Default("0.75"),
    eps: Float = Default("1"),
    leakage: Float = Default("0"),
    out_mode: (
        Int | Literal["i", "d", "o", "n", "e"] | Default
    ) = Default("o"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Apply Normalized Least-Mean-Fourth algorithm to first audio stream.

Parameters:

Name Type Description Default
order Int

set the filter order (from 1 to 32767) (default 256)

Default('256')
mu Float

set the filter mu (from 0 to 2) (default 0.75)

Default('0.75')
eps Float

set the filter eps (from 0 to 1) (default 1)

Default('1')
leakage Float

set the filter leakage (from 0 to 1) (default 0)

Default('0')
out_mode Int | Literal['i', 'd', 'o', 'n', 'e'] | Default

set output mode (from 0 to 4) (default o)

Default('o')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

anlms

anlms(
    _input: AudioStream,
    _desired: AudioStream,
    *,
    order: Int = Default("256"),
    mu: Float = Default("0.75"),
    eps: Float = Default("1"),
    leakage: Float = Default("0"),
    out_mode: (
        Int | Literal["i", "d", "o", "n", "e"] | Default
    ) = Default("o"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Apply Normalized Least-Mean-Squares algorithm to first audio stream.

Parameters:

Name Type Description Default
order Int

set the filter order (from 1 to 32767) (default 256)

Default('256')
mu Float

set the filter mu (from 0 to 2) (default 0.75)

Default('0.75')
eps Float

set the filter eps (from 0 to 1) (default 1)

Default('1')
leakage Float

set the filter leakage (from 0 to 1) (default 0)

Default('0')
out_mode Int | Literal['i', 'd', 'o', 'n', 'e'] | Default

set output mode (from 0 to 4) (default o)

Default('o')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

apsnr

apsnr(
    _input0: AudioStream,
    _input1: AudioStream,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None,
) -> AudioStream

Measure Audio Peak Signal-to-Noise Ratio.

Parameters:

Name Type Description Default
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

arls

arls(
    _input: AudioStream,
    _desired: AudioStream,
    *,
    order: Int = Default("16"),
    _lambda: Float = Default("1"),
    delta: Float = Default("2"),
    out_mode: (
        Int | Literal["i", "d", "o", "n", "e"] | Default
    ) = Default("o"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Apply Recursive Least Squares algorithm to first audio stream.

Parameters:

Name Type Description Default
order Int

set the filter order (from 1 to 32767) (default 16)

Default('16')
_lambda Float

set the filter lambda (from 0 to 1) (default 1)

Default('1')
delta Float

set the filter delta (from 0 to 32767) (default 2)

Default('2')
out_mode Int | Literal['i', 'd', 'o', 'n', 'e'] | Default

set output mode (from 0 to 4) (default o)

Default('o')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

asdr

asdr(
    _input0: AudioStream,
    _input1: AudioStream,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None,
) -> AudioStream

Measure Audio Signal-to-Distortion Ratio.

Parameters:

Name Type Description Default
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

asisdr

asisdr(
    _input0: AudioStream,
    _input1: AudioStream,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None,
) -> AudioStream

Measure Audio Scale-Invariant Signal-to-Distortion Ratio.

Parameters:

Name Type Description Default
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

astreamselect

astreamselect(
    *streams: AudioStream,
    inputs: Int = Auto("len(streams)"),
    map: String = Default(None),
    extra_options: dict[str, Any] | None = None
) -> FilterNode

Select audio streams.

Parameters:

Name Type Description Default
inputs Int

number of input streams (from 2 to INT_MAX) (default 2)

Auto('len(streams)')
map String

input indexes to remap to outputs

Default(None)
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
filter_node FilterNode

the filter node

References

FFmpeg Documentation

axcorrelate

axcorrelate(
    _axcorrelate0: AudioStream,
    _axcorrelate1: AudioStream,
    *,
    size: Int = Default("256"),
    algo: (
        Int | Literal["slow", "fast", "best"] | Default
    ) = Default("best"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Cross-correlate two audio streams.

Parameters:

Name Type Description Default
size Int

set the segment size (from 2 to 131072) (default 256)

Default('256')
algo Int | Literal['slow', 'fast', 'best'] | Default

set the algorithm (from 0 to 2) (default best)

Default('best')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

blend

blend(
    _top: VideoStream,
    _bottom: VideoStream,
    *,
    c0_mode: (
        Int
        | Literal[
            "addition",
            "addition128",
            "grainmerge",
            "and",
            "average",
            "burn",
            "darken",
            "difference",
            "difference128",
            "grainextract",
            "divide",
            "dodge",
            "exclusion",
            "extremity",
            "freeze",
            "glow",
            "hardlight",
            "hardmix",
            "heat",
            "lighten",
            "linearlight",
            "multiply",
            "multiply128",
            "negation",
            "normal",
            "or",
            "overlay",
            "phoenix",
            "pinlight",
            "reflect",
            "screen",
            "softlight",
            "subtract",
            "vividlight",
            "xor",
            "softdifference",
            "geometric",
            "harmonic",
            "bleach",
            "stain",
            "interpolate",
            "hardoverlay",
        ]
        | Default
    ) = Default("normal"),
    c1_mode: (
        Int
        | Literal[
            "addition",
            "addition128",
            "grainmerge",
            "and",
            "average",
            "burn",
            "darken",
            "difference",
            "difference128",
            "grainextract",
            "divide",
            "dodge",
            "exclusion",
            "extremity",
            "freeze",
            "glow",
            "hardlight",
            "hardmix",
            "heat",
            "lighten",
            "linearlight",
            "multiply",
            "multiply128",
            "negation",
            "normal",
            "or",
            "overlay",
            "phoenix",
            "pinlight",
            "reflect",
            "screen",
            "softlight",
            "subtract",
            "vividlight",
            "xor",
            "softdifference",
            "geometric",
            "harmonic",
            "bleach",
            "stain",
            "interpolate",
            "hardoverlay",
        ]
        | Default
    ) = Default("normal"),
    c2_mode: (
        Int
        | Literal[
            "addition",
            "addition128",
            "grainmerge",
            "and",
            "average",
            "burn",
            "darken",
            "difference",
            "difference128",
            "grainextract",
            "divide",
            "dodge",
            "exclusion",
            "extremity",
            "freeze",
            "glow",
            "hardlight",
            "hardmix",
            "heat",
            "lighten",
            "linearlight",
            "multiply",
            "multiply128",
            "negation",
            "normal",
            "or",
            "overlay",
            "phoenix",
            "pinlight",
            "reflect",
            "screen",
            "softlight",
            "subtract",
            "vividlight",
            "xor",
            "softdifference",
            "geometric",
            "harmonic",
            "bleach",
            "stain",
            "interpolate",
            "hardoverlay",
        ]
        | Default
    ) = Default("normal"),
    c3_mode: (
        Int
        | Literal[
            "addition",
            "addition128",
            "grainmerge",
            "and",
            "average",
            "burn",
            "darken",
            "difference",
            "difference128",
            "grainextract",
            "divide",
            "dodge",
            "exclusion",
            "extremity",
            "freeze",
            "glow",
            "hardlight",
            "hardmix",
            "heat",
            "lighten",
            "linearlight",
            "multiply",
            "multiply128",
            "negation",
            "normal",
            "or",
            "overlay",
            "phoenix",
            "pinlight",
            "reflect",
            "screen",
            "softlight",
            "subtract",
            "vividlight",
            "xor",
            "softdifference",
            "geometric",
            "harmonic",
            "bleach",
            "stain",
            "interpolate",
            "hardoverlay",
        ]
        | Default
    ) = Default("normal"),
    all_mode: (
        Int
        | Literal[
            "addition",
            "addition128",
            "grainmerge",
            "and",
            "average",
            "burn",
            "darken",
            "difference",
            "difference128",
            "grainextract",
            "divide",
            "dodge",
            "exclusion",
            "extremity",
            "freeze",
            "glow",
            "hardlight",
            "hardmix",
            "heat",
            "lighten",
            "linearlight",
            "multiply",
            "multiply128",
            "negation",
            "normal",
            "or",
            "overlay",
            "phoenix",
            "pinlight",
            "reflect",
            "screen",
            "softlight",
            "subtract",
            "vividlight",
            "xor",
            "softdifference",
            "geometric",
            "harmonic",
            "bleach",
            "stain",
            "interpolate",
            "hardoverlay",
        ]
        | Default
    ) = Default("-1"),
    c0_expr: String = Default(None),
    c1_expr: String = Default(None),
    c2_expr: String = Default(None),
    c3_expr: String = Default(None),
    all_expr: String = Default(None),
    c0_opacity: Double = Default("1"),
    c1_opacity: Double = Default("1"),
    c2_opacity: Double = Default("1"),
    c3_opacity: Double = Default("1"),
    all_opacity: Double = Default("1"),
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Blend two video frames into each other.

Parameters:

Name Type Description Default
c0_mode Int | Literal['addition', 'addition128', 'grainmerge', 'and', 'average', 'burn', 'darken', 'difference', 'difference128', 'grainextract', 'divide', 'dodge', 'exclusion', 'extremity', 'freeze', 'glow', 'hardlight', 'hardmix', 'heat', 'lighten', 'linearlight', 'multiply', 'multiply128', 'negation', 'normal', 'or', 'overlay', 'phoenix', 'pinlight', 'reflect', 'screen', 'softlight', 'subtract', 'vividlight', 'xor', 'softdifference', 'geometric', 'harmonic', 'bleach', 'stain', 'interpolate', 'hardoverlay'] | Default

set component #0 blend mode (from 0 to 39) (default normal)

Default('normal')
c1_mode Int | Literal['addition', 'addition128', 'grainmerge', 'and', 'average', 'burn', 'darken', 'difference', 'difference128', 'grainextract', 'divide', 'dodge', 'exclusion', 'extremity', 'freeze', 'glow', 'hardlight', 'hardmix', 'heat', 'lighten', 'linearlight', 'multiply', 'multiply128', 'negation', 'normal', 'or', 'overlay', 'phoenix', 'pinlight', 'reflect', 'screen', 'softlight', 'subtract', 'vividlight', 'xor', 'softdifference', 'geometric', 'harmonic', 'bleach', 'stain', 'interpolate', 'hardoverlay'] | Default

set component #1 blend mode (from 0 to 39) (default normal)

Default('normal')
c2_mode Int | Literal['addition', 'addition128', 'grainmerge', 'and', 'average', 'burn', 'darken', 'difference', 'difference128', 'grainextract', 'divide', 'dodge', 'exclusion', 'extremity', 'freeze', 'glow', 'hardlight', 'hardmix', 'heat', 'lighten', 'linearlight', 'multiply', 'multiply128', 'negation', 'normal', 'or', 'overlay', 'phoenix', 'pinlight', 'reflect', 'screen', 'softlight', 'subtract', 'vividlight', 'xor', 'softdifference', 'geometric', 'harmonic', 'bleach', 'stain', 'interpolate', 'hardoverlay'] | Default

set component #2 blend mode (from 0 to 39) (default normal)

Default('normal')
c3_mode Int | Literal['addition', 'addition128', 'grainmerge', 'and', 'average', 'burn', 'darken', 'difference', 'difference128', 'grainextract', 'divide', 'dodge', 'exclusion', 'extremity', 'freeze', 'glow', 'hardlight', 'hardmix', 'heat', 'lighten', 'linearlight', 'multiply', 'multiply128', 'negation', 'normal', 'or', 'overlay', 'phoenix', 'pinlight', 'reflect', 'screen', 'softlight', 'subtract', 'vividlight', 'xor', 'softdifference', 'geometric', 'harmonic', 'bleach', 'stain', 'interpolate', 'hardoverlay'] | Default

set component #3 blend mode (from 0 to 39) (default normal)

Default('normal')
all_mode Int | Literal['addition', 'addition128', 'grainmerge', 'and', 'average', 'burn', 'darken', 'difference', 'difference128', 'grainextract', 'divide', 'dodge', 'exclusion', 'extremity', 'freeze', 'glow', 'hardlight', 'hardmix', 'heat', 'lighten', 'linearlight', 'multiply', 'multiply128', 'negation', 'normal', 'or', 'overlay', 'phoenix', 'pinlight', 'reflect', 'screen', 'softlight', 'subtract', 'vividlight', 'xor', 'softdifference', 'geometric', 'harmonic', 'bleach', 'stain', 'interpolate', 'hardoverlay'] | Default

set blend mode for all components (from -1 to 39) (default -1)

Default('-1')
c0_expr String

set color component #0 expression

Default(None)
c1_expr String

set color component #1 expression

Default(None)
c2_expr String

set color component #2 expression

Default(None)
c3_expr String

set color component #3 expression

Default(None)
all_expr String

set expression for all color components

Default(None)
c0_opacity Double

set color component #0 opacity (from 0 to 1) (default 1)

Default('1')
c1_opacity Double

set color component #1 opacity (from 0 to 1) (default 1)

Default('1')
c2_opacity Double

set color component #2 opacity (from 0 to 1) (default 1)

Default('1')
c3_opacity Double

set color component #3 opacity (from 0 to 1) (default 1)

Default('1')
all_opacity Double

set opacity for all color components (from 0 to 1) (default 1)

Default('1')
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

blend_vulkan

blend_vulkan(
    _top: VideoStream,
    _bottom: VideoStream,
    *,
    c0_mode: (
        Int | Literal["normal", "multiply"] | Default
    ) = Default("normal"),
    c1_mode: (
        Int | Literal["normal", "multiply"] | Default
    ) = Default("normal"),
    c2_mode: (
        Int | Literal["normal", "multiply"] | Default
    ) = Default("normal"),
    c3_mode: (
        Int | Literal["normal", "multiply"] | Default
    ) = Default("normal"),
    all_mode: (
        Int | Literal["normal", "multiply"] | Default
    ) = Default("-1"),
    c0_opacity: Double = Default("1"),
    c1_opacity: Double = Default("1"),
    c2_opacity: Double = Default("1"),
    c3_opacity: Double = Default("1"),
    all_opacity: Double = Default("1"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Blend two video frames in Vulkan.

Parameters:

Name Type Description Default
c0_mode Int | Literal['normal', 'multiply'] | Default

set component #0 blend mode (from 0 to 39) (default normal)

Default('normal')
c1_mode Int | Literal['normal', 'multiply'] | Default

set component #1 blend mode (from 0 to 39) (default normal)

Default('normal')
c2_mode Int | Literal['normal', 'multiply'] | Default

set component #2 blend mode (from 0 to 39) (default normal)

Default('normal')
c3_mode Int | Literal['normal', 'multiply'] | Default

set component #3 blend mode (from 0 to 39) (default normal)

Default('normal')
all_mode Int | Literal['normal', 'multiply'] | Default

set blend mode for all components (from -1 to 39) (default -1)

Default('-1')
c0_opacity Double

set color component #0 opacity (from 0 to 1) (default 1)

Default('1')
c1_opacity Double

set color component #1 opacity (from 0 to 1) (default 1)

Default('1')
c2_opacity Double

set color component #2 opacity (from 0 to 1) (default 1)

Default('1')
c3_opacity Double

set color component #3 opacity (from 0 to 1) (default 1)

Default('1')
all_opacity Double

set opacity for all color components (from 0 to 1) (default 1)

Default('1')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

bm3d

bm3d(
    *streams: VideoStream,
    sigma: Float = Default("1"),
    block: Int = Default("16"),
    bstep: Int = Default("4"),
    group: Int = Default("1"),
    range: Int = Default("9"),
    mstep: Int = Default("1"),
    thmse: Float = Default("0"),
    hdthr: Float = Default("2.7"),
    estim: (
        Int | Literal["basic", "final"] | Default
    ) = Default("basic"),
    ref: Boolean = Default("false"),
    planes: Int = Default("7"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Block-Matching 3D denoiser.

Parameters:

Name Type Description Default
sigma Float

set denoising strength (from 0 to 99999.9) (default 1)

Default('1')
block Int

set size of local patch (from 8 to 64) (default 16)

Default('16')
bstep Int

set sliding step for processing blocks (from 1 to 64) (default 4)

Default('4')
group Int

set maximal number of similar blocks (from 1 to 256) (default 1)

Default('1')
range Int

set block matching range (from 1 to INT_MAX) (default 9)

Default('9')
mstep Int

set step for block matching (from 1 to 64) (default 1)

Default('1')
thmse Float

set threshold of mean square error for block matching (from 0 to INT_MAX) (default 0)

Default('0')
hdthr Float

set hard threshold for 3D transfer domain (from 0 to INT_MAX) (default 2.7)

Default('2.7')
estim Int | Literal['basic', 'final'] | Default

set filtering estimation mode (from 0 to 1) (default basic)

Default('basic')
ref Boolean

have reference stream (default false)

Default('false')
planes Int

set planes to filter (from 0 to 15) (default 7)

Default('7')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

colormap

colormap(
    _default: VideoStream,
    _source: VideoStream,
    _target: VideoStream,
    *,
    patch_size: Image_size = Default("64x64"),
    nb_patches: Int = Default("0"),
    type: (
        Int | Literal["relative", "absolute"] | Default
    ) = Default("absolute"),
    kernel: (
        Int | Literal["euclidean", "weuclidean"] | Default
    ) = Default("euclidean"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Apply custom Color Maps to video stream.

Parameters:

Name Type Description Default
patch_size Image_size

set patch size (default "64x64")

Default('64x64')
nb_patches Int

set number of patches (from 0 to 64) (default 0)

Default('0')
type Int | Literal['relative', 'absolute'] | Default

set the target type used (from 0 to 1) (default absolute)

Default('absolute')
kernel Int | Literal['euclidean', 'weuclidean'] | Default

set the kernel used for measuring color difference (from 0 to 1) (default euclidean)

Default('euclidean')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

concat

concat(
    *streams: FilterableStream,
    n: Int = Auto("len(streams) // (int(v) + int(a))"),
    v: Int = Default("1"),
    a: Int = Default("0"),
    unsafe: Boolean = Default("false"),
    extra_options: dict[str, Any] | None = None
) -> FilterNode

Concatenate audio and video streams.

Parameters:

Name Type Description Default
n Int

specify the number of segments (from 1 to INT_MAX) (default 2)

Auto('len(streams) // (int(v) + int(a))')
v Int

specify the number of video streams (from 0 to INT_MAX) (default 1)

Default('1')
a Int

specify the number of audio streams (from 0 to INT_MAX) (default 0)

Default('0')
unsafe Boolean

enable unsafe mode (default false)

Default('false')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
filter_node FilterNode

the filter node

References

FFmpeg Documentation

convolve

convolve(
    _main: VideoStream,
    _impulse: VideoStream,
    *,
    planes: Int = Default("7"),
    impulse: (
        Int | Literal["first", "all"] | Default
    ) = Default("all"),
    noise: Float = Default("1e-07"),
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Convolve first video stream with second video stream.

Parameters:

Name Type Description Default
planes Int

set planes to convolve (from 0 to 15) (default 7)

Default('7')
impulse Int | Literal['first', 'all'] | Default

when to process impulses (from 0 to 1) (default all)

Default('all')
noise Float

set noise (from 0 to 1) (default 1e-07)

Default('1e-07')
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

corr

corr(
    _main: VideoStream,
    _reference: VideoStream,
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None,
) -> VideoStream

Calculate the correlation between two video streams.

Parameters:

Name Type Description Default
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

decimate

decimate(
    *streams: VideoStream,
    cycle: Int = Default("5"),
    dupthresh: Double = Default("1.1"),
    scthresh: Double = Default("15"),
    blockx: Int = Default("32"),
    blocky: Int = Default("32"),
    ppsrc: Boolean = Default("false"),
    chroma: Boolean = Default("true"),
    mixed: Boolean = Default("false"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Decimate frames (post field matching filter).

Parameters:

Name Type Description Default
cycle Int

set the number of frame from which one will be dropped (from 2 to 25) (default 5)

Default('5')
dupthresh Double

set duplicate threshold (from 0 to 100) (default 1.1)

Default('1.1')
scthresh Double

set scene change threshold (from 0 to 100) (default 15)

Default('15')
blockx Int

set the size of the x-axis blocks used during metric calculations (from 4 to 512) (default 32)

Default('32')
blocky Int

set the size of the y-axis blocks used during metric calculations (from 4 to 512) (default 32)

Default('32')
ppsrc Boolean

mark main input as a pre-processed input and activate clean source input stream (default false)

Default('false')
chroma Boolean

set whether or not chroma is considered in the metric calculations (default true)

Default('true')
mixed Boolean

set whether or not the input only partially contains content to be decimated (default false)

Default('false')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

deconvolve

deconvolve(
    _main: VideoStream,
    _impulse: VideoStream,
    *,
    planes: Int = Default("7"),
    impulse: (
        Int | Literal["first", "all"] | Default
    ) = Default("all"),
    noise: Float = Default("1e-07"),
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Deconvolve first video stream with second video stream.

Parameters:

Name Type Description Default
planes Int

set planes to deconvolve (from 0 to 15) (default 7)

Default('7')
impulse Int | Literal['first', 'all'] | Default

when to process impulses (from 0 to 1) (default all)

Default('all')
noise Float

set noise (from 0 to 1) (default 1e-07)

Default('1e-07')
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

displace

displace(
    _source: VideoStream,
    _xmap: VideoStream,
    _ymap: VideoStream,
    *,
    edge: (
        Int
        | Literal["blank", "smear", "wrap", "mirror"]
        | Default
    ) = Default("smear"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Displace pixels.

Parameters:

Name Type Description Default
edge Int | Literal['blank', 'smear', 'wrap', 'mirror'] | Default

set edge mode (from 0 to 3) (default smear)

Default('smear')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

feedback

feedback(
    _default: VideoStream,
    _feedin: VideoStream,
    *,
    x: Int = Default("0"),
    w: Int = Default("0"),
    extra_options: dict[str, Any] | None = None
) -> tuple[VideoStream, VideoStream]

Apply feedback video filter.

Parameters:

Name Type Description Default
x Int

set top left crop position (from 0 to INT_MAX) (default 0)

Default('0')
w Int

set crop size (from 0 to INT_MAX) (default 0)

Default('0')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

feedout VideoStream

the video stream

References

FFmpeg Documentation

fieldmatch

fieldmatch(
    *streams: VideoStream,
    order: (
        Int | Literal["auto", "bff", "tff"] | Default
    ) = Default("auto"),
    mode: (
        Int
        | Literal[
            "pc", "pc_n", "pc_u", "pc_n_ub", "pcn", "pcn_ub"
        ]
        | Default
    ) = Default("pc_n"),
    ppsrc: Boolean = Default("false"),
    field: (
        Int | Literal["auto", "bottom", "top"] | Default
    ) = Default("auto"),
    mchroma: Boolean = Default("true"),
    y0: Int = Default("0"),
    scthresh: Double = Default("12"),
    combmatch: (
        Int | Literal["none", "sc", "full"] | Default
    ) = Default("sc"),
    combdbg: (
        Int | Literal["none", "pcn", "pcnub"] | Default
    ) = Default("none"),
    cthresh: Int = Default("9"),
    chroma: Boolean = Default("false"),
    blockx: Int = Default("16"),
    blocky: Int = Default("16"),
    combpel: Int = Default("80"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Field matching for inverse telecine.

Parameters:

Name Type Description Default
order Int | Literal['auto', 'bff', 'tff'] | Default

specify the assumed field order (from -1 to 1) (default auto)

Default('auto')
mode Int | Literal['pc', 'pc_n', 'pc_u', 'pc_n_ub', 'pcn', 'pcn_ub'] | Default

set the matching mode or strategy to use (from 0 to 5) (default pc_n)

Default('pc_n')
ppsrc Boolean

mark main input as a pre-processed input and activate clean source input stream (default false)

Default('false')
field Int | Literal['auto', 'bottom', 'top'] | Default

set the field to match from (from -1 to 1) (default auto)

Default('auto')
mchroma Boolean

set whether or not chroma is included during the match comparisons (default true)

Default('true')
y0 Int

define an exclusion band which excludes the lines between y0 and y1 from the field matching decision (from 0 to INT_MAX) (default 0)

Default('0')
scthresh Double

set scene change detection threshold (from 0 to 100) (default 12)

Default('12')
combmatch Int | Literal['none', 'sc', 'full'] | Default

set combmatching mode (from 0 to 2) (default sc)

Default('sc')
combdbg Int | Literal['none', 'pcn', 'pcnub'] | Default

enable comb debug (from 0 to 2) (default none)

Default('none')
cthresh Int

set the area combing threshold used for combed frame detection (from -1 to 255) (default 9)

Default('9')
chroma Boolean

set whether or not chroma is considered in the combed frame decision (default false)

Default('false')
blockx Int

set the x-axis size of the window used during combed frame detection (from 4 to 512) (default 16)

Default('16')
blocky Int

set the y-axis size of the window used during combed frame detection (from 4 to 512) (default 16)

Default('16')
combpel Int

set the number of combed pixels inside any of the blocky by blockx size blocks on the frame for the frame to be detected as combed (from 0 to INT_MAX) (default 80)

Default('80')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

framepack

framepack(
    _left: VideoStream,
    _right: VideoStream,
    *,
    format: (
        Int
        | Literal[
            "sbs", "tab", "frameseq", "lines", "columns"
        ]
        | Default
    ) = Default("sbs"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate a frame packed stereoscopic video.

Parameters:

Name Type Description Default
format Int | Literal['sbs', 'tab', 'frameseq', 'lines', 'columns'] | Default

Frame pack output format (from 0 to INT_MAX) (default sbs)

Default('sbs')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
packed VideoStream

the video stream

References

FFmpeg Documentation

freezeframes

freezeframes(
    _source: VideoStream,
    _replace: VideoStream,
    *,
    first: Int64 = Default("0"),
    last: Int64 = Default("0"),
    replace: Int64 = Default("0"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Freeze video frames.

Parameters:

Name Type Description Default
first Int64

set first frame to freeze (from 0 to I64_MAX) (default 0)

Default('0')
last Int64

set last frame to freeze (from 0 to I64_MAX) (default 0)

Default('0')
replace Int64

set frame to replace (from 0 to I64_MAX) (default 0)

Default('0')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

guided

guided(
    *streams: VideoStream,
    radius: Int = Default("3"),
    eps: Float = Default("0.01"),
    mode: (
        Int | Literal["basic", "fast"] | Default
    ) = Default("basic"),
    sub: Int = Default("4"),
    guidance: (
        Int | Literal["off", "on"] | Default
    ) = Default("off"),
    planes: Int = Default("1"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Apply Guided filter.

Parameters:

Name Type Description Default
radius Int

set the box radius (from 1 to 20) (default 3)

Default('3')
eps Float

set the regularization parameter (with square) (from 0 to 1) (default 0.01)

Default('0.01')
mode Int | Literal['basic', 'fast'] | Default

set filtering mode (0: basic mode; 1: fast mode) (from 0 to 1) (default basic)

Default('basic')
sub Int

subsampling ratio for fast mode (from 2 to 64) (default 4)

Default('4')
guidance Int | Literal['off', 'on'] | Default

set guidance mode (0: off mode; 1: on mode) (from 0 to 1) (default off)

Default('off')
planes Int

set planes to filter (from 0 to 15) (default 1)

Default('1')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

haldclut

haldclut(
    _main: VideoStream,
    _clut: VideoStream,
    *,
    clut: Int | Literal["first", "all"] | Default = Default(
        "all"
    ),
    interp: (
        Int
        | Literal[
            "nearest",
            "trilinear",
            "tetrahedral",
            "pyramid",
            "prism",
        ]
        | Default
    ) = Default("tetrahedral"),
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Adjust colors using a Hald CLUT.

Parameters:

Name Type Description Default
clut Int | Literal['first', 'all'] | Default

when to process CLUT (from 0 to 1) (default all)

Default('all')
interp Int | Literal['nearest', 'trilinear', 'tetrahedral', 'pyramid', 'prism'] | Default

select interpolation mode (from 0 to 4) (default tetrahedral)

Default('tetrahedral')
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

headphone

headphone(
    *streams: AudioStream,
    map: String = Default(None),
    gain: Float = Default("0"),
    lfe: Float = Default("0"),
    type: Int | Literal["time", "freq"] | Default = Default(
        "freq"
    ),
    size: Int = Default("1024"),
    hrir: (
        Int | Literal["stereo", "multich"] | Default
    ) = Default("stereo"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Apply headphone binaural spatialization with HRTFs in additional streams.

Parameters:

Name Type Description Default
map String

set channels convolution mappings

Default(None)
gain Float

set gain in dB (from -20 to 40) (default 0)

Default('0')
lfe Float

set lfe gain in dB (from -20 to 40) (default 0)

Default('0')
type Int | Literal['time', 'freq'] | Default

set processing (from 0 to 1) (default freq)

Default('freq')
size Int

set frame size (from 1024 to 96000) (default 1024)

Default('1024')
hrir Int | Literal['stereo', 'multich'] | Default

set hrir format (from 0 to 1) (default stereo)

Default('stereo')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

hstack

hstack(
    *streams: VideoStream,
    inputs: Int = Auto("len(streams)"),
    shortest: Boolean = Default("false"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Stack video inputs horizontally.

Parameters:

Name Type Description Default
inputs Int

set number of inputs (from 2 to INT_MAX) (default 2)

Auto('len(streams)')
shortest Boolean

force termination when the shortest input terminates (default false)

Default('false')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

hstack_vaapi

hstack_vaapi(
    *streams: VideoStream,
    inputs: Int = Default("2"),
    shortest: Boolean = Default("false"),
    height: Int = Default("0"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

"VA-API" hstack.

Parameters:

Name Type Description Default
inputs Int

Set number of inputs (from 2 to 65535) (default 2)

Default('2')
shortest Boolean

Force termination when the shortest input terminates (default false)

Default('false')
height Int

Set output height (0 to use the height of input 0) (from 0 to 65535) (default 0)

Default('0')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

hysteresis

hysteresis(
    _base: VideoStream,
    _alt: VideoStream,
    *,
    planes: Int = Default("15"),
    threshold: Int = Default("0"),
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Grow first stream into second stream by connecting components.

Parameters:

Name Type Description Default
planes Int

set planes (from 0 to 15) (default 15)

Default('15')
threshold Int

set threshold (from 0 to 65535) (default 0)

Default('0')
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

identity

identity(
    _main: VideoStream,
    _reference: VideoStream,
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None,
) -> VideoStream

Calculate the Identity between two video streams.

Parameters:

Name Type Description Default
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

interleave

interleave(
    *streams: VideoStream,
    nb_inputs: Int = Auto("len(streams)"),
    duration: (
        Int
        | Literal["longest", "shortest", "first"]
        | Default
    ) = Default("longest"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Temporally interleave video inputs.

Parameters:

Name Type Description Default
nb_inputs Int

set number of inputs (from 1 to INT_MAX) (default 2)

Auto('len(streams)')
duration Int | Literal['longest', 'shortest', 'first'] | Default

how to determine the end-of-stream (from 0 to 2) (default longest)

Default('longest')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

join

join(
    *streams: AudioStream,
    inputs: Int = Auto("len(streams)"),
    channel_layout: String = Default("stereo"),
    map: String = Default(None),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Join multiple audio streams into multi-channel output.

Parameters:

Name Type Description Default
inputs Int

Number of input streams. (from 1 to INT_MAX) (default 2)

Auto('len(streams)')
channel_layout String

Channel layout of the output stream. (default "stereo")

Default('stereo')
map String

A comma-separated list of channels maps in the format 'input_stream.input_channel-output_channel.

Default(None)
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

ladspa

ladspa(
    *streams: AudioStream,
    file: String = Default(None),
    plugin: String = Default(None),
    controls: String = Default(None),
    sample_rate: Int = Default("44100"),
    nb_samples: Int = Default("1024"),
    duration: Duration = Default("-0.000001"),
    latency: Boolean = Default("false"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Apply LADSPA effect.

Parameters:

Name Type Description Default
file String

set library name or full path

Default(None)
plugin String

set plugin name

Default(None)
controls String

set plugin options

Default(None)
sample_rate Int

set sample rate (from 1 to INT_MAX) (default 44100)

Default('44100')
nb_samples Int

set the number of samples per requested frame (from 1 to INT_MAX) (default 1024)

Default('1024')
duration Duration

set audio duration (default -0.000001)

Default('-0.000001')
latency Boolean

enable latency compensation (default false)

Default('false')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

libplacebo

libplacebo(
    *streams: VideoStream,
    inputs: Int = Auto("len(streams)"),
    w: String = Default("iw"),
    h: String = Default("ih"),
    fps: String = Default("none"),
    crop_x: String = Default("(iw-cw)/2"),
    crop_y: String = Default("(ih-ch)/2"),
    crop_w: String = Default("iw"),
    crop_h: String = Default("ih"),
    pos_x: String = Default("(ow-pw)/2"),
    pos_y: String = Default("(oh-ph)/2"),
    pos_w: String = Default("ow"),
    pos_h: String = Default("oh"),
    format: String = Default(None),
    force_original_aspect_ratio: (
        Int
        | Literal["disable", "decrease", "increase"]
        | Default
    ) = Default("disable"),
    force_divisible_by: Int = Default("1"),
    normalize_sar: Boolean = Default("false"),
    pad_crop_ratio: Float = Default("0"),
    fillcolor: String = Default("black"),
    corner_rounding: Float = Default("0"),
    extra_opts: Dictionary = Default(None),
    colorspace: (
        Int
        | Literal[
            "auto",
            "gbr",
            "bt709",
            "unknown",
            "bt470bg",
            "smpte170m",
            "smpte240m",
            "ycgco",
            "bt2020nc",
            "bt2020c",
            "ictcp",
        ]
        | Default
    ) = Default("auto"),
    range: (
        Int
        | Literal[
            "auto",
            "unspecified",
            "unknown",
            "limited",
            "tv",
            "mpeg",
            "full",
            "pc",
            "jpeg",
        ]
        | Default
    ) = Default("auto"),
    color_primaries: (
        Int
        | Literal[
            "auto",
            "bt709",
            "unknown",
            "bt470m",
            "bt470bg",
            "smpte170m",
            "smpte240m",
            "film",
            "bt2020",
            "smpte428",
            "smpte431",
            "smpte432",
            "jedec-p22",
            "ebu3213",
        ]
        | Default
    ) = Default("auto"),
    color_trc: (
        Int
        | Literal[
            "auto",
            "bt709",
            "unknown",
            "bt470m",
            "bt470bg",
            "smpte170m",
            "smpte240m",
            "linear",
            "iec61966-2-4",
            "bt1361e",
            "iec61966-2-1",
            "bt2020-10",
            "bt2020-12",
            "smpte2084",
            "arib-std-b67",
        ]
        | Default
    ) = Default("auto"),
    upscaler: String = Default("spline36"),
    downscaler: String = Default("mitchell"),
    frame_mixer: String = Default("none"),
    lut_entries: Int = Default("0"),
    antiringing: Float = Default("0"),
    sigmoid: Boolean = Default("true"),
    apply_filmgrain: Boolean = Default("true"),
    apply_dolbyvision: Boolean = Default("true"),
    deband: Boolean = Default("false"),
    deband_iterations: Int = Default("1"),
    deband_threshold: Float = Default("4"),
    deband_radius: Float = Default("16"),
    deband_grain: Float = Default("6"),
    brightness: Float = Default("0"),
    contrast: Float = Default("1"),
    saturation: Float = Default("1"),
    hue: Float = Default("0"),
    gamma: Float = Default("1"),
    peak_detect: Boolean = Default("true"),
    smoothing_period: Float = Default("100"),
    minimum_peak: Float = Default("1"),
    scene_threshold_low: Float = Default("5.5"),
    scene_threshold_high: Float = Default("10"),
    percentile: Float = Default("99.995"),
    gamut_mode: (
        Int
        | Literal[
            "clip",
            "perceptual",
            "relative",
            "saturation",
            "absolute",
            "desaturate",
            "darken",
            "warn",
            "linear",
        ]
        | Default
    ) = Default("perceptual"),
    tonemapping: (
        Int
        | Literal[
            "auto",
            "clip",
            "st2094-40",
            "st2094-10",
            "bt.2390",
            "bt.2446a",
            "spline",
            "reinhard",
            "mobius",
            "hable",
            "gamma",
            "linear",
        ]
        | Default
    ) = Default("auto"),
    tonemapping_param: Float = Default("0"),
    inverse_tonemapping: Boolean = Default("false"),
    tonemapping_lut_size: Int = Default("256"),
    contrast_recovery: Float = Default("0.3"),
    contrast_smoothness: Float = Default("3.5"),
    desaturation_strength: Float = Default("-1"),
    desaturation_exponent: Float = Default("-1"),
    gamut_warning: Boolean = Default("false"),
    gamut_clipping: Boolean = Default("false"),
    intent: (
        Int
        | Literal[
            "perceptual",
            "relative",
            "absolute",
            "saturation",
        ]
        | Default
    ) = Default("perceptual"),
    tonemapping_mode: (
        Int
        | Literal["auto", "rgb", "max", "hybrid", "luma"]
        | Default
    ) = Default("auto"),
    tonemapping_crosstalk: Float = Default("0.04"),
    overshoot: Float = Default("0.05"),
    hybrid_mix: Float = Default("0.2"),
    dithering: (
        Int
        | Literal[
            "none",
            "blue",
            "ordered",
            "ordered_fixed",
            "white",
        ]
        | Default
    ) = Default("blue"),
    dither_lut_size: Int = Default("6"),
    dither_temporal: Boolean = Default("false"),
    cones: (
        Flags | Literal["l", "m", "s"] | Default
    ) = Default("0"),
    cone_strength: Float = Default("0"),
    custom_shader_path: String = Default(None),
    custom_shader_bin: Binary = Default(None),
    skip_aa: Boolean = Default("false"),
    polar_cutoff: Float = Default("0"),
    disable_linear: Boolean = Default("false"),
    disable_builtin: Boolean = Default("false"),
    force_icc_lut: Boolean = Default("false"),
    force_dither: Boolean = Default("false"),
    disable_fbos: Boolean = Default("false"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Apply various GPU filters from libplacebo.

Parameters:

Name Type Description Default
inputs Int

Number of inputs (from 1 to INT_MAX) (default 1)

Auto('len(streams)')
w String

Output video frame width (default "iw")

Default('iw')
h String

Output video frame height (default "ih")

Default('ih')
fps String

Output video frame rate (default "none")

Default('none')
crop_x String

Input video crop x (default "(iw-cw)/2")

Default('(iw-cw)/2')
crop_y String

Input video crop y (default "(ih-ch)/2")

Default('(ih-ch)/2')
crop_w String

Input video crop w (default "iw")

Default('iw')
crop_h String

Input video crop h (default "ih")

Default('ih')
pos_x String

Output video placement x (default "(ow-pw)/2")

Default('(ow-pw)/2')
pos_y String

Output video placement y (default "(oh-ph)/2")

Default('(oh-ph)/2')
pos_w String

Output video placement w (default "ow")

Default('ow')
pos_h String

Output video placement h (default "oh")

Default('oh')
format String

Output video format

Default(None)
force_original_aspect_ratio Int | Literal['disable', 'decrease', 'increase'] | Default

decrease or increase w/h if necessary to keep the original AR (from 0 to 2) (default disable)

Default('disable')
force_divisible_by Int

enforce that the output resolution is divisible by a defined integer when force_original_aspect_ratio is used (from 1 to 256) (default 1)

Default('1')
normalize_sar Boolean

force SAR normalization to 1:1 by adjusting pos_x/y/w/h (default false)

Default('false')
pad_crop_ratio Float

ratio between padding and cropping when normalizing SAR (0=pad, 1=crop) (from 0 to 1) (default 0)

Default('0')
fillcolor String

Background fill color (default "black")

Default('black')
corner_rounding Float

Corner rounding radius (from 0 to 1) (default 0)

Default('0')
extra_opts Dictionary

Pass extra libplacebo-specific options using a :-separated list of key=value pairs

Default(None)
colorspace Int | Literal['auto', 'gbr', 'bt709', 'unknown', 'bt470bg', 'smpte170m', 'smpte240m', 'ycgco', 'bt2020nc', 'bt2020c', 'ictcp'] | Default

select colorspace (from -1 to 14) (default auto)

Default('auto')
range Int | Literal['auto', 'unspecified', 'unknown', 'limited', 'tv', 'mpeg', 'full', 'pc', 'jpeg'] | Default

select color range (from -1 to 2) (default auto)

Default('auto')
color_primaries Int | Literal['auto', 'bt709', 'unknown', 'bt470m', 'bt470bg', 'smpte170m', 'smpte240m', 'film', 'bt2020', 'smpte428', 'smpte431', 'smpte432', 'jedec-p22', 'ebu3213'] | Default

select color primaries (from -1 to 22) (default auto)

Default('auto')
color_trc Int | Literal['auto', 'bt709', 'unknown', 'bt470m', 'bt470bg', 'smpte170m', 'smpte240m', 'linear', 'iec61966-2-4', 'bt1361e', 'iec61966-2-1', 'bt2020-10', 'bt2020-12', 'smpte2084', 'arib-std-b67'] | Default

select color transfer (from -1 to 18) (default auto)

Default('auto')
upscaler String

Upscaler function (default "spline36")

Default('spline36')
downscaler String

Downscaler function (default "mitchell")

Default('mitchell')
frame_mixer String

Frame mixing function (default "none")

Default('none')
lut_entries Int

Number of scaler LUT entries (from 0 to 256) (default 0)

Default('0')
antiringing Float

Antiringing strength (for non-EWA filters) (from 0 to 1) (default 0)

Default('0')
sigmoid Boolean

Enable sigmoid upscaling (default true)

Default('true')
apply_filmgrain Boolean

Apply film grain metadata (default true)

Default('true')
apply_dolbyvision Boolean

Apply Dolby Vision metadata (default true)

Default('true')
deband Boolean

Enable debanding (default false)

Default('false')
deband_iterations Int

Deband iterations (from 0 to 16) (default 1)

Default('1')
deband_threshold Float

Deband threshold (from 0 to 1024) (default 4)

Default('4')
deband_radius Float

Deband radius (from 0 to 1024) (default 16)

Default('16')
deband_grain Float

Deband grain (from 0 to 1024) (default 6)

Default('6')
brightness Float

Brightness boost (from -1 to 1) (default 0)

Default('0')
contrast Float

Contrast gain (from 0 to 16) (default 1)

Default('1')
saturation Float

Saturation gain (from 0 to 16) (default 1)

Default('1')
hue Float

Hue shift (from -3.14159 to 3.14159) (default 0)

Default('0')
gamma Float

Gamma adjustment (from 0 to 16) (default 1)

Default('1')
peak_detect Boolean

Enable dynamic peak detection for HDR tone-mapping (default true)

Default('true')
smoothing_period Float

Peak detection smoothing period (from 0 to 1000) (default 100)

Default('100')
minimum_peak Float

Peak detection minimum peak (from 0 to 100) (default 1)

Default('1')
scene_threshold_low Float

Scene change low threshold (from -1 to 100) (default 5.5)

Default('5.5')
scene_threshold_high Float

Scene change high threshold (from -1 to 100) (default 10)

Default('10')
percentile Float

Peak detection percentile (from 0 to 100) (default 99.995)

Default('99.995')
gamut_mode Int | Literal['clip', 'perceptual', 'relative', 'saturation', 'absolute', 'desaturate', 'darken', 'warn', 'linear'] | Default

Gamut-mapping mode (from 0 to 8) (default perceptual)

Default('perceptual')
tonemapping Int | Literal['auto', 'clip', 'st2094-40', 'st2094-10', 'bt.2390', 'bt.2446a', 'spline', 'reinhard', 'mobius', 'hable', 'gamma', 'linear'] | Default

Tone-mapping algorithm (from 0 to 11) (default auto)

Default('auto')
tonemapping_param Float

Tunable parameter for some tone-mapping functions (from 0 to 100) (default 0)

Default('0')
inverse_tonemapping Boolean

Inverse tone mapping (range expansion) (default false)

Default('false')
tonemapping_lut_size Int

Tone-mapping LUT size (from 2 to 1024) (default 256)

Default('256')
contrast_recovery Float

HDR contrast recovery strength (from 0 to 3) (default 0.3)

Default('0.3')
contrast_smoothness Float

HDR contrast recovery smoothness (from 1 to 32) (default 3.5)

Default('3.5')
desaturation_strength Float

Desaturation strength (from -1 to 1) (default -1)

Default('-1')
desaturation_exponent Float

Desaturation exponent (from -1 to 10) (default -1)

Default('-1')
gamut_warning Boolean

Highlight out-of-gamut colors (default false)

Default('false')
gamut_clipping Boolean

Enable desaturating colorimetric gamut clipping (default false)

Default('false')
intent Int | Literal['perceptual', 'relative', 'absolute', 'saturation'] | Default

Rendering intent (from 0 to 3) (default perceptual)

Default('perceptual')
tonemapping_mode Int | Literal['auto', 'rgb', 'max', 'hybrid', 'luma'] | Default

Tone-mapping mode (from 0 to 4) (default auto)

Default('auto')
tonemapping_crosstalk Float

Crosstalk factor for tone-mapping (from 0 to 0.3) (default 0.04)

Default('0.04')
overshoot Float

Tone-mapping overshoot margin (from 0 to 1) (default 0.05)

Default('0.05')
hybrid_mix Float

Tone-mapping hybrid LMS mixing coefficient (from 0 to 1) (default 0.2)

Default('0.2')
dithering Int | Literal['none', 'blue', 'ordered', 'ordered_fixed', 'white'] | Default

Dither method to use (from -1 to 3) (default blue)

Default('blue')
dither_lut_size Int

Dithering LUT size (from 1 to 8) (default 6)

Default('6')
dither_temporal Boolean

Enable temporal dithering (default false)

Default('false')
cones Flags | Literal['l', 'm', 's'] | Default

Colorblindness adaptation model (default 0)

Default('0')
cone_strength Float

Colorblindness adaptation strength (from 0 to 10) (default 0)

Default('0')
custom_shader_path String

Path to custom user shader (mpv .hook format)

Default(None)
custom_shader_bin Binary

Custom user shader as binary (mpv .hook format)

Default(None)
skip_aa Boolean

Skip anti-aliasing (default false)

Default('false')
polar_cutoff Float

Polar LUT cutoff (from 0 to 1) (default 0)

Default('0')
disable_linear Boolean

Disable linear scaling (default false)

Default('false')
disable_builtin Boolean

Disable built-in scalers (default false)

Default('false')
force_icc_lut Boolean

Deprecated, does nothing (default false)

Default('false')
force_dither Boolean

Force dithering (default false)

Default('false')
disable_fbos Boolean

Force-disable FBOs (default false)

Default('false')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

limitdiff

limitdiff(
    *streams: VideoStream,
    threshold: Float = Default("0.00392157"),
    elasticity: Float = Default("2"),
    reference: Boolean = Default("false"),
    planes: Int = Default("15"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Apply filtering with limiting difference.

Parameters:

Name Type Description Default
threshold Float

set the threshold (from 0 to 1) (default 0.00392157)

Default('0.00392157')
elasticity Float

set the elasticity (from 0 to 10) (default 2)

Default('2')
reference Boolean

enable reference stream (default false)

Default('false')
planes Int

set the planes to filter (from 0 to 15) (default 15)

Default('15')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

lut2

lut2(
    _srcx: VideoStream,
    _srcy: VideoStream,
    *,
    c0: String = Default("x"),
    c1: String = Default("x"),
    c2: String = Default("x"),
    c3: String = Default("x"),
    d: Int = Default("0"),
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Compute and apply a lookup table from two video inputs.

Parameters:

Name Type Description Default
c0 String

set component #0 expression (default "x")

Default('x')
c1 String

set component #1 expression (default "x")

Default('x')
c2 String

set component #2 expression (default "x")

Default('x')
c3 String

set component #3 expression (default "x")

Default('x')
d Int

set output depth (from 0 to 16) (default 0)

Default('0')
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

lv2

lv2(
    *streams: AudioStream,
    plugin: String = Default(None),
    controls: String = Default(None),
    sample_rate: Int = Default("44100"),
    nb_samples: Int = Default("1024"),
    duration: Duration = Default("-0.000001"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Apply LV2 effect.

Parameters:

Name Type Description Default
plugin String

set plugin uri

Default(None)
controls String

set plugin options

Default(None)
sample_rate Int

set sample rate (from 1 to INT_MAX) (default 44100)

Default('44100')
nb_samples Int

set the number of samples per requested frame (from 1 to INT_MAX) (default 1024)

Default('1024')
duration Duration

set audio duration (default -0.000001)

Default('-0.000001')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

maskedclamp

maskedclamp(
    _base: VideoStream,
    _dark: VideoStream,
    _bright: VideoStream,
    *,
    undershoot: Int = Default("0"),
    overshoot: Int = Default("0"),
    planes: Int = Default("15"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Clamp first stream with second stream and third stream.

Parameters:

Name Type Description Default
undershoot Int

set undershoot (from 0 to 65535) (default 0)

Default('0')
overshoot Int

set overshoot (from 0 to 65535) (default 0)

Default('0')
planes Int

set planes (from 0 to 15) (default 15)

Default('15')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

maskedmax

maskedmax(
    _source: VideoStream,
    _filter1: VideoStream,
    _filter2: VideoStream,
    *,
    planes: Int = Default("15"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Apply filtering with maximum difference of two streams.

Parameters:

Name Type Description Default
planes Int

set planes (from 0 to 15) (default 15)

Default('15')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

maskedmerge

maskedmerge(
    _base: VideoStream,
    _overlay: VideoStream,
    _mask: VideoStream,
    *,
    planes: Int = Default("15"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Merge first stream with second stream using third stream as mask.

Parameters:

Name Type Description Default
planes Int

set planes (from 0 to 15) (default 15)

Default('15')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

maskedmin

maskedmin(
    _source: VideoStream,
    _filter1: VideoStream,
    _filter2: VideoStream,
    *,
    planes: Int = Default("15"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Apply filtering with minimum difference of two streams.

Parameters:

Name Type Description Default
planes Int

set planes (from 0 to 15) (default 15)

Default('15')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

maskedthreshold

maskedthreshold(
    _source: VideoStream,
    _reference: VideoStream,
    *,
    threshold: Int = Default("1"),
    planes: Int = Default("15"),
    mode: Int | Literal["abs", "diff"] | Default = Default(
        "abs"
    ),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Pick pixels comparing absolute difference of two streams with threshold.

Parameters:

Name Type Description Default
threshold Int

set threshold (from 0 to 65535) (default 1)

Default('1')
planes Int

set planes (from 0 to 15) (default 15)

Default('15')
mode Int | Literal['abs', 'diff'] | Default

set mode (from 0 to 1) (default abs)

Default('abs')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

mergeplanes

mergeplanes(
    *streams: VideoStream,
    mapping: Int = Default("-1"),
    format: Pix_fmt = Default("yuva444p"),
    map0s: Int = Default("0"),
    map0p: Int = Default("0"),
    map1s: Int = Default("0"),
    map1p: Int = Default("0"),
    map2s: Int = Default("0"),
    map2p: Int = Default("0"),
    map3s: Int = Default("0"),
    map3p: Int = Default("0"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Merge planes.

Parameters:

Name Type Description Default
mapping Int

set input to output plane mapping (from -1 to 8.58993e+08) (default -1)

Default('-1')
format Pix_fmt

set output pixel format (default yuva444p)

Default('yuva444p')
map0s Int

set 1st input to output stream mapping (from 0 to 3) (default 0)

Default('0')
map0p Int

set 1st input to output plane mapping (from 0 to 3) (default 0)

Default('0')
map1s Int

set 2nd input to output stream mapping (from 0 to 3) (default 0)

Default('0')
map1p Int

set 2nd input to output plane mapping (from 0 to 3) (default 0)

Default('0')
map2s Int

set 3rd input to output stream mapping (from 0 to 3) (default 0)

Default('0')
map2p Int

set 3rd input to output plane mapping (from 0 to 3) (default 0)

Default('0')
map3s Int

set 4th input to output stream mapping (from 0 to 3) (default 0)

Default('0')
map3p Int

set 4th input to output plane mapping (from 0 to 3) (default 0)

Default('0')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

midequalizer

midequalizer(
    _in0: VideoStream,
    _in1: VideoStream,
    *,
    planes: Int = Default("15"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Apply Midway Equalization.

Parameters:

Name Type Description Default
planes Int

set planes (from 0 to 15) (default 15)

Default('15')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

mix

mix(
    *streams: VideoStream,
    inputs: Int = Auto("len(streams)"),
    weights: String = Default("1 1"),
    scale: Float = Default("0"),
    planes: Flags = Default("F"),
    duration: (
        Int
        | Literal["longest", "shortest", "first"]
        | Default
    ) = Default("longest"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Mix video inputs.

Parameters:

Name Type Description Default
inputs Int

set number of inputs (from 2 to 32767) (default 2)

Auto('len(streams)')
weights String

set weight for each input (default "1 1")

Default('1 1')
scale Float

set scale (from 0 to 32767) (default 0)

Default('0')
planes Flags

set what planes to filter (default F)

Default('F')
duration Int | Literal['longest', 'shortest', 'first'] | Default

how to determine end of stream (from 0 to 2) (default longest)

Default('longest')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

morpho

morpho(
    _default: VideoStream,
    _structure: VideoStream,
    *,
    mode: (
        Int
        | Literal[
            "erode",
            "dilate",
            "open",
            "close",
            "gradient",
            "tophat",
            "blackhat",
        ]
        | Default
    ) = Default("erode"),
    planes: Int = Default("7"),
    structure: (
        Int | Literal["first", "all"] | Default
    ) = Default("all"),
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Apply Morphological filter.

Parameters:

Name Type Description Default
mode Int | Literal['erode', 'dilate', 'open', 'close', 'gradient', 'tophat', 'blackhat'] | Default

set morphological transform (from 0 to 6) (default erode)

Default('erode')
planes Int

set planes to filter (from 0 to 15) (default 7)

Default('7')
structure Int | Literal['first', 'all'] | Default

when to process structures (from 0 to 1) (default all)

Default('all')
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

msad

msad(
    _main: VideoStream,
    _reference: VideoStream,
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None,
) -> VideoStream

Calculate the MSAD between two video streams.

Parameters:

Name Type Description Default
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

multiply

multiply(
    _source: VideoStream,
    _factor: VideoStream,
    *,
    scale: Float = Default("1"),
    offset: Float = Default("0.5"),
    planes: Flags = Default("F"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Multiply first video stream with second video stream.

Parameters:

Name Type Description Default
scale Float

set scale (from 0 to 9) (default 1)

Default('1')
offset Float

set offset (from -1 to 1) (default 0.5)

Default('0.5')
planes Flags

set planes (default F)

Default('F')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

overlay

overlay(
    _main: VideoStream,
    _overlay: VideoStream,
    *,
    x: String = Default("0"),
    y: String = Default("0"),
    eof_action: (
        Int | Literal["repeat", "endall", "pass"] | Default
    ) = Default("repeat"),
    eval: (
        Int | Literal["init", "frame"] | Default
    ) = Default("frame"),
    shortest: Boolean = Default("false"),
    format: (
        Int
        | Literal[
            "yuv420",
            "yuv420p10",
            "yuv422",
            "yuv422p10",
            "yuv444",
            "yuv444p10",
            "rgb",
            "gbrp",
            "auto",
        ]
        | Default
    ) = Default("yuv420"),
    repeatlast: Boolean = Default("true"),
    alpha: (
        Int | Literal["straight", "premultiplied"] | Default
    ) = Default("straight"),
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Overlay a video source on top of the input.

Parameters:

Name Type Description Default
x String

set the x expression (default "0")

Default('0')
y String

set the y expression (default "0")

Default('0')
eof_action Int | Literal['repeat', 'endall', 'pass'] | Default

Action to take when encountering EOF from secondary input (from 0 to 2) (default repeat)

Default('repeat')
eval Int | Literal['init', 'frame'] | Default

specify when to evaluate expressions (from 0 to 1) (default frame)

Default('frame')
shortest Boolean

force termination when the shortest input terminates (default false)

Default('false')
format Int | Literal['yuv420', 'yuv420p10', 'yuv422', 'yuv422p10', 'yuv444', 'yuv444p10', 'rgb', 'gbrp', 'auto'] | Default

set output format (from 0 to 8) (default yuv420)

Default('yuv420')
repeatlast Boolean

repeat overlay of the last overlay frame (default true)

Default('true')
alpha Int | Literal['straight', 'premultiplied'] | Default

alpha format (from 0 to 1) (default straight)

Default('straight')
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

overlay_cuda

overlay_cuda(
    _main: VideoStream,
    _overlay: VideoStream,
    *,
    x: String = Default("0"),
    y: String = Default("0"),
    eof_action: (
        Int | Literal["repeat", "endall", "pass"] | Default
    ) = Default("repeat"),
    eval: (
        Int | Literal["init", "frame"] | Default
    ) = Default("frame"),
    shortest: Boolean = Default("false"),
    repeatlast: Boolean = Default("true"),
    framesync_options: FFMpegFrameSyncOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Overlay one video on top of another using CUDA.

Parameters:

Name Type Description Default
x String

set the x expression of overlay (default "0")

Default('0')
y String

set the y expression of overlay (default "0")

Default('0')
eof_action Int | Literal['repeat', 'endall', 'pass'] | Default

Action to take when encountering EOF from secondary input (from 0 to 2) (default repeat)

Default('repeat')
eval Int | Literal['init', 'frame'] | Default

specify when to evaluate expressions (from 0 to 1) (default frame)

Default('frame')
shortest Boolean

force termination when the shortest input terminates (default false)

Default('false')
repeatlast Boolean

repeat overlay of the last overlay frame (default true)

Default('true')
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

overlay_opencl

overlay_opencl(
    _main: VideoStream,
    _overlay: VideoStream,
    *,
    x: Int = Default("0"),
    y: Int = Default("0"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Overlay one video on top of another.

Parameters:

Name Type Description Default
x Int

Overlay x position (from 0 to INT_MAX) (default 0)

Default('0')
y Int

Overlay y position (from 0 to INT_MAX) (default 0)

Default('0')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

overlay_vaapi

overlay_vaapi(
    _main: VideoStream,
    _overlay: VideoStream,
    *,
    x: String = Default("0"),
    y: String = Default("0"),
    w: String = Default("overlay_iw"),
    h: String = Default("overlay_ih*w/overlay_iw"),
    alpha: Float = Default("1"),
    eof_action: (
        Int | Literal["repeat", "endall", "pass"] | Default
    ) = Default("repeat"),
    shortest: Boolean = Default("false"),
    repeatlast: Boolean = Default("true"),
    framesync_options: FFMpegFrameSyncOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Overlay one video on top of another.

Parameters:

Name Type Description Default
x String

Overlay x position (default "0")

Default('0')
y String

Overlay y position (default "0")

Default('0')
w String

Overlay width (default "overlay_iw")

Default('overlay_iw')
h String

Overlay height (default "overlay_ih*w/overlay_iw")

Default('overlay_ih*w/overlay_iw')
alpha Float

Overlay global alpha (from 0 to 1) (default 1)

Default('1')
eof_action Int | Literal['repeat', 'endall', 'pass'] | Default

Action to take when encountering EOF from secondary input (from 0 to 2) (default repeat)

Default('repeat')
shortest Boolean

force termination when the shortest input terminates (default false)

Default('false')
repeatlast Boolean

repeat overlay of the last overlay frame (default true)

Default('true')
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

overlay_vulkan

overlay_vulkan(
    _main: VideoStream,
    _overlay: VideoStream,
    *,
    x: Int = Default("0"),
    y: Int = Default("0"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Overlay a source on top of another.

Parameters:

Name Type Description Default
x Int

Set horizontal offset (from 0 to INT_MAX) (default 0)

Default('0')
y Int

Set vertical offset (from 0 to INT_MAX) (default 0)

Default('0')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

paletteuse

paletteuse(
    _default: VideoStream,
    _palette: VideoStream,
    *,
    dither: (
        Int
        | Literal[
            "bayer",
            "heckbert",
            "floyd_steinberg",
            "sierra2",
            "sierra2_4a",
            "sierra3",
            "burkes",
            "atkinson",
        ]
        | Default
    ) = Default("sierra2_4a"),
    bayer_scale: Int = Default("2"),
    diff_mode: (
        Int | Literal["rectangle"] | Default
    ) = Default("0"),
    new: Boolean = Default("false"),
    alpha_threshold: Int = Default("128"),
    debug_kdtree: String = Default(None),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Use a palette to downsample an input video stream.

Parameters:

Name Type Description Default
dither Int | Literal['bayer', 'heckbert', 'floyd_steinberg', 'sierra2', 'sierra2_4a', 'sierra3', 'burkes', 'atkinson'] | Default

select dithering mode (from 0 to 8) (default sierra2_4a)

Default('sierra2_4a')
bayer_scale Int

set scale for bayer dithering (from 0 to 5) (default 2)

Default('2')
diff_mode Int | Literal['rectangle'] | Default

set frame difference mode (from 0 to 1) (default 0)

Default('0')
new Boolean

take new palette for each output frame (default false)

Default('false')
alpha_threshold Int

set the alpha threshold for transparency (from 0 to 255) (default 128)

Default('128')
debug_kdtree String

save Graphviz graph of the kdtree in specified file

Default(None)
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

premultiply

premultiply(
    *streams: VideoStream,
    planes: Int = Default("15"),
    inplace: Boolean = Default("false"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

PreMultiply first stream with first plane of second stream.

Parameters:

Name Type Description Default
planes Int

set planes (from 0 to 15) (default 15)

Default('15')
inplace Boolean

enable inplace mode (default false)

Default('false')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

program_opencl

program_opencl(
    *streams: VideoStream,
    source: String = Default(None),
    kernel: String = Default(None),
    inputs: Int = Default("1"),
    size: Image_size = Default(None),
    framesync_options: FFMpegFrameSyncOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Filter video using an OpenCL program.

Parameters:

Name Type Description Default
source String

OpenCL program source file

Default(None)
kernel String

Kernel name in program

Default(None)
inputs Int

Number of inputs (from 1 to INT_MAX) (default 1)

Default('1')
size Image_size

Video size

Default(None)
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

psnr

psnr(
    _main: VideoStream,
    _reference: VideoStream,
    *,
    stats_file: String = Default(None),
    stats_version: Int = Default("1"),
    output_max: Boolean = Default("false"),
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Calculate the PSNR between two video streams.

Parameters:

Name Type Description Default
stats_file String

Set file where to store per-frame difference information

Default(None)
stats_version Int

Set the format version for the stats file. (from 1 to 2) (default 1)

Default('1')
output_max Boolean

Add raw stats (max values) to the output log. (default false)

Default('false')
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

remap

remap(
    _source: VideoStream,
    _xmap: VideoStream,
    _ymap: VideoStream,
    *,
    format: (
        Int | Literal["color", "gray"] | Default
    ) = Default("color"),
    fill: Color = Default("black"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Remap pixels.

Parameters:

Name Type Description Default
format Int | Literal['color', 'gray'] | Default

set output format (from 0 to 1) (default color)

Default('color')
fill Color

set the color of the unmapped pixels (default "black")

Default('black')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

remap_opencl

remap_opencl(
    _source: VideoStream,
    _xmap: VideoStream,
    _ymap: VideoStream,
    *,
    interp: (
        Int | Literal["near", "linear"] | Default
    ) = Default("linear"),
    fill: Color = Default("black"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Remap pixels using OpenCL.

Parameters:

Name Type Description Default
interp Int | Literal['near', 'linear'] | Default

set interpolation method (from 0 to 1) (default linear)

Default('linear')
fill Color

set the color of the unmapped pixels (default "black")

Default('black')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

sidechaincompress

sidechaincompress(
    _main: AudioStream,
    _sidechain: AudioStream,
    *,
    level_in: Double = Default("1"),
    mode: (
        Int | Literal["downward", "upward"] | Default
    ) = Default("downward"),
    threshold: Double = Default("0.125"),
    ratio: Double = Default("2"),
    attack: Double = Default("20"),
    release: Double = Default("250"),
    makeup: Double = Default("1"),
    knee: Double = Default("2.82843"),
    link: (
        Int | Literal["average", "maximum"] | Default
    ) = Default("average"),
    detection: (
        Int | Literal["peak", "rms"] | Default
    ) = Default("rms"),
    level_sc: Double = Default("1"),
    mix: Double = Default("1"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Sidechain compressor.

Parameters:

Name Type Description Default
level_in Double

set input gain (from 0.015625 to 64) (default 1)

Default('1')
mode Int | Literal['downward', 'upward'] | Default

set mode (from 0 to 1) (default downward)

Default('downward')
threshold Double

set threshold (from 0.000976563 to 1) (default 0.125)

Default('0.125')
ratio Double

set ratio (from 1 to 20) (default 2)

Default('2')
attack Double

set attack (from 0.01 to 2000) (default 20)

Default('20')
release Double

set release (from 0.01 to 9000) (default 250)

Default('250')
makeup Double

set make up gain (from 1 to 64) (default 1)

Default('1')
knee Double

set knee (from 1 to 8) (default 2.82843)

Default('2.82843')
link Int | Literal['average', 'maximum'] | Default

set link type (from 0 to 1) (default average)

Default('average')
detection Int | Literal['peak', 'rms'] | Default

set detection (from 0 to 1) (default rms)

Default('rms')
level_sc Double

set sidechain gain (from 0.015625 to 64) (default 1)

Default('1')
mix Double

set mix (from 0 to 1) (default 1)

Default('1')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

sidechaingate

sidechaingate(
    _main: AudioStream,
    _sidechain: AudioStream,
    *,
    level_in: Double = Default("1"),
    mode: (
        Int | Literal["downward", "upward"] | Default
    ) = Default("downward"),
    range: Double = Default("0.06125"),
    threshold: Double = Default("0.125"),
    ratio: Double = Default("2"),
    attack: Double = Default("20"),
    release: Double = Default("250"),
    makeup: Double = Default("1"),
    knee: Double = Default("2.82843"),
    detection: (
        Int | Literal["peak", "rms"] | Default
    ) = Default("rms"),
    link: (
        Int | Literal["average", "maximum"] | Default
    ) = Default("average"),
    level_sc: Double = Default("1"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Audio sidechain gate.

Parameters:

Name Type Description Default
level_in Double

set input level (from 0.015625 to 64) (default 1)

Default('1')
mode Int | Literal['downward', 'upward'] | Default

set mode (from 0 to 1) (default downward)

Default('downward')
range Double

set max gain reduction (from 0 to 1) (default 0.06125)

Default('0.06125')
threshold Double

set threshold (from 0 to 1) (default 0.125)

Default('0.125')
ratio Double

set ratio (from 1 to 9000) (default 2)

Default('2')
attack Double

set attack (from 0.01 to 9000) (default 20)

Default('20')
release Double

set release (from 0.01 to 9000) (default 250)

Default('250')
makeup Double

set makeup gain (from 1 to 64) (default 1)

Default('1')
knee Double

set knee (from 1 to 8) (default 2.82843)

Default('2.82843')
detection Int | Literal['peak', 'rms'] | Default

set detection (from 0 to 1) (default rms)

Default('rms')
link Int | Literal['average', 'maximum'] | Default

set link (from 0 to 1) (default average)

Default('average')
level_sc Double

set sidechain gain (from 0.015625 to 64) (default 1)

Default('1')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

signature

signature(
    *streams: VideoStream,
    detectmode: (
        Int | Literal["off", "full", "fast"] | Default
    ) = Default("off"),
    nb_inputs: Int = Auto("len(streams)"),
    filename: String = Default(""),
    format: (
        Int | Literal["binary", "xml"] | Default
    ) = Default("binary"),
    th_d: Int = Default("9000"),
    th_dc: Int = Default("60000"),
    th_xh: Int = Default("116"),
    th_di: Int = Default("0"),
    th_it: Double = Default("0.5"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Calculate the MPEG-7 video signature.

Parameters:

Name Type Description Default
detectmode Int | Literal['off', 'full', 'fast'] | Default

set the detectmode (from 0 to 2) (default off)

Default('off')
nb_inputs Int

number of inputs (from 1 to INT_MAX) (default 1)

Auto('len(streams)')
filename String

filename for output files (default "")

Default('')
format Int | Literal['binary', 'xml'] | Default

set output format (from 0 to 1) (default binary)

Default('binary')
th_d Int

threshold to detect one word as similar (from 1 to INT_MAX) (default 9000)

Default('9000')
th_dc Int

threshold to detect all words as similar (from 1 to INT_MAX) (default 60000)

Default('60000')
th_xh Int

threshold to detect frames as similar (from 1 to INT_MAX) (default 116)

Default('116')
th_di Int

minimum length of matching sequence in frames (from 0 to INT_MAX) (default 0)

Default('0')
th_it Double

threshold for relation of good to all frames (from 0 to 1) (default 0.5)

Default('0.5')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

spectrumsynth

spectrumsynth(
    _magnitude: VideoStream,
    _phase: VideoStream,
    *,
    sample_rate: Int = Default("44100"),
    channels: Int = Default("1"),
    scale: Int | Literal["lin", "log"] | Default = Default(
        "log"
    ),
    slide: (
        Int
        | Literal[
            "replace", "scroll", "fullframe", "rscroll"
        ]
        | Default
    ) = Default("fullframe"),
    win_func: (
        Int
        | Literal[
            "rect",
            "bartlett",
            "hann",
            "hanning",
            "hamming",
            "blackman",
            "welch",
            "flattop",
            "bharris",
            "bnuttall",
            "bhann",
            "sine",
            "nuttall",
            "lanczos",
            "gauss",
            "tukey",
            "dolph",
            "cauchy",
            "parzen",
            "poisson",
            "bohman",
            "kaiser",
        ]
        | Default
    ) = Default("rect"),
    overlap: Float = Default("1"),
    orientation: (
        Int | Literal["vertical", "horizontal"] | Default
    ) = Default("vertical"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Convert input spectrum videos to audio output.

Parameters:

Name Type Description Default
sample_rate Int

set sample rate (from 15 to INT_MAX) (default 44100)

Default('44100')
channels Int

set channels (from 1 to 8) (default 1)

Default('1')
scale Int | Literal['lin', 'log'] | Default

set input amplitude scale (from 0 to 1) (default log)

Default('log')
slide Int | Literal['replace', 'scroll', 'fullframe', 'rscroll'] | Default

set input sliding mode (from 0 to 3) (default fullframe)

Default('fullframe')
win_func Int | Literal['rect', 'bartlett', 'hann', 'hanning', 'hamming', 'blackman', 'welch', 'flattop', 'bharris', 'bnuttall', 'bhann', 'sine', 'nuttall', 'lanczos', 'gauss', 'tukey', 'dolph', 'cauchy', 'parzen', 'poisson', 'bohman', 'kaiser'] | Default

set window function (from 0 to 20) (default rect)

Default('rect')
overlap Float

set window overlap (from 0 to 1) (default 1)

Default('1')
orientation Int | Literal['vertical', 'horizontal'] | Default

set orientation (from 0 to 1) (default vertical)

Default('vertical')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

ssim

ssim(
    _main: VideoStream,
    _reference: VideoStream,
    *,
    stats_file: String = Default(None),
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Calculate the SSIM between two video streams.

Parameters:

Name Type Description Default
stats_file String

Set file where to store per-frame difference information

Default(None)
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

streamselect

streamselect(
    *streams: VideoStream,
    inputs: Int = Auto("len(streams)"),
    map: String = Default(None),
    extra_options: dict[str, Any] | None = None
) -> FilterNode

Select video streams.

Parameters:

Name Type Description Default
inputs Int

number of input streams (from 2 to INT_MAX) (default 2)

Auto('len(streams)')
map String

input indexes to remap to outputs

Default(None)
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
filter_node FilterNode

the filter node

References

FFmpeg Documentation

threshold

threshold(
    _default: VideoStream,
    _threshold: VideoStream,
    _min: VideoStream,
    _max: VideoStream,
    *,
    planes: Int = Default("15"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Threshold first video stream using other video streams.

Parameters:

Name Type Description Default
planes Int

set planes to filter (from 0 to 15) (default 15)

Default('15')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

unpremultiply

unpremultiply(
    *streams: VideoStream,
    planes: Int = Default("15"),
    inplace: Boolean = Default("false"),
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

UnPreMultiply first stream with first plane of second stream.

Parameters:

Name Type Description Default
planes Int

set planes (from 0 to 15) (default 15)

Default('15')
inplace Boolean

enable inplace mode (default false)

Default('false')
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

varblur

varblur(
    _default: VideoStream,
    _radius: VideoStream,
    *,
    min_r: Int = Default("0"),
    max_r: Int = Default("8"),
    planes: Int = Default("15"),
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Apply Variable Blur filter.

Parameters:

Name Type Description Default
min_r Int

set min blur radius (from 0 to 254) (default 0)

Default('0')
max_r Int

set max blur radius (from 1 to 255) (default 8)

Default('8')
planes Int

set planes to filter (from 0 to 15) (default 15)

Default('15')
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

vif

vif(
    _main: VideoStream,
    _reference: VideoStream,
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None,
) -> VideoStream

Calculate the VIF between two video streams.

Parameters:

Name Type Description Default
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

vstack

vstack(
    *streams: VideoStream,
    inputs: Int = Auto("len(streams)"),
    shortest: Boolean = Default("false"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Stack video inputs vertically.

Parameters:

Name Type Description Default
inputs Int

set number of inputs (from 2 to INT_MAX) (default 2)

Auto('len(streams)')
shortest Boolean

force termination when the shortest input terminates (default false)

Default('false')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

vstack_vaapi

vstack_vaapi(
    *streams: VideoStream,
    inputs: Int = Default("2"),
    shortest: Boolean = Default("false"),
    width: Int = Default("0"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

"VA-API" vstack.

Parameters:

Name Type Description Default
inputs Int

Set number of inputs (from 2 to 65535) (default 2)

Default('2')
shortest Boolean

Force termination when the shortest input terminates (default false)

Default('false')
width Int

Set output width (0 to use the width of input 0) (from 0 to 65535) (default 0)

Default('0')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

xcorrelate

xcorrelate(
    _primary: VideoStream,
    _secondary: VideoStream,
    *,
    planes: Int = Default("7"),
    secondary: (
        Int | Literal["first", "all"] | Default
    ) = Default("all"),
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Cross-correlate first video stream with second video stream.

Parameters:

Name Type Description Default
planes Int

set planes to cross-correlate (from 0 to 15) (default 7)

Default('7')
secondary Int | Literal['first', 'all'] | Default

when to process secondary frame (from 0 to 1) (default all)

Default('all')
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

xfade

xfade(
    _main: VideoStream,
    _xfade: VideoStream,
    *,
    transition: (
        Int
        | Literal[
            "custom",
            "fade",
            "wipeleft",
            "wiperight",
            "wipeup",
            "wipedown",
            "slideleft",
            "slideright",
            "slideup",
            "slidedown",
            "circlecrop",
            "rectcrop",
            "distance",
            "fadeblack",
            "fadewhite",
            "radial",
            "smoothleft",
            "smoothright",
            "smoothup",
            "smoothdown",
            "circleopen",
            "circleclose",
            "vertopen",
            "vertclose",
            "horzopen",
            "horzclose",
            "dissolve",
            "pixelize",
            "diagtl",
            "diagtr",
            "diagbl",
            "diagbr",
            "hlslice",
            "hrslice",
            "vuslice",
            "vdslice",
            "hblur",
            "fadegrays",
            "wipetl",
            "wipetr",
            "wipebl",
            "wipebr",
            "squeezeh",
            "squeezev",
            "zoomin",
            "fadefast",
            "fadeslow",
            "hlwind",
            "hrwind",
            "vuwind",
            "vdwind",
            "coverleft",
            "coverright",
            "coverup",
            "coverdown",
            "revealleft",
            "revealright",
            "revealup",
            "revealdown",
        ]
        | Default
    ) = Default("fade"),
    duration: Duration = Default("1"),
    offset: Duration = Default("0"),
    expr: String = Default(None),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Cross fade one video with another video.

Parameters:

Name Type Description Default
transition Int | Literal['custom', 'fade', 'wipeleft', 'wiperight', 'wipeup', 'wipedown', 'slideleft', 'slideright', 'slideup', 'slidedown', 'circlecrop', 'rectcrop', 'distance', 'fadeblack', 'fadewhite', 'radial', 'smoothleft', 'smoothright', 'smoothup', 'smoothdown', 'circleopen', 'circleclose', 'vertopen', 'vertclose', 'horzopen', 'horzclose', 'dissolve', 'pixelize', 'diagtl', 'diagtr', 'diagbl', 'diagbr', 'hlslice', 'hrslice', 'vuslice', 'vdslice', 'hblur', 'fadegrays', 'wipetl', 'wipetr', 'wipebl', 'wipebr', 'squeezeh', 'squeezev', 'zoomin', 'fadefast', 'fadeslow', 'hlwind', 'hrwind', 'vuwind', 'vdwind', 'coverleft', 'coverright', 'coverup', 'coverdown', 'revealleft', 'revealright', 'revealup', 'revealdown'] | Default

set cross fade transition (from -1 to 57) (default fade)

Default('fade')
duration Duration

set cross fade duration (default 1)

Default('1')
offset Duration

set cross fade start relative to first input stream (default 0)

Default('0')
expr String

set expression for custom transition

Default(None)
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

xfade_opencl

xfade_opencl(
    _main: VideoStream,
    _xfade: VideoStream,
    *,
    transition: (
        Int
        | Literal[
            "custom",
            "fade",
            "wipeleft",
            "wiperight",
            "wipeup",
            "wipedown",
            "slideleft",
            "slideright",
            "slideup",
            "slidedown",
        ]
        | Default
    ) = Default("fade"),
    source: String = Default(None),
    kernel: String = Default(None),
    duration: Duration = Default("1"),
    offset: Duration = Default("0"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Cross fade one video with another video.

Parameters:

Name Type Description Default
transition Int | Literal['custom', 'fade', 'wipeleft', 'wiperight', 'wipeup', 'wipedown', 'slideleft', 'slideright', 'slideup', 'slidedown'] | Default

set cross fade transition (from 0 to 9) (default fade)

Default('fade')
source String

set OpenCL program source file for custom transition

Default(None)
kernel String

set kernel name in program file for custom transition

Default(None)
duration Duration

set cross fade duration (default 1)

Default('1')
offset Duration

set cross fade start relative to first input stream (default 0)

Default('0')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

xmedian

xmedian(
    *streams: VideoStream,
    inputs: Int = Auto("len(streams)"),
    planes: Int = Default("15"),
    percentile: Float = Default("0.5"),
    framesync_options: FFMpegFrameSyncOption | None = None,
    timeline_options: FFMpegTimelineOption | None = None,
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Pick median pixels from several video inputs.

Parameters:

Name Type Description Default
inputs Int

set number of inputs (from 3 to 255) (default 3)

Auto('len(streams)')
planes Int

set planes to filter (from 0 to 15) (default 15)

Default('15')
percentile Float

set percentile (from 0 to 1) (default 0.5)

Default('0.5')
framesync_options FFMpegFrameSyncOption | None

Framesync options

None
timeline_options FFMpegTimelineOption | None

Timeline options

None
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

xstack

xstack(
    *streams: VideoStream,
    inputs: Int = Auto("len(streams)"),
    layout: String = Default(None),
    grid: Image_size = Default(None),
    shortest: Boolean = Default("false"),
    fill: String = Default("none"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Stack video inputs into custom layout.

Parameters:

Name Type Description Default
inputs Int

set number of inputs (from 2 to INT_MAX) (default 2)

Auto('len(streams)')
layout String

set custom layout

Default(None)
grid Image_size

set fixed size grid layout

Default(None)
shortest Boolean

force termination when the shortest input terminates (default false)

Default('false')
fill String

set the color for unused pixels (default "none")

Default('none')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

xstack_vaapi

xstack_vaapi(
    *streams: VideoStream,
    inputs: Int = Default("2"),
    shortest: Boolean = Default("false"),
    layout: String = Default(None),
    grid: Image_size = Default(None),
    grid_tile_size: Image_size = Default(None),
    fill: String = Default("none"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

"VA-API" xstack.

Parameters:

Name Type Description Default
inputs Int

Set number of inputs (from 2 to 65535) (default 2)

Default('2')
shortest Boolean

Force termination when the shortest input terminates (default false)

Default('false')
layout String

Set custom layout

Default(None)
grid Image_size

set fixed size grid layout

Default(None)
grid_tile_size Image_size

set tile size in grid layout

Default(None)
fill String

Set the color for unused pixels (default "none")

Default('none')
extra_options dict[str, Any] | None

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation