Skip to content

sources

FFmpeg sources.

Functions:

Name Description
abuffer

Buffer audio frames, and make them accessible to the filterchain.

aevalsrc

Generate an audio signal generated by an expression.

afdelaysrc

Generate a Fractional delay FIR coefficients.

afireqsrc

Generate a FIR equalizer coefficients audio stream.

afirsrc

Generate a FIR coefficients audio stream.

ainterleave

Temporally interleave audio inputs.

allrgb

Generate all RGB colors.

allyuv

Generate all yuv colors.

amerge

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

amix

Audio mixing.

amovie

Read audio from a movie source.

anoisesrc

Generate a noise audio signal.

anullsrc

Null audio source, return empty audio frames.

astreamselect

Select audio streams.

avsynctest

Generate an Audio Video Sync Test.

bm3d

Block-Matching 3D denoiser.

buffer

Buffer video frames, and make them accessible to the filterchain.

cellauto

Create pattern generated by an elementary cellular automaton.

color

Provide an uniformly colored input.

color_vulkan

Generate a constant color (Vulkan).

colorchart

Generate color checker chart.

colorspectrum

Generate colors spectrum.

concat

Concatenate audio and video streams.

decimate

Decimate frames (post field matching filter).

fieldmatch

Field matching for inverse telecine.

flite

Synthesize voice from text using libflite.

frei0r_src

Generate a frei0r source.

gradients

Draw a gradients.

guided

Apply Guided filter.

haldclutsrc

Provide an identity Hald CLUT.

headphone

Apply headphone binaural spatialization with HRTFs in additional streams.

hilbert

Generate a Hilbert transform FIR coefficients.

hstack

Stack video inputs horizontally.

hstack_vaapi

"VA-API" hstack.

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.

life

Create life.

limitdiff

Apply filtering with limiting difference.

lv2

Apply LV2 effect.

mandelbrot

Render a Mandelbrot fractal.

mergeplanes

Merge planes.

mix

Mix video inputs.

movie

Read from a movie source.

mptestsrc

Generate various test pattern.

nullsrc

Null video source, return unprocessed video frames.

openclsrc

Generate video using an OpenCL program.

pal100bars

Generate PAL 100% color bars.

pal75bars

Generate PAL 75% color bars.

premultiply

PreMultiply first stream with first plane of second stream.

program_opencl

Filter video using an OpenCL program.

rgbtestsrc

Generate RGB test pattern.

sierpinski

Render a Sierpinski fractal.

signature

Calculate the MPEG-7 video signature.

sinc

Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject FIR coefficients.

sine

Generate sine wave audio signal.

smptebars

Generate SMPTE color bars.

smptehdbars

Generate SMPTE HD color bars.

streamselect

Select video streams.

testsrc

Generate test pattern.

testsrc2

Generate another test pattern.

unpremultiply

UnPreMultiply first stream with first plane of second stream.

vstack

Stack video inputs vertically.

vstack_vaapi

"VA-API" vstack.

xmedian

Pick median pixels from several video inputs.

xstack

Stack video inputs into custom layout.

xstack_vaapi

"VA-API" xstack.

yuvtestsrc

Generate YUV test pattern.

zoneplate

Generate zone-plate.

abuffer

abuffer(
    *,
    time_base: Rational = Default("0/1"),
    sample_rate: Int = Default("0"),
    sample_fmt: Sample_fmt = Default("none"),
    channel_layout: String = Default(None),
    channels: Int = Default("0"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Buffer audio frames, and make them accessible to the filterchain.

Parameters:

Name Type Description Default
time_base Rational

(from 0 to INT_MAX) (default 0/1)

Default('0/1')
sample_rate Int

(from 0 to INT_MAX) (default 0)

Default('0')
sample_fmt Sample_fmt

(default none)

Default('none')
channel_layout String
Default(None)
channels Int

(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 AudioStream

the audio stream

References

FFmpeg Documentation

aevalsrc

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

Generate an audio signal generated by an expression.

Parameters:

Name Type Description Default
exprs String

set the '|'-separated list of channels expressions

Default(None)
nb_samples Int

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

Default('1024')
sample_rate String

set the sample rate (default "44100")

Default('44100')
duration Duration

set audio duration (default -0.000001)

Default('-0.000001')
channel_layout String

set channel layout

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

afdelaysrc

afdelaysrc(
    *,
    delay: Double = Default("0"),
    sample_rate: Int = Default("44100"),
    nb_samples: Int = Default("1024"),
    taps: Int = Default("0"),
    channel_layout: String = Default("stereo"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Generate a Fractional delay FIR coefficients.

Parameters:

Name Type Description Default
delay Double

set fractional delay (from 0 to 32767) (default 0)

Default('0')
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')
taps Int

set number of taps for delay filter (from 0 to 32768) (default 0)

Default('0')
channel_layout String

set channel layout (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

afireqsrc

afireqsrc(
    *,
    preset: (
        Int
        | Literal[
            "custom",
            "flat",
            "acoustic",
            "bass",
            "beats",
            "classic",
            "clear",
            "deep bass",
            "dubstep",
            "electronic",
            "hardstyle",
            "hip-hop",
            "jazz",
            "metal",
            "movie",
            "pop",
            "r&b",
            "rock",
            "vocal booster",
        ]
        | Default
    ) = Default("flat"),
    gains: String = Default(
        "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"
    ),
    bands: String = Default(
        "25 40 63 100 160 250 400 630 1000 1600 2500 4000 6300 10000 16000 24000"
    ),
    taps: Int = Default("4096"),
    sample_rate: Int = Default("44100"),
    nb_samples: Int = Default("1024"),
    interp: (
        Int | Literal["linear", "cubic"] | Default
    ) = Default("linear"),
    phase: (
        Int | Literal["linear", "min"] | Default
    ) = Default("min"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Generate a FIR equalizer coefficients audio stream.

Parameters:

Name Type Description Default
preset Int | Literal['custom', 'flat', 'acoustic', 'bass', 'beats', 'classic', 'clear', 'deep bass', 'dubstep', 'electronic', 'hardstyle', 'hip-hop', 'jazz', 'metal', 'movie', 'pop', 'r&b', 'rock', 'vocal booster'] | Default

set equalizer preset (from -1 to 17) (default flat)

Default('flat')
gains String

set gain values per band (default "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0")

Default('0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0')
bands String

set central frequency values per band (default "25 40 63 100 160 250 400 630 1000 1600 2500 4000 6300 10000 16000 24000")

Default('25 40 63 100 160 250 400 630 1000 1600 2500 4000 6300 10000 16000 24000')
taps Int

set number of taps (from 16 to 65535) (default 4096)

Default('4096')
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')
interp Int | Literal['linear', 'cubic'] | Default

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

Default('linear')
phase Int | Literal['linear', 'min'] | Default

set the phase (from 0 to 1) (default min)

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

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

afirsrc

afirsrc(
    *,
    taps: Int = Default("1025"),
    frequency: String = Default("0 1"),
    magnitude: String = Default("1 1"),
    phase: String = Default("0 0"),
    sample_rate: Int = Default("44100"),
    nb_samples: Int = Default("1024"),
    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("blackman"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Generate a FIR coefficients audio stream.

Parameters:

Name Type Description Default
taps Int

set number of taps (from 9 to 65535) (default 1025)

Default('1025')
frequency String

set frequency points (default "0 1")

Default('0 1')
magnitude String

set magnitude values (default "1 1")

Default('1 1')
phase String

set phase values (default "0 0")

Default('0 0')
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')
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 blackman)

Default('blackman')
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

allrgb

allrgb(
    *,
    rate: Video_rate = Default("25"),
    duration: Duration = Default("-0.000001"),
    sar: Rational = Default("1/1"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate all RGB colors.

Parameters:

Name Type Description Default
rate Video_rate

set video rate (default "25")

Default('25')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
sar Rational

set video sample aspect ratio (from 0 to INT_MAX) (default 1/1)

Default('1/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

allyuv

allyuv(
    *,
    rate: Video_rate = Default("25"),
    duration: Duration = Default("-0.000001"),
    sar: Rational = Default("1/1"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate all yuv colors.

Parameters:

Name Type Description Default
rate Video_rate

set video rate (default "25")

Default('25')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
sar Rational

set video sample aspect ratio (from 0 to INT_MAX) (default 1/1)

Default('1/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

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

amovie

amovie(
    *,
    filename: String = Default(None),
    format_name: String = Default(None),
    stream_index: Int = Default("-1"),
    seek_point: Double = Default("0"),
    streams: String = Default(None),
    loop: Int = Default("1"),
    discontinuity: Duration = Default("0"),
    dec_threads: Int = Default("0"),
    format_opts: Dictionary = Default(None),
    extra_options: dict[str, Any] | None = None
) -> FilterNode

Read audio from a movie source.

Parameters:

Name Type Description Default
filename String
Default(None)
format_name String

set format name

Default(None)
stream_index Int

set stream index (from -1 to INT_MAX) (default -1)

Default('-1')
seek_point Double

set seekpoint (seconds) (from 0 to 9.22337e+12) (default 0)

Default('0')
streams String

set streams

Default(None)
loop Int

set loop count (from 0 to INT_MAX) (default 1)

Default('1')
discontinuity Duration

set discontinuity threshold (default 0)

Default('0')
dec_threads Int

set the number of threads for decoding (from 0 to INT_MAX) (default 0)

Default('0')
format_opts Dictionary

set format options for the opened file

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

anoisesrc

anoisesrc(
    *,
    sample_rate: Int = Default("48000"),
    amplitude: Double = Default("1"),
    duration: Duration = Default("0"),
    color: (
        Int
        | Literal[
            "white",
            "pink",
            "brown",
            "blue",
            "violet",
            "velvet",
        ]
        | Default
    ) = Default("white"),
    seed: Int64 = Default("-1"),
    nb_samples: Int = Default("1024"),
    density: Double = Default("0.05"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Generate a noise audio signal.

Parameters:

Name Type Description Default
sample_rate Int

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

Default('48000')
amplitude Double

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

Default('1')
duration Duration

set duration (default 0)

Default('0')
color Int | Literal['white', 'pink', 'brown', 'blue', 'violet', 'velvet'] | Default

set noise color (from 0 to 5) (default white)

Default('white')
seed Int64

set random seed (from -1 to UINT32_MAX) (default -1)

Default('-1')
nb_samples Int

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

Default('1024')
density Double

set density (from 0 to 1) (default 0.05)

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

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

anullsrc

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

Null audio source, return empty audio frames.

Parameters:

Name Type Description Default
channel_layout String

set channel_layout (default "stereo")

Default('stereo')
sample_rate String

set sample rate (default "44100")

Default('44100')
nb_samples Int

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

Default('1024')
duration Duration

set the 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

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

avsynctest

avsynctest(
    *,
    size: Image_size = Default("hd720"),
    framerate: Video_rate = Default("30"),
    samplerate: Int = Default("44100"),
    amplitude: Float = Default("0.7"),
    period: Int = Default("3"),
    delay: Int = Default("0"),
    cycle: Boolean = Default("false"),
    duration: Duration = Default("0"),
    fg: Color = Default("white"),
    bg: Color = Default("black"),
    ag: Color = Default("gray"),
    extra_options: dict[str, Any] | None = None
) -> tuple[AudioStream, VideoStream]

Generate an Audio Video Sync Test.

Parameters:

Name Type Description Default
size Image_size

set frame size (default "hd720")

Default('hd720')
framerate Video_rate

set frame rate (default "30")

Default('30')
samplerate Int

set sample rate (from 8000 to 384000) (default 44100)

Default('44100')
amplitude Float

set beep amplitude (from 0 to 1) (default 0.7)

Default('0.7')
period Int

set beep period (from 1 to 99) (default 3)

Default('3')
delay Int

set flash delay (from -30 to 30) (default 0)

Default('0')
cycle Boolean

set delay cycle (default false)

Default('false')
duration Duration

set duration (default 0)

Default('0')
fg Color

set foreground color (default "white")

Default('white')
bg Color

set background color (default "black")

Default('black')
ag Color

set additional color (default "gray")

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

Extra options for the filter

None

Returns:

Name Type Description
audio AudioStream

the audio stream

video 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

buffer

buffer(
    *,
    width: Int = Default("0"),
    video_size: Image_size = Default(None),
    height: Int = Default("0"),
    pix_fmt: Pix_fmt = Default("none"),
    sar: Rational = Default("0/1"),
    time_base: Rational = Default("0/1"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Buffer video frames, and make them accessible to the filterchain.

Parameters:

Name Type Description Default
width Int

(from 0 to INT_MAX) (default 0)

Default('0')
video_size Image_size
Default(None)
height Int

(from 0 to INT_MAX) (default 0)

Default('0')
pix_fmt Pix_fmt

(default none)

Default('none')
sar Rational

sample aspect ratio (from 0 to DBL_MAX) (default 0/1)

Default('0/1')
time_base Rational

(from 0 to DBL_MAX) (default 0/1)

Default('0/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

cellauto

cellauto(
    *,
    filename: String = Default(None),
    pattern: String = Default(None),
    rate: Video_rate = Default("25"),
    size: Image_size = Default(None),
    rule: Int = Default("110"),
    random_fill_ratio: Double = Default("0.618034"),
    random_seed: Int64 = Default("-1"),
    scroll: Boolean = Default("true"),
    start_full: Boolean = Default("false"),
    full: Boolean = Default("true"),
    stitch: Boolean = Default("true"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Create pattern generated by an elementary cellular automaton.

Parameters:

Name Type Description Default
filename String

read initial pattern from file

Default(None)
pattern String

set initial pattern

Default(None)
rate Video_rate

set video rate (default "25")

Default('25')
size Image_size

set video size

Default(None)
rule Int

set rule (from 0 to 255) (default 110)

Default('110')
random_fill_ratio Double

set fill ratio for filling initial grid randomly (from 0 to 1) (default 0.618034)

Default('0.618034')
random_seed Int64

set the seed for filling the initial grid randomly (from -1 to UINT32_MAX) (default -1)

Default('-1')
scroll Boolean

scroll pattern downward (default true)

Default('true')
start_full Boolean

start filling the whole video (default false)

Default('false')
full Boolean

start filling the whole video (default true)

Default('true')
stitch Boolean

stitch boundaries (default true)

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

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

color

color(
    *,
    color: Color = Default("black"),
    size: Image_size = Default("320x240"),
    rate: Video_rate = Default("25"),
    duration: Duration = Default("-0.000001"),
    sar: Rational = Default("1/1"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Provide an uniformly colored input.

Parameters:

Name Type Description Default
color Color

set color (default "black")

Default('black')
size Image_size

set video size (default "320x240")

Default('320x240')
rate Video_rate

set video rate (default "25")

Default('25')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
sar Rational

set video sample aspect ratio (from 0 to INT_MAX) (default 1/1)

Default('1/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

color_vulkan

color_vulkan(
    *,
    color: Color = Default("black"),
    size: Image_size = Default("1920x1080"),
    rate: Video_rate = Default("60"),
    duration: Duration = Default("-0.000001"),
    sar: Rational = Default("1/1"),
    format: String = Default(None),
    out_range: (
        Int
        | Literal[
            "full", "limited", "jpeg", "mpeg", "tv", "pc"
        ]
        | Default
    ) = Default("0) (from 0 to 2) (default 0"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate a constant color (Vulkan).

Parameters:

Name Type Description Default
color Color

set color (default "black")

Default('black')
size Image_size

set video size (default "1920x1080")

Default('1920x1080')
rate Video_rate

set video rate (default "60")

Default('60')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
sar Rational

set video sample aspect ratio (from 0 to INT_MAX) (default 1/1)

Default('1/1')
format String

Output video format (software format of hardware frames)

Default(None)
out_range Int | Literal['full', 'limited', 'jpeg', 'mpeg', 'tv', 'pc'] | Default

Output colour range (from 0 to 2) (default 0) (from 0 to 2) (default 0)

Default('0) (from 0 to 2) (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

colorchart

colorchart(
    *,
    rate: Video_rate = Default("25"),
    duration: Duration = Default("-0.000001"),
    sar: Rational = Default("1/1"),
    patch_size: Image_size = Default("64x64"),
    preset: (
        Int | Literal["reference", "skintones"] | Default
    ) = Default("reference"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate color checker chart.

Parameters:

Name Type Description Default
rate Video_rate

set video rate (default "25")

Default('25')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
sar Rational

set video sample aspect ratio (from 0 to INT_MAX) (default 1/1)

Default('1/1')
patch_size Image_size

set the single patch size (default "64x64")

Default('64x64')
preset Int | Literal['reference', 'skintones'] | Default

set the color checker chart preset (from 0 to 1) (default reference)

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

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

colorspectrum

colorspectrum(
    *,
    size: Image_size = Default("320x240"),
    rate: Video_rate = Default("25"),
    duration: Duration = Default("-0.000001"),
    sar: Rational = Default("1/1"),
    type: (
        Int | Literal["black", "white", "all"] | Default
    ) = Default("black"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate colors spectrum.

Parameters:

Name Type Description Default
size Image_size

set video size (default "320x240")

Default('320x240')
rate Video_rate

set video rate (default "25")

Default('25')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
sar Rational

set video sample aspect ratio (from 0 to INT_MAX) (default 1/1)

Default('1/1')
type Int | Literal['black', 'white', 'all'] | Default

set the color spectrum type (from 0 to 2) (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

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

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

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

flite

flite(
    *,
    list_voices: Boolean = Default("false"),
    nb_samples: Int = Default("512"),
    text: String = Default(None),
    textfile: String = Default(None),
    v: String = Default("kal"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Synthesize voice from text using libflite.

Parameters:

Name Type Description Default
list_voices Boolean

list voices and exit (default false)

Default('false')
nb_samples Int

set number of samples per frame (from 0 to INT_MAX) (default 512)

Default('512')
text String

set text to speak

Default(None)
textfile String

set filename of the text to speak

Default(None)
v String

set voice (default "kal")

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

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

frei0r_src

frei0r_src(
    *,
    size: Image_size = Default("320x240"),
    framerate: Video_rate = Default("25"),
    filter_name: String = Default(None),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate a frei0r source.

Parameters:

Name Type Description Default
size Image_size

Dimensions of the generated video. (default "320x240")

Default('320x240')
framerate Video_rate

(default "25")

Default('25')
filter_name String
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

gradients

gradients(
    *,
    size: Image_size = Default("640x480"),
    rate: Video_rate = Default("25"),
    c0: Color = Default("random"),
    c1: Color = Default("random"),
    c2: Color = Default("random"),
    c3: Color = Default("random"),
    c4: Color = Default("random"),
    c5: Color = Default("random"),
    c6: Color = Default("random"),
    c7: Color = Default("random"),
    x0: Int = Default("-1"),
    y0: Int = Default("-1"),
    x1: Int = Default("-1"),
    y1: Int = Default("-1"),
    nb_colors: Int = Default("2"),
    seed: Int64 = Default("-1"),
    duration: Duration = Default("-0.000001"),
    speed: Float = Default("0.01"),
    type: (
        Int
        | Literal["linear", "radial", "circular", "spiral"]
        | Default
    ) = Default("linear"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Draw a gradients.

Parameters:

Name Type Description Default
size Image_size

set frame size (default "640x480")

Default('640x480')
rate Video_rate

set frame rate (default "25")

Default('25')
c0 Color

set 1st color (default "random")

Default('random')
c1 Color

set 2nd color (default "random")

Default('random')
c2 Color

set 3rd color (default "random")

Default('random')
c3 Color

set 4th color (default "random")

Default('random')
c4 Color

set 5th color (default "random")

Default('random')
c5 Color

set 6th color (default "random")

Default('random')
c6 Color

set 7th color (default "random")

Default('random')
c7 Color

set 8th color (default "random")

Default('random')
x0 Int

set gradient line source x0 (from -1 to INT_MAX) (default -1)

Default('-1')
y0 Int

set gradient line source y0 (from -1 to INT_MAX) (default -1)

Default('-1')
x1 Int

set gradient line destination x1 (from -1 to INT_MAX) (default -1)

Default('-1')
y1 Int

set gradient line destination y1 (from -1 to INT_MAX) (default -1)

Default('-1')
nb_colors Int

set the number of colors (from 2 to 8) (default 2)

Default('2')
seed Int64

set the seed (from -1 to UINT32_MAX) (default -1)

Default('-1')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
speed Float

set gradients rotation speed (from 1e-05 to 1) (default 0.01)

Default('0.01')
type Int | Literal['linear', 'radial', 'circular', 'spiral'] | Default

set gradient type (from 0 to 3) (default linear)

Default('linear')
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

haldclutsrc

haldclutsrc(
    *,
    level: Int = Default("6"),
    rate: Video_rate = Default("25"),
    duration: Duration = Default("-0.000001"),
    sar: Rational = Default("1/1"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Provide an identity Hald CLUT.

Parameters:

Name Type Description Default
level Int

set level (from 2 to 16) (default 6)

Default('6')
rate Video_rate

set video rate (default "25")

Default('25')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
sar Rational

set video sample aspect ratio (from 0 to INT_MAX) (default 1/1)

Default('1/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

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

hilbert

hilbert(
    *,
    sample_rate: Int = Default("44100"),
    taps: Int = Default("22051"),
    nb_samples: Int = Default("1024"),
    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("blackman"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Generate a Hilbert transform FIR coefficients.

Parameters:

Name Type Description Default
sample_rate Int

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

Default('44100')
taps Int

set number of taps (from 11 to 65535) (default 22051)

Default('22051')
nb_samples Int

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

Default('1024')
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 blackman)

Default('blackman')
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

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

life

life(
    *,
    filename: String = Default(None),
    size: Image_size = Default(None),
    rate: Video_rate = Default("25"),
    rule: String = Default("B3/S23"),
    random_fill_ratio: Double = Default("0.618034"),
    random_seed: Int64 = Default("-1"),
    stitch: Boolean = Default("true"),
    mold: Int = Default("0"),
    life_color: Color = Default("white"),
    death_color: Color = Default("black"),
    mold_color: Color = Default("black"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Create life.

Parameters:

Name Type Description Default
filename String

set source file

Default(None)
size Image_size

set video size

Default(None)
rate Video_rate

set video rate (default "25")

Default('25')
rule String

set rule (default "B3/S23")

Default('B3/S23')
random_fill_ratio Double

set fill ratio for filling initial grid randomly (from 0 to 1) (default 0.618034)

Default('0.618034')
random_seed Int64

set the seed for filling the initial grid randomly (from -1 to UINT32_MAX) (default -1)

Default('-1')
stitch Boolean

stitch boundaries (default true)

Default('true')
mold Int

set mold speed for dead cells (from 0 to 255) (default 0)

Default('0')
life_color Color

set life color (default "white")

Default('white')
death_color Color

set death color (default "black")

Default('black')
mold_color Color

set mold color (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

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

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

mandelbrot

mandelbrot(
    *,
    size: Image_size = Default("640x480"),
    rate: Video_rate = Default("25"),
    maxiter: Int = Default("7189"),
    start_x: Double = Default("-0.743644"),
    start_y: Double = Default("-0.131826"),
    start_scale: Double = Default("3"),
    end_scale: Double = Default("0.3"),
    end_pts: Double = Default("400"),
    bailout: Double = Default("10"),
    morphxf: Double = Default("0.01"),
    morphyf: Double = Default("0.0123"),
    morphamp: Double = Default("0"),
    outer: (
        Int
        | Literal[
            "iteration_count",
            "normalized_iteration_count",
            "white",
            "outz",
        ]
        | Default
    ) = Default("normalized_iteration_count"),
    inner: (
        Int
        | Literal[
            "black", "period", "convergence", "mincol"
        ]
        | Default
    ) = Default("mincol"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Render a Mandelbrot fractal.

Parameters:

Name Type Description Default
size Image_size

set frame size (default "640x480")

Default('640x480')
rate Video_rate

set frame rate (default "25")

Default('25')
maxiter Int

set max iterations number (from 1 to INT_MAX) (default 7189)

Default('7189')
start_x Double

set the initial x position (from -100 to 100) (default -0.743644)

Default('-0.743644')
start_y Double

set the initial y position (from -100 to 100) (default -0.131826)

Default('-0.131826')
start_scale Double

set the initial scale value (from 0 to FLT_MAX) (default 3)

Default('3')
end_scale Double

set the terminal scale value (from 0 to FLT_MAX) (default 0.3)

Default('0.3')
end_pts Double

set the terminal pts value (from 0 to I64_MAX) (default 400)

Default('400')
bailout Double

set the bailout value (from 0 to FLT_MAX) (default 10)

Default('10')
morphxf Double

set morph x frequency (from -FLT_MAX to FLT_MAX) (default 0.01)

Default('0.01')
morphyf Double

set morph y frequency (from -FLT_MAX to FLT_MAX) (default 0.0123)

Default('0.0123')
morphamp Double

set morph amplitude (from -FLT_MAX to FLT_MAX) (default 0)

Default('0')
outer Int | Literal['iteration_count', 'normalized_iteration_count', 'white', 'outz'] | Default

set outer coloring mode (from 0 to INT_MAX) (default normalized_iteration_count)

Default('normalized_iteration_count')
inner Int | Literal['black', 'period', 'convergence', 'mincol'] | Default

set inner coloring mode (from 0 to INT_MAX) (default mincol)

Default('mincol')
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

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

movie

movie(
    *,
    filename: String = Default(None),
    format_name: String = Default(None),
    stream_index: Int = Default("-1"),
    seek_point: Double = Default("0"),
    streams: String = Default(None),
    loop: Int = Default("1"),
    discontinuity: Duration = Default("0"),
    dec_threads: Int = Default("0"),
    format_opts: Dictionary = Default(None),
    extra_options: dict[str, Any] | None = None
) -> FilterNode

Read from a movie source.

Parameters:

Name Type Description Default
filename String
Default(None)
format_name String

set format name

Default(None)
stream_index Int

set stream index (from -1 to INT_MAX) (default -1)

Default('-1')
seek_point Double

set seekpoint (seconds) (from 0 to 9.22337e+12) (default 0)

Default('0')
streams String

set streams

Default(None)
loop Int

set loop count (from 0 to INT_MAX) (default 1)

Default('1')
discontinuity Duration

set discontinuity threshold (default 0)

Default('0')
dec_threads Int

set the number of threads for decoding (from 0 to INT_MAX) (default 0)

Default('0')
format_opts Dictionary

set format options for the opened file

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

mptestsrc

mptestsrc(
    *,
    rate: Video_rate = Default("25"),
    duration: Duration = Default("-0.000001"),
    test: (
        Int
        | Literal[
            "dc_luma",
            "dc_chroma",
            "freq_luma",
            "freq_chroma",
            "amp_luma",
            "amp_chroma",
            "cbp",
            "mv",
            "ring1",
            "ring2",
            "all",
        ]
        | Default
    ) = Default("all"),
    max_frames: Int64 = Default("30"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate various test pattern.

Parameters:

Name Type Description Default
rate Video_rate

set video rate (default "25")

Default('25')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
test Int | Literal['dc_luma', 'dc_chroma', 'freq_luma', 'freq_chroma', 'amp_luma', 'amp_chroma', 'cbp', 'mv', 'ring1', 'ring2', 'all'] | Default

set test to perform (from 0 to INT_MAX) (default all)

Default('all')
max_frames Int64

Set the maximum number of frames generated for each test (from 1 to I64_MAX) (default 30)

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

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

nullsrc

nullsrc(
    *,
    size: Image_size = Default("320x240"),
    rate: Video_rate = Default("25"),
    duration: Duration = Default("-0.000001"),
    sar: Rational = Default("1/1"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Null video source, return unprocessed video frames.

Parameters:

Name Type Description Default
size Image_size

set video size (default "320x240")

Default('320x240')
rate Video_rate

set video rate (default "25")

Default('25')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
sar Rational

set video sample aspect ratio (from 0 to INT_MAX) (default 1/1)

Default('1/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

openclsrc

openclsrc(
    *,
    source: String = Default(None),
    kernel: String = Default(None),
    size: Image_size = Default(None),
    format: Pix_fmt = Default("none"),
    rate: Video_rate = Default("25"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate 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)
size Image_size

Video size

Default(None)
format Pix_fmt

Video format (default none)

Default('none')
rate Video_rate

Video frame rate (default "25")

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

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video stream

References

FFmpeg Documentation

pal100bars

pal100bars(
    *,
    size: Image_size = Default("320x240"),
    rate: Video_rate = Default("25"),
    duration: Duration = Default("-0.000001"),
    sar: Rational = Default("1/1"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate PAL 100% color bars.

Parameters:

Name Type Description Default
size Image_size

set video size (default "320x240")

Default('320x240')
rate Video_rate

set video rate (default "25")

Default('25')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
sar Rational

set video sample aspect ratio (from 0 to INT_MAX) (default 1/1)

Default('1/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

pal75bars

pal75bars(
    *,
    size: Image_size = Default("320x240"),
    rate: Video_rate = Default("25"),
    duration: Duration = Default("-0.000001"),
    sar: Rational = Default("1/1"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate PAL 75% color bars.

Parameters:

Name Type Description Default
size Image_size

set video size (default "320x240")

Default('320x240')
rate Video_rate

set video rate (default "25")

Default('25')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
sar Rational

set video sample aspect ratio (from 0 to INT_MAX) (default 1/1)

Default('1/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

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

rgbtestsrc

rgbtestsrc(
    *,
    size: Image_size = Default("320x240"),
    rate: Video_rate = Default("25"),
    duration: Duration = Default("-0.000001"),
    sar: Rational = Default("1/1"),
    complement: Boolean = Default("false"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate RGB test pattern.

Parameters:

Name Type Description Default
size Image_size

set video size (default "320x240")

Default('320x240')
rate Video_rate

set video rate (default "25")

Default('25')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
sar Rational

set video sample aspect ratio (from 0 to INT_MAX) (default 1/1)

Default('1/1')
complement Boolean

set complement colors (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

sierpinski

sierpinski(
    *,
    size: Image_size = Default("640x480"),
    rate: Video_rate = Default("25"),
    seed: Int64 = Default("-1"),
    jump: Int = Default("100"),
    type: (
        Int | Literal["carpet", "triangle"] | Default
    ) = Default("carpet"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Render a Sierpinski fractal.

Parameters:

Name Type Description Default
size Image_size

set frame size (default "640x480")

Default('640x480')
rate Video_rate

set frame rate (default "25")

Default('25')
seed Int64

set the seed (from -1 to UINT32_MAX) (default -1)

Default('-1')
jump Int

set the jump (from 1 to 10000) (default 100)

Default('100')
type Int | Literal['carpet', 'triangle'] | Default

set fractal type (from 0 to 1) (default carpet)

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

Extra options for the filter

None

Returns:

Name Type Description
default VideoStream

the video 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

sinc

sinc(
    *,
    sample_rate: Int = Default("44100"),
    nb_samples: Int = Default("1024"),
    hp: Float = Default("0"),
    lp: Float = Default("0"),
    phase: Float = Default("50"),
    beta: Float = Default("-1"),
    att: Float = Default("120"),
    round: Boolean = Default("false"),
    hptaps: Int = Default("0"),
    lptaps: Int = Default("0"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject FIR coefficients.

Parameters:

Name Type Description Default
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')
hp Float

set high-pass filter frequency (from 0 to INT_MAX) (default 0)

Default('0')
lp Float

set low-pass filter frequency (from 0 to INT_MAX) (default 0)

Default('0')
phase Float

set filter phase response (from 0 to 100) (default 50)

Default('50')
beta Float

set kaiser window beta (from -1 to 256) (default -1)

Default('-1')
att Float

set stop-band attenuation (from 40 to 180) (default 120)

Default('120')
round Boolean

enable rounding (default false)

Default('false')
hptaps Int

set number of taps for high-pass filter (from 0 to 32768) (default 0)

Default('0')
lptaps Int

set number of taps for low-pass filter (from 0 to 32768) (default 0)

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

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

sine

sine(
    *,
    frequency: Double = Default("440"),
    beep_factor: Double = Default("0"),
    sample_rate: Int = Default("44100"),
    duration: Duration = Default("0"),
    samples_per_frame: String = Default("1024"),
    extra_options: dict[str, Any] | None = None
) -> AudioStream

Generate sine wave audio signal.

Parameters:

Name Type Description Default
frequency Double

set the sine frequency (from 0 to DBL_MAX) (default 440)

Default('440')
beep_factor Double

set the beep frequency factor (from 0 to DBL_MAX) (default 0)

Default('0')
sample_rate Int

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

Default('44100')
duration Duration

set the audio duration (default 0)

Default('0')
samples_per_frame String

set the number of samples per frame (default "1024")

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

Extra options for the filter

None

Returns:

Name Type Description
default AudioStream

the audio stream

References

FFmpeg Documentation

smptebars

smptebars(
    *,
    size: Image_size = Default("320x240"),
    rate: Video_rate = Default("25"),
    duration: Duration = Default("-0.000001"),
    sar: Rational = Default("1/1"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate SMPTE color bars.

Parameters:

Name Type Description Default
size Image_size

set video size (default "320x240")

Default('320x240')
rate Video_rate

set video rate (default "25")

Default('25')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
sar Rational

set video sample aspect ratio (from 0 to INT_MAX) (default 1/1)

Default('1/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

smptehdbars

smptehdbars(
    *,
    size: Image_size = Default("320x240"),
    rate: Video_rate = Default("25"),
    duration: Duration = Default("-0.000001"),
    sar: Rational = Default("1/1"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate SMPTE HD color bars.

Parameters:

Name Type Description Default
size Image_size

set video size (default "320x240")

Default('320x240')
rate Video_rate

set video rate (default "25")

Default('25')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
sar Rational

set video sample aspect ratio (from 0 to INT_MAX) (default 1/1)

Default('1/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

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

testsrc

testsrc(
    *,
    size: Image_size = Default("320x240"),
    rate: Video_rate = Default("25"),
    duration: Duration = Default("-0.000001"),
    sar: Rational = Default("1/1"),
    decimals: Int = Default("0"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate test pattern.

Parameters:

Name Type Description Default
size Image_size

set video size (default "320x240")

Default('320x240')
rate Video_rate

set video rate (default "25")

Default('25')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
sar Rational

set video sample aspect ratio (from 0 to INT_MAX) (default 1/1)

Default('1/1')
decimals Int

set number of decimals to show (from 0 to 17) (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

testsrc2

testsrc2(
    *,
    size: Image_size = Default("320x240"),
    rate: Video_rate = Default("25"),
    duration: Duration = Default("-0.000001"),
    sar: Rational = Default("1/1"),
    alpha: Int = Default("255"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate another test pattern.

Parameters:

Name Type Description Default
size Image_size

set video size (default "320x240")

Default('320x240')
rate Video_rate

set video rate (default "25")

Default('25')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
sar Rational

set video sample aspect ratio (from 0 to INT_MAX) (default 1/1)

Default('1/1')
alpha Int

set global alpha (opacity) (from 0 to 255) (default 255)

Default('255')
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

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

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

yuvtestsrc

yuvtestsrc(
    *,
    size: Image_size = Default("320x240"),
    rate: Video_rate = Default("25"),
    duration: Duration = Default("-0.000001"),
    sar: Rational = Default("1/1"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate YUV test pattern.

Parameters:

Name Type Description Default
size Image_size

set video size (default "320x240")

Default('320x240')
rate Video_rate

set video rate (default "25")

Default('25')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
sar Rational

set video sample aspect ratio (from 0 to INT_MAX) (default 1/1)

Default('1/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

zoneplate

zoneplate(
    *,
    size: Image_size = Default("320x240"),
    rate: Video_rate = Default("25"),
    duration: Duration = Default("-0.000001"),
    sar: Rational = Default("1/1"),
    precision: Int = Default("10"),
    xo: Int = Default("0"),
    yo: Int = Default("0"),
    to: Int = Default("0"),
    k0: Int = Default("0"),
    kx: Int = Default("0"),
    ky: Int = Default("0"),
    kt: Int = Default("0"),
    kxt: Int = Default("0"),
    kyt: Int = Default("0"),
    kxy: Int = Default("0"),
    kx2: Int = Default("0"),
    ky2: Int = Default("0"),
    kt2: Int = Default("0"),
    ku: Int = Default("0"),
    kv: Int = Default("0"),
    extra_options: dict[str, Any] | None = None
) -> VideoStream

Generate zone-plate.

Parameters:

Name Type Description Default
size Image_size

set video size (default "320x240")

Default('320x240')
rate Video_rate

set video rate (default "25")

Default('25')
duration Duration

set video duration (default -0.000001)

Default('-0.000001')
sar Rational

set video sample aspect ratio (from 0 to INT_MAX) (default 1/1)

Default('1/1')
precision Int

set LUT precision (from 4 to 16) (default 10)

Default('10')
xo Int

set X-axis offset (from INT_MIN to INT_MAX) (default 0)

Default('0')
yo Int

set Y-axis offset (from INT_MIN to INT_MAX) (default 0)

Default('0')
to Int

set T-axis offset (from INT_MIN to INT_MAX) (default 0)

Default('0')
k0 Int

set 0-order phase (from INT_MIN to INT_MAX) (default 0)

Default('0')
kx Int

set 1-order X-axis phase (from INT_MIN to INT_MAX) (default 0)

Default('0')
ky Int

set 1-order Y-axis phase (from INT_MIN to INT_MAX) (default 0)

Default('0')
kt Int

set 1-order T-axis phase (from INT_MIN to INT_MAX) (default 0)

Default('0')
kxt Int

set X-axis*T-axis product phase (from INT_MIN to INT_MAX) (default 0)

Default('0')
kyt Int

set Y-axis*T-axis product phase (from INT_MIN to INT_MAX) (default 0)

Default('0')
kxy Int

set X-axis*Y-axis product phase (from INT_MIN to INT_MAX) (default 0)

Default('0')
kx2 Int

set 2-order X-axis phase (from INT_MIN to INT_MAX) (default 0)

Default('0')
ky2 Int

set 2-order Y-axis phase (from INT_MIN to INT_MAX) (default 0)

Default('0')
kt2 Int

set 2-order T-axis phase (from INT_MIN to INT_MAX) (default 0)

Default('0')
ku Int

set 0-order U-color phase (from INT_MIN to INT_MAX) (default 0)

Default('0')
kv Int

set 0-order V-color phase (from INT_MIN 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