av
¶
Audio-video stream utilities.
Classes:
| Name | Description |
|---|---|
AVStream |
A stream that contains both audio and video. This is for input nodes only. |
AVStream
¶
Bases: AudioStream, VideoStream
A stream that contains both audio and video. This is for input nodes only.
Methods:
| Name | Description |
|---|---|
abench |
Benchmark part of a filtergraph. |
abitscope |
Convert input audio to a video output, displaying the audio bit scope. |
acompressor |
A compressor is mainly used to reduce the dynamic range of a signal. |
acontrast |
Simple audio dynamic range compression/expansion filter. |
acopy |
Copy the input audio source unchanged to the output. This is mainly useful for |
acrossfade |
Apply cross fade from one input audio stream to another input audio stream. |
acrossover |
Split audio stream into several bands. |
acrusher |
Reduce audio bit resolution. |
acue |
Delay audio filtering until a given wallclock timestamp. See the cue |
addroi |
Mark a region of interest in a video frame. |
adeclick |
Remove impulsive noise from input audio. |
adeclip |
Remove clipped samples from input audio. |
adecorrelate |
Apply decorrelation to input audio stream. |
adelay |
Delay one or more audio channels. |
adenorm |
Remedy denormals in audio by adding extremely low-level noise. |
aderivative |
Compute derivative/integral of audio stream. |
adrawgraph |
Draw a graph using input audio metadata. |
adynamicequalizer |
Apply dynamic equalization to input audio stream. |
adynamicsmooth |
Apply dynamic smoothing to input audio stream. |
aecho |
Apply echoing to the input audio. |
aemphasis |
Audio emphasis filter creates or restores material directly taken from LPs or |
aeval |
Modify an audio signal according to the specified expressions. |
aexciter |
An exciter is used to produce high sound that is not present in the |
afade |
Apply fade-in/out effect to input audio. |
afftdn |
Denoise audio samples with FFT. |
afftfilt |
Apply arbitrary expressions to samples in frequency domain. |
afifo |
Buffer input images and send them when they are requested. |
aformat |
Set output format constraints for the input audio. The framework will |
afreqshift |
Apply frequency shift to input audio samples. |
afwtdn |
Reduce broadband noise from input samples using Wavelets. |
agate |
A gate is mainly used to reduce lower parts of a signal. This kind of signal |
agraphmonitor |
See graphmonitor. |
ahistogram |
Convert input audio to a video output, displaying the volume histogram. |
aiir |
Apply an arbitrary Infinite Impulse Response filter. |
aintegral |
Compute derivative/integral of audio stream. |
alatency |
Measure filtering latency. |
alimiter |
The limiter prevents an input signal from rising over a desired threshold. |
allpass |
Apply a two-pole all-pass filter with central frequency (in Hz) |
aloop |
Loop audio samples. |
alphaextract |
Extract the alpha component from the input as a grayscale video. This |
alphamerge |
Add or replace the alpha component of the primary input with the |
ametadata |
Manipulate frame metadata. |
amplify |
Amplify differences between current pixel and pixels of adjacent frames in |
amultiply |
Multiply first audio stream with second audio stream and store result |
anequalizer |
High-order parametric multiband equalizer for each channel. |
anlmdn |
Reduce broadband noise in audio samples using Non-Local Means algorithm. |
anlmf |
Apply Normalized Least-Mean-(Squares|Fourth) algorithm to the first audio stream using the second audio stream. |
anlms |
Apply Normalized Least-Mean-(Squares|Fourth) algorithm to the first audio stream using the second audio stream. |
anull |
Pass the audio source unchanged to the output. |
apad |
Pad the end of an audio stream with silence. |
aperms |
Set read/write permissions for the output frames. |
aphasemeter |
Measures phase of input audio, which is exported as metadata lavfi.aphasemeter.phase, |
aphaser |
Add a phasing effect to the input audio. |
aphaseshift |
Apply phase shift to input audio samples. |
apsyclip |
Apply Psychoacoustic clipper to input audio stream. |
apulsator |
Audio pulsator is something between an autopanner and a tremolo. |
arealtime |
Slow down filtering to match real time approximately. |
aresample |
Resample the input audio to the specified parameters, using the |
areverse |
Reverse an audio clip. |
arnndn |
Reduce noise from speech using Recurrent Neural Networks. |
asdr |
Measure Audio Signal-to-Distortion Ratio. |
asegment |
Split single input stream into multiple streams. |
aselect |
Select frames to pass in output. |
asendcmd |
Send commands to filters in the filtergraph. |
asetnsamples |
Set the number of samples per each output audio frame. |
asetpts |
Change the PTS (presentation timestamp) of the input frames. |
asetrate |
Set the sample rate without altering the PCM data. |
asettb |
Set the timebase to use for the output frames timestamps. |
ashowinfo |
Show a line containing various information for each input audio frame. |
asidedata |
Delete frame side data, or select frames based on it. |
asoftclip |
Apply audio soft clipping. |
aspectralstats |
Display frequency domain statistical information about the audio channels. |
asplit |
Split input into several identical outputs. |
ass |
Same as the subtitles filter, except that it doesn't require libavcodec |
astats |
Display time domain statistical information about the audio channels. |
asubboost |
Boost subwoofer frequencies. |
asubcut |
Cut subwoofer frequencies. |
asupercut |
Cut super frequencies. |
asuperpass |
Apply high order Butterworth band-pass filter. |
asuperstop |
Apply high order Butterworth band-stop filter. |
atadenoise |
Apply an Adaptive Temporal Averaging Denoiser to the video input. |
atempo |
Adjust audio tempo. |
atilt |
Apply spectral tilt filter to audio stream. |
atrim |
Trim the input so that the output contains one continuous subpart of the input. |
audio_stream |
Get the audio stream from the input node with a specified index. |
avectorscope |
Convert input audio to a video output, representing the audio vector |
avgblur |
Apply average blur filter. |
axcorrelate |
Calculate normalized windowed cross-correlation between two input audio streams. |
azmq |
Receive commands sent through a libzmq client, and forward them to |
bandpass |
Apply a two-pole Butterworth band-pass filter with central |
bandreject |
Apply a two-pole Butterworth band-reject filter with central |
bass |
Boost or cut the bass (lower) frequencies of the audio using a two-pole |
bbox |
Compute the bounding box for the non-black pixels in the input frame |
bench |
Benchmark part of a filtergraph. |
bilateral |
Apply bilateral filter, spatial smoothing while preserving edges. |
biquad |
Apply a biquad IIR filter with the given coefficients. |
bitplanenoise |
Show and measure bit plane noise. |
blackdetect |
Detect video intervals that are (almost) completely black. Can be |
blackframe |
Detect frames that are (almost) completely black. Can be useful to |
blend |
Blend two video frames into each other. |
blockdetect |
Determines blockiness of frames without altering the input frames. |
blurdetect |
Determines blurriness of frames without altering the input frames. |
boxblur |
Apply a boxblur algorithm to the input video. |
bwdif |
Deinterlace the input video ("bwdif" stands for "Bob Weaver |
cas |
Apply Contrast Adaptive Sharpen filter to video stream. |
channelmap |
Remap input channels to new locations. |
channelsplit |
Split each channel from an input audio stream into a separate output stream. |
chorus |
Add a chorus effect to the audio. |
chromahold |
Remove all color information for all colors except for certain one. |
chromakey |
YUV colorspace color/chroma keying. |
chromanr |
Reduce chrominance noise. |
chromashift |
Shift chroma pixels horizontally and/or vertically. |
ciescope |
Display CIE color diagram with pixels overlaid onto it. |
codecview |
Visualize information exported by some codecs. |
colorbalance |
Modify intensity of primary colors (red, green and blue) of input frames. |
colorchannelmixer |
Adjust video input frames by re-mixing color channels. |
colorcontrast |
Adjust color contrast between RGB components. |
colorcorrect |
Adjust color white balance selectively for blacks and whites. |
colorhold |
Remove all color information for all RGB colors except for certain one. |
colorize |
Overlay a solid color on the video stream. |
colorkey |
RGB colorspace color keying. |
colorlevels |
Adjust video input frames using levels. |
colormap |
Apply custom color maps to video stream. |
colormatrix |
Convert color matrix. |
colorspace |
Convert colorspace, transfer characteristics or color primaries. |
colortemperature |
Adjust color temperature in video to simulate variations in ambient color temperature. |
compand |
Compress or expand the audio's dynamic range. |
compensationdelay |
Compensation Delay Line is a metric based delay to compensate differing |
convolution |
Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements. |
convolve |
Apply 2D convolution of video stream in frequency domain using second stream |
copy |
Copy the input video source unchanged to the output. This is mainly useful for |
cover_rect |
Cover a rectangular object |
crop |
Crop the input video to given dimensions. |
cropdetect |
Auto-detect the crop size. |
crossfeed |
Apply headphone crossfeed filter. |
crystalizer |
Simple algorithm for audio noise sharpening. |
cue |
Delay video filtering until a given wallclock timestamp. The filter first |
curves |
Apply color adjustments using curves. |
datascope |
Video data analysis filter. |
dblur |
Apply Directional blur filter. |
dcshift |
Apply a DC shift to the audio. |
dctdnoiz |
Denoise frames using 2D DCT (frequency domain filtering). |
deband |
Remove banding artifacts from input video. |
deblock |
Remove blocking artifacts from input video. |
deconvolve |
Apply 2D deconvolution of video stream in frequency domain using second stream |
dedot |
Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from video. |
deesser |
Apply de-essing to the audio samples. |
deflate |
Apply deflate effect to the video. |
deflicker |
Remove temporal frame luminance variations. |
dejudder |
Remove judder produced by partially interlaced telecined content. |
delogo |
Suppress a TV station logo by a simple interpolation of the surrounding |
derain |
Remove the rain in the input image/video by applying the derain methods based on |
deshake |
Attempt to fix small changes in horizontal and/or vertical shift. This |
despill |
Remove unwanted contamination of foreground colors, caused by reflected color of |
detelecine |
Apply an exact inverse of the telecine operation. It requires a predefined |
dialoguenhance |
Enhance dialogue in stereo audio. |
dilation |
Apply dilation effect to the video. |
displace |
Displace pixels as indicated by second and third input stream. |
dnn_classify |
Do classification with deep neural networks based on bounding boxes. |
dnn_detect |
Do object detection with deep neural networks. |
dnn_processing |
Do image processing with deep neural networks. It works together with another filter |
doubleweave |
The weave takes a field-based video input and join |
drawbox |
Draw a colored box on the input image. |
drawgraph |
Draw a graph using input video metadata. |
drawgrid |
Draw a grid on the input image. |
drawtext |
Draw a text string or text from a specified file on top of a video, using the |
drmeter |
Measure audio dynamic range. |
dynaudnorm |
Dynamic Audio Normalizer. |
earwax |
Make audio easier to listen to on headphones. |
ebur128 |
EBU R128 scanner filter. This filter takes an audio stream and analyzes its loudness |
edgedetect |
Detect and draw edges. The filter uses the Canny Edge Detection algorithm. |
elbg |
Apply a posterize effect using the ELBG (Enhanced LBG) algorithm. |
entropy |
Measure graylevel entropy in histogram of color channels of video frames. |
epx |
Apply the EPX magnification filter which is designed for pixel art. |
eq |
Set brightness, contrast, saturation and approximate gamma adjustment. |
equalizer |
Apply a two-pole peaking equalisation (EQ) filter. With this |
erosion |
Apply erosion effect to the video. |
estdif |
Deinterlace the input video ("estdif" stands for "Edge Slope |
exposure |
Adjust exposure of the video stream. |
extractplanes |
Extract color channel components from input video stream into |
extrastereo |
Linearly increases the difference between left and right channels which |
fade |
Apply a fade-in/out effect to the input video. |
feedback |
Apply feedback video filter. |
fftdnoiz |
Denoise frames using 3D FFT (frequency domain filtering). |
fftfilt |
Apply arbitrary expressions to samples in frequency domain |
field |
Extract a single field from an interlaced image using stride |
fieldhint |
Create new frames by copying the top and bottom fields from surrounding frames |
fieldorder |
Transform the field order of the input video. |
fifo |
Buffer input images and send them when they are requested. |
fillborders |
Fill borders of the input video, without changing video stream dimensions. |
find_rect |
Find a rectangular object |
firequalizer |
Apply FIR Equalization using arbitrary frequency response. |
flanger |
Apply a flanging effect to the audio. |
floodfill |
Flood area with values of same pixel components with another values. |
format |
Convert the input video to one of the specified pixel formats. |
fps |
Convert the video to specified constant frame rate by duplicating or dropping |
framepack |
Pack two different video streams into a stereoscopic video, setting proper |
framerate |
Change the frame rate by interpolating new video output frames from the source |
framestep |
Select one frame every N-th frame. |
freezedetect |
Detect frozen video. |
freezeframes |
Freeze video frames. |
fspp |
Apply fast and simple postprocessing. It is a faster version of spp. |
gblur |
Apply Gaussian blur filter. |
geq |
Apply generic equation to each pixel. |
gradfun |
Fix the banding artifacts that are sometimes introduced into nearly flat |
graphmonitor |
Show various filtergraph stats. |
grayworld |
A color constancy filter that applies color correction based on the grayworld assumption |
greyedge |
A color constancy variation filter which estimates scene illumination via grey edge algorithm |
haas |
Apply Haas effect to audio. |
haldclut |
Apply a Hald CLUT to a video stream. |
hdcd |
Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with |
hflip |
Flip the input video horizontally. |
highpass |
Apply a high-pass filter with 3dB point frequency. |
highshelf |
Boost or cut treble (upper) frequencies of the audio using a two-pole |
histeq |
This filter applies a global color histogram equalization on a |
histogram |
Compute and draw a color distribution histogram for the input video. |
hqdn3d |
This is a high precision/quality 3d denoise filter. It aims to reduce |
hqx |
Apply a high-quality magnification filter designed for pixel art. This filter |
hsvhold |
Turns a certain HSV range into gray values. |
hsvkey |
Turns a certain HSV range into transparency. |
hue |
Modify the hue and/or the saturation of the input. |
huesaturation |
Apply hue-saturation-intensity adjustments to input video stream. |
hwdownload |
Download hardware frames to system memory. |
hwmap |
Map hardware frames to system memory or to another device. |
hwupload |
Upload system memory frames to hardware surfaces. |
hysteresis |
Grow first stream into second stream by connecting components. |
identity |
Obtain the identity score between two input videos. |
idet |
Detect video interlacing type. |
il |
Deinterleave or interleave fields. |
inflate |
Apply inflate effect to the video. |
interlace |
Simple interlacing filter from progressive contents. This interleaves upper (or |
kerndeint |
Deinterlace input video by applying Donald Graft's adaptive kernel |
kirsch |
Apply kirsch operator to input video stream. |
lagfun |
Slowly update darker pixels. |
latency |
Measure filtering latency. |
lenscorrection |
Correct radial lens distortion |
libvmaf |
Calulate the VMAF (Video Multi-Method Assessment Fusion) score for a |
limiter |
Limits the pixel components values to the specified range [min, max]. |
loop |
Loop video frames. |
loudnorm |
EBU R128 loudness normalization. Includes both dynamic and linear normalization modes. |
lowpass |
Apply a low-pass filter with 3dB point frequency. |
lowshelf |
Boost or cut the bass (lower) frequencies of the audio using a two-pole |
lumakey |
Turn certain luma values into transparency. |
lut |
Compute a look-up table for binding each pixel component input value |
lut1d |
Apply a 1D LUT to an input video. |
lut2 |
The lut2 filter takes two input streams and outputs one |
lut3d |
Apply a 3D LUT to an input video. |
lutrgb |
Compute a look-up table for binding each pixel component input value |
lutyuv |
Compute a look-up table for binding each pixel component input value |
maskedclamp |
Clamp the first input stream with the second input and third input stream. |
maskedmax |
Merge the second and third input stream into output stream using absolute differences |
maskedmerge |
Merge the first input stream with the second input stream using per pixel |
maskedmin |
Merge the second and third input stream into output stream using absolute differences |
maskedthreshold |
Pick pixels comparing absolute difference of two video streams with fixed |
maskfun |
Create mask from input video. |
mcompand |
Multiband Compress or expand the audio's dynamic range. |
median |
Pick median pixel from certain rectangle defined by radius. |
mestimate |
Estimate and export motion vectors using block matching algorithms. |
metadata |
Manipulate frame metadata. |
midequalizer |
Apply Midway Image Equalization effect using two video streams. |
minterpolate |
Convert the video to specified frame rate using motion interpolation. |
monochrome |
Convert video to gray using custom color filter. |
morpho |
This filter allows to apply main morphological grayscale transforms, |
mpdecimate |
Drop frames that do not differ greatly from the previous frame in |
msad |
Obtain the MSAD (Mean Sum of Absolute Differences) between two input videos. |
multiply |
Multiply first video stream pixels values with second video stream pixels values. |
negate |
Negate (invert) the input video. |
nlmeans |
Denoise frames using Non-Local Means algorithm. |
nnedi |
Deinterlace video using neural network edge directed interpolation. |
noformat |
Force libavfilter not to use any of the specified pixel formats for the |
noise |
Add noise on video input frame. |
normalize |
Normalize RGB video (aka histogram stretching, contrast stretching). |
null |
Pass the video source unchanged to the output. |
oscilloscope |
2D Video Oscilloscope. |
overlay |
Overlay one video on top of another. |
owdenoise |
Apply Overcomplete Wavelet denoiser. |
pad |
Add paddings to the input image, and place the original input at the |
palettegen |
Generate one palette for a whole video stream. |
paletteuse |
Use a palette to downsample an input video stream. |
pan |
Mix channels with specific gain levels. The filter accepts the output |
perms |
Set read/write permissions for the output frames. |
perspective |
Correct perspective of video not recorded perpendicular to the screen. |
phase |
Delay interlaced video by one field time so that the field order changes. |
photosensitivity |
Reduce various flashes in video, so to help users with epilepsy. |
pixdesctest |
Pixel format descriptor test filter, mainly useful for internal |
pixelize |
Apply pixelization to video stream. |
pixscope |
Display sample values of color channels. Mainly useful for checking color |
pp |
Enable the specified chain of postprocessing subfilters using libpostproc. This |
pp7 |
Apply Postprocessing filter 7. It is variant of the spp filter, |
prewitt |
Apply prewitt operator to input video stream. |
pseudocolor |
Alter frame colors in video with pseudocolors. |
psnr |
Obtain the average, maximum and minimum PSNR (Peak Signal to Noise |
pullup |
Pulldown reversal (inverse telecine) filter, capable of handling mixed |
qp |
Change video quantization parameters (QP). |
random |
Flush video frames from internal cache of frames into a random order. |
readeia608 |
Read closed captioning (EIA-608) information from the top lines of a video frame. |
readvitc |
Read vertical interval timecode (VITC) information from the top lines of a |
realtime |
Slow down filtering to match real time approximately. |
remap |
Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream. |
removegrain |
The removegrain filter is a spatial denoiser for progressive video. |
removelogo |
Suppress a TV station logo, using an image file to determine which |
repeatfields |
This filter uses the repeat_field flag from the Video ES headers and hard repeats |
replaygain |
ReplayGain scanner filter. This filter takes an audio stream as an input and |
reverse |
Reverse a video clip. |
rgbashift |
Shift R/G/B/A pixels horizontally and/or vertically. |
roberts |
Apply roberts cross operator to input video stream. |
rotate |
Rotate video by an arbitrary angle expressed in radians. |
sab |
Apply Shape Adaptive Blur. |
scale |
Scale (resize) the input video, using the libswscale library. |
scale2ref |
Scale (resize) the input video, based on a reference video. |
scdet |
Detect video scene change. |
scharr |
Apply scharr operator to input video stream. |
scroll |
Scroll input video horizontally and/or vertically by constant speed. |
segment |
Split single input stream into multiple streams. |
select |
Select frames to pass in output. |
selectivecolor |
Adjust cyan, magenta, yellow and black (CMYK) to certain ranges of colors (such |
sendcmd |
Send commands to filters in the filtergraph. |
separatefields |
The separatefields takes a frame-based video input and splits |
setdar |
The setdar filter sets the Display Aspect Ratio for the filter |
setfield |
Force field for the output video frame. |
setparams |
Force frame parameter for the output video frame. |
setpts |
Change the PTS (presentation timestamp) of the input frames. |
setrange |
Force color range for the output video frame. |
setsar |
The setdar filter sets the Display Aspect Ratio for the filter |
settb |
Set the timebase to use for the output frames timestamps. |
shear |
Apply shear transform to input video. |
showcqt |
Convert input audio to a video output representing frequency spectrum |
showfreqs |
Convert input audio to video output representing the audio power spectrum. |
showinfo |
Show a line containing various information for each input video frame. |
showpalette |
Displays the 256 colors palette of each frame. This filter is only relevant for |
showspatial |
Convert stereo input audio to a video output, representing the spatial relationship |
showspectrum |
Convert input audio to a video output, representing the audio frequency |
showspectrumpic |
Convert input audio to a single video frame, representing the audio frequency |
showvolume |
Convert input audio volume to a video output. |
showwaves |
Convert input audio to a video output, representing the samples waves. |
showwavespic |
Convert input audio to a single video frame, representing the samples waves. |
shuffleframes |
Reorder and/or duplicate and/or drop video frames. |
shufflepixels |
Reorder pixels in video frames. |
shuffleplanes |
Reorder and/or duplicate video planes. |
sidechaincompress |
This filter acts like normal compressor but has the ability to compress |
sidechaingate |
A sidechain gate acts like a normal (wideband) gate but has the ability to |
sidedata |
Delete frame side data, or select frames based on it. |
signalstats |
Evaluate various visual metrics that assist in determining issues associated |
silencedetect |
Detect silence in an audio stream. |
silenceremove |
Remove silence from the beginning, middle or end of the audio. |
siti |
Calculate Spatial Info (SI) and Temporal Info (TI) scores for a video, as defined |
smartblur |
Blur the input video without impacting the outlines. |
sobel |
Apply sobel operator to input video stream. |
spectrumsynth |
Synthesize audio from 2 input video spectrums, first input stream represents |
speechnorm |
Speech Normalizer. |
split |
Split input into several identical outputs. |
spp |
Apply a simple postprocessing filter that compresses and decompresses the image |
sr |
Scale the input by applying one of the super-resolution methods based on |
ssim |
Obtain the SSIM (Structural SImilarity Metric) between two input videos. |
stereo3d |
Convert between different stereoscopic image formats. |
stereotools |
This filter has some handy utilities to manage stereo signals, for converting |
stereowiden |
This filter enhance the stereo effect by suppressing signal common to both |
subtitle_stream |
Get the subtitle stream from the input node with a specified index. |
subtitles |
Draw subtitles on top of input video using the libass library. |
super2xsai |
Scale the input by 2x and smooth using the Super2xSaI (Scale and |
superequalizer |
Apply 18 band equalizer. |
surround |
Apply audio surround upmix filter. |
swaprect |
Swap two rectangular objects in video. |
swapuv |
Swap U & V plane. |
tblend |
Blend successive video frames. |
telecine |
Apply telecine process to the video. |
thistogram |
Compute and draw a color distribution histogram for the input video across time. |
threshold |
Apply threshold effect to video stream. |
thumbnail |
Select the most representative frame in a given sequence of consecutive frames. |
tile |
Tile several successive frames together. |
tiltshelf |
Boost or cut the lower frequencies and cut or boost higher frequencies |
tinterlace |
Perform various types of temporal field interlacing. |
tlut2 |
The lut2 filter takes two input streams and outputs one |
tmedian |
Pick median pixels from several successive input video frames. |
tmidequalizer |
Apply Temporal Midway Video Equalization effect. |
tmix |
Mix successive video frames. |
tonemap |
Tone map colors from different dynamic ranges. |
tpad |
Temporarily pad video frames. |
transpose |
Transpose rows with columns in the input video and optionally flip it. |
treble |
Boost or cut treble (upper) frequencies of the audio using a two-pole |
tremolo |
Sinusoidal amplitude modulation. |
trim |
Trim the input so that the output contains one continuous subpart of the input. |
unsharp |
Sharpen or blur the input video. |
untile |
Decompose a video made of tiled images into the individual images. |
v360 |
Convert 360 videos between various formats. |
vaguedenoiser |
Apply a wavelet based denoiser. |
varblur |
Apply variable blur filter by using 2nd video stream to set blur radius. |
vectorscope |
Display 2 color component values in the two dimensional graph (which is called |
vflip |
Flip the input video vertically. |
vfrdet |
Detect variable frame rate video. |
vibrance |
Boost or alter saturation. |
vibrato |
Sinusoidal phase modulation. |
video_stream |
Get the video stream from the input node with a specified index. |
vidstabdetect |
Analyze video stabilization/deshaking. Perform pass 1 of 2, see |
vidstabtransform |
Video stabilization/deshaking: pass 2 of 2, |
vif |
Obtain the average VIF (Visual Information Fidelity) between two input videos. |
vignette |
Make or reverse a natural vignetting effect. |
virtualbass |
Apply audio Virtual Bass filter. |
vmafmotion |
Obtain the average VMAF motion score of a video. |
volume |
Adjust the input audio volume. |
volumedetect |
Detect the volume of the input video. |
w3fdif |
Deinterlace the input video ("w3fdif" stands for "Weston 3 Field |
waveform |
Video waveform monitor. |
weave |
The weave takes a field-based video input and join |
xbr |
Apply the xBR high-quality magnification filter which is designed for pixel |
xcorrelate |
Apply normalized cross-correlation between first and second input video stream. |
xfade |
Apply cross fade from one input video stream to another input video stream. |
yadif |
Deinterlace the input video ("yadif" means "yet another deinterlacing |
yaepblur |
Apply blur filter while preserving edges ("yaepblur" means "yet another edge preserving blur filter"). |
zmq |
Receive commands sent through a libzmq client, and forward them to |
zoompan |
Apply Zoom & Pan effect. |
zscale |
Scale (resize) the input video, using the z.lib library: |
Attributes:
| Name | Type | Description |
|---|---|---|
audio |
AudioStream
|
Get the audio stream from the input node. |
subtitle |
SubtitleStream
|
Get the subtitle stream from the input node. |
video |
VideoStream
|
Get the video stream from the input node. |
audio
property
¶
audio: AudioStream
Get the audio stream from the input node.
Returns:
| Name | Type | Description |
|---|---|---|
AudioStream |
AudioStream
|
The audio stream from the input node. |
subtitle
property
¶
subtitle: SubtitleStream
Get the subtitle stream from the input node.
Returns:
| Name | Type | Description |
|---|---|---|
SubtitleStream |
SubtitleStream
|
The subtitle stream from the input node. |
video
property
¶
video: VideoStream
Get the video stream from the input node.
Returns:
| Name | Type | Description |
|---|---|---|
VideoStream |
VideoStream
|
The video stream from the input node. |
abench
¶
abench(
*,
action: (
Int | Literal["start", "stop"] | Default
) = Default("start"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Benchmark part of a filtergraph.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
Int | Literal['start', 'stop'] | Default
|
Start or stop a timer. Available values are: @end table |
Default('start')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
abitscope
¶
abitscope(
*,
rate: Video_rate = Default("25"),
size: Image_size = Default("1024x256"),
colors: String = Default(
"red|green|blue|yellow|orange|lime|pink|magenta|brown"
),
mode: (
Int | Literal["bars", "trace"] | Default
) = Default("bars"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert input audio to a video output, displaying the audio bit scope.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rate
|
Video_rate
|
Set frame rate, expressed as number of frames per second. Default value is "25". |
Default('25')
|
size
|
Image_size
|
Specify the video size for the output. For the syntax of this option, check the "Video size" section in the ffmpeg-utils manual. Default value is 1024x256. |
Default('1024x256')
|
colors
|
String
|
Specify list of colors separated by space or by '|' which will be used to draw channels. Unrecognized or missing colors will be replaced by white color. |
Default('red|green|blue|yellow|orange|lime|pink|magenta|brown')
|
mode
|
Int | Literal['bars', 'trace'] | Default
|
Set output mode. Can be bars or trace. Default is bars. |
Default('bars')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
acompressor
¶
acompressor(
*,
level_in: Double = Default("1"),
mode: (
Int | Literal["downward", "upward"] | Default
) = Default("downward"),
threshold: Double = Default("0.125"),
ratio: Double = Default("2"),
attack: Double = Default("20"),
release: Double = Default("250"),
makeup: Double = Default("1"),
knee: Double = Default("2.82843"),
link: (
Int | Literal["average", "maximum"] | Default
) = Default("average"),
detection: (
Int | Literal["peak", "rms"] | Default
) = Default("rms"),
level_sc: Double = Default("1"),
mix: Double = Default("1"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
A compressor is mainly used to reduce the dynamic range of a signal. Especially modern music is mostly compressed at a high ratio to improve the overall loudness. It's done to get the highest attention of a listener, "fatten" the sound and bring more "power" to the track. If a signal is compressed too much it may sound dull or "dead" afterwards or it may start to "pump" (which could be a powerful effect but can also destroy a track completely). The right compression is the key to reach a professional sound and is the high art of mixing and mastering. Because of its complex settings it may take a long time to get the right feeling for this kind of effect.
Compression is done by detecting the volume above a chosen level threshold and dividing it by the factor set with ratio. So if you set the threshold to -12dB and your signal reaches -6dB a ratio of 2:1 will result in a signal at -9dB. Because an exact manipulation of the signal would cause distortion of the waveform the reduction can be levelled over the time. This is done by setting "Attack" and "Release". attack determines how long the signal has to rise above the threshold before any reduction will occur and release sets the time the signal has to fall below the threshold to reduce the reduction again. Shorter signals than the chosen attack time will be left untouched. The overall reduction of the signal can be made up afterwards with the makeup setting. So compressing the peaks of a signal about 6dB and raising the makeup to this level results in a signal twice as loud than the source. To gain a softer entry in the compression the knee flattens the hard edge at the threshold in the range of the chosen decibels.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_in
|
Double
|
Set input gain. Default is 1. Range is between 0.015625 and 64. |
Default('1')
|
mode
|
Int | Literal['downward', 'upward'] | Default
|
Set mode of compressor operation. Can be upward or downward. Default is downward. |
Default('downward')
|
threshold
|
Double
|
If a signal of stream rises above this level it will affect the gain reduction. By default it is 0.125. Range is between 0.00097563 and 1. |
Default('0.125')
|
ratio
|
Double
|
Set a ratio by which the signal is reduced. 1:2 means that if the level rose 4dB above the threshold, it will be only 2dB above after the reduction. Default is 2. Range is between 1 and 20. |
Default('2')
|
attack
|
Double
|
Amount of milliseconds the signal has to rise above the threshold before gain reduction starts. Default is 20. Range is between 0.01 and 2000. |
Default('20')
|
release
|
Double
|
Amount of milliseconds the signal has to fall below the threshold before reduction is decreased again. Default is 250. Range is between 0.01 and 9000. |
Default('250')
|
makeup
|
Double
|
Set the amount by how much signal will be amplified after processing. Default is 1. Range is from 1 to 64. |
Default('1')
|
knee
|
Double
|
Curve the sharp knee around the threshold to enter gain reduction more softly. Default is 2.82843. Range is between 1 and 8. |
Default('2.82843')
|
link
|
Int | Literal['average', 'maximum'] | Default
|
Choose if the average level between all channels of input stream or the louder(maximum) channel of input stream affects the reduction. Default is average. |
Default('average')
|
detection
|
Int | Literal['peak', 'rms'] | Default
|
Should the exact signal be taken in case of peak or an RMS one in case of rms. Default is rms which is mostly smoother. |
Default('rms')
|
level_sc
|
Double
|
set sidechain gain (from 0.015625 to 64) (default 1) |
Default('1')
|
mix
|
Double
|
How much to use compressed signal in output. Default is 1. Range is between 0 and 1. |
Default('1')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
acontrast
¶
acontrast(
*,
contrast: Float = Default("33"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Simple audio dynamic range compression/expansion filter.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
contrast
|
Float
|
Set contrast. Default is 33. Allowed range is between 0 and 100. |
Default('33')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
acopy
¶
acopy(
extra_options: dict[str, Any] | None = None,
) -> AudioStream
Copy the input audio source unchanged to the output. This is mainly useful for testing purposes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
acrossfade
¶
acrossfade(
_crossfade1: AudioStream,
*,
nb_samples: Int = Default("44100"),
duration: Duration = Default("0"),
overlap: Boolean = Default("true"),
curve1: (
Int
| Literal[
"nofade",
"tri",
"qsin",
"esin",
"hsin",
"log",
"ipar",
"qua",
"cub",
"squ",
"cbr",
"par",
"exp",
"iqsin",
"ihsin",
"dese",
"desi",
"losi",
"sinc",
"isinc",
]
| Default
) = Default("tri"),
curve2: (
Int
| Literal[
"nofade",
"tri",
"qsin",
"esin",
"hsin",
"log",
"ipar",
"qua",
"cub",
"squ",
"cbr",
"par",
"exp",
"iqsin",
"ihsin",
"dese",
"desi",
"losi",
"sinc",
"isinc",
]
| Default
) = Default("tri"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply cross fade from one input audio stream to another input audio stream. The cross fade is applied for specified duration near the end of first stream.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nb_samples
|
Int
|
Specify the number of samples for which the cross fade effect has to last. At the end of the cross fade effect the first input audio will be completely silent. Default is 44100. |
Default('44100')
|
duration
|
Duration
|
Specify the duration of the cross fade effect. See the Time duration section in the ffmpeg-utils(1) manual for the accepted syntax. By default the duration is determined by nb_samples. If set this option is used instead of nb_samples. |
Default('0')
|
overlap
|
Boolean
|
Should first stream end overlap with second stream start. Default is enabled. |
Default('true')
|
curve1
|
Int | Literal['nofade', 'tri', 'qsin', 'esin', 'hsin', 'log', 'ipar', 'qua', 'cub', 'squ', 'cbr', 'par', 'exp', 'iqsin', 'ihsin', 'dese', 'desi', 'losi', 'sinc', 'isinc'] | Default
|
Set curve for cross fade transition for first stream. |
Default('tri')
|
curve2
|
Int | Literal['nofade', 'tri', 'qsin', 'esin', 'hsin', 'log', 'ipar', 'qua', 'cub', 'squ', 'cbr', 'par', 'exp', 'iqsin', 'ihsin', 'dese', 'desi', 'losi', 'sinc', 'isinc'] | Default
|
Set curve for cross fade transition for second stream. For description of available curve types see afade filter description. |
Default('tri')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
acrossover
¶
acrossover(
*,
split: String = Default("500"),
order: (
Int
| Literal[
"2nd",
"4th",
"6th",
"8th",
"10th",
"12th",
"14th",
"16th",
"18th",
"20th",
]
| Default
) = Default("4th"),
level: Float = Default("1"),
gain: String = Default("1.f"),
precision: (
Int | Literal["auto", "float", "double"] | Default
) = Default("auto"),
extra_options: dict[str, Any] | None = None
) -> FilterNode
Split audio stream into several bands.
This filter splits audio stream into two or more frequency ranges. Summing all streams back will give flat output.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
split
|
String
|
Set split frequencies. Those must be positive and increasing. |
Default('500')
|
order
|
Int | Literal['2nd', '4th', '6th', '8th', '10th', '12th', '14th', '16th', '18th', '20th'] | Default
|
Set filter order for each band split. This controls filter roll-off or steepness of filter transfer function. Available values are: @end table Default is 4th. |
Default('4th')
|
level
|
Float
|
Set input gain level. Allowed range is from 0 to 1. Default value is 1. |
Default('1')
|
gain
|
String
|
set output bands gain (default "1.f") |
Default('1.f')
|
precision
|
Int | Literal['auto', 'float', 'double'] | Default
|
Set which precision to use when processing samples. @end table Default value is auto. |
Default('auto')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
filter_node |
FilterNode
|
the filter node |
References
acrusher
¶
acrusher(
*,
level_in: Double = Default("1"),
level_out: Double = Default("1"),
bits: Double = Default("8"),
mix: Double = Default("0.5"),
mode: Int | Literal["lin", "log"] | Default = Default(
"lin"
),
dc: Double = Default("1"),
aa: Double = Default("0.5"),
samples: Double = Default("1"),
lfo: Boolean = Default("false"),
lforange: Double = Default("20"),
lforate: Double = Default("0.3"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Reduce audio bit resolution.
This filter is bit crusher with enhanced functionality. A bit crusher is used to audibly reduce number of bits an audio signal is sampled with. This doesn't change the bit depth at all, it just produces the effect. Material reduced in bit depth sounds more harsh and "digital". This filter is able to even round to continuous values instead of discrete bit depths. Additionally it has a D/C offset which results in different crushing of the lower and the upper half of the signal. An Anti-Aliasing setting is able to produce "softer" crushing sounds.
Another feature of this filter is the logarithmic mode. This setting switches from linear distances between bits to logarithmic ones. The result is a much more "natural" sounding crusher which doesn't gate low signals for example. The human ear has a logarithmic perception, so this kind of crushing is much more pleasant. Logarithmic crushing is also able to get anti-aliased.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_in
|
Double
|
Set level in. |
Default('1')
|
level_out
|
Double
|
Set level out. |
Default('1')
|
bits
|
Double
|
Set bit reduction. |
Default('8')
|
mix
|
Double
|
Set mixing amount. |
Default('0.5')
|
mode
|
Int | Literal['lin', 'log'] | Default
|
Can be linear: lin or logarithmic: log. |
Default('lin')
|
dc
|
Double
|
Set DC. |
Default('1')
|
aa
|
Double
|
Set anti-aliasing. |
Default('0.5')
|
samples
|
Double
|
Set sample reduction. |
Default('1')
|
lfo
|
Boolean
|
Enable LFO. By default disabled. |
Default('false')
|
lforange
|
Double
|
Set LFO range. |
Default('20')
|
lforate
|
Double
|
Set LFO rate. |
Default('0.3')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
acue
¶
acue(
*,
cue: Int64 = Default("0"),
preroll: Duration = Default("0"),
buffer: Duration = Default("0"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Delay audio filtering until a given wallclock timestamp. See the cue filter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cue
|
Int64
|
cue unix timestamp in microseconds (from 0 to I64_MAX) (default 0) |
Default('0')
|
preroll
|
Duration
|
preroll duration in seconds (default 0) |
Default('0')
|
buffer
|
Duration
|
buffer duration in seconds (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
addroi
¶
addroi(
*,
x: String = Default("0"),
y: String = Default("0"),
w: String = Default("0"),
h: String = Default("0"),
qoffset: Rational = Default("-1/10"),
clear: Boolean = Default("false"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Mark a region of interest in a video frame.
The frame data is passed through unchanged, but metadata is attached to the frame indicating regions of interest which can affect the behaviour of later encoding. Multiple regions can be marked by applying the filter multiple times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
String
|
Region distance in pixels from the left edge of the frame. |
Default('0')
|
y
|
String
|
Region distance in pixels from the top edge of the frame. |
Default('0')
|
w
|
String
|
Region width in pixels. |
Default('0')
|
h
|
String
|
Region height in pixels. The parameters x, y, w and h are expressions, and may contain the following variables: @end table |
Default('0')
|
qoffset
|
Rational
|
Quantisation offset to apply within the region. This must be a real value in the range -1 to +1. A value of zero indicates no quality change. A negative value asks for better quality (less quantisation), while a positive value asks for worse quality (greater quantisation). The range is calibrated so that the extreme values indicate the largest possible offset - if the rest of the frame is encoded with the worst possible quality, an offset of -1 indicates that this region should be encoded with the best possible quality anyway. Intermediate values are then interpolated in some codec-dependent way. For example, in 10-bit H.264 the quantisation parameter varies between -12 and 51. A typical qoffset value of -1/10 therefore indicates that this region should be encoded with a QP around one-tenth of the full range better than the rest of the frame. So, if most of the frame were to be encoded with a QP of around 30, this region would get a QP of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3). An extreme value of -1 would indicate that this region should be encoded with the best possible quality regardless of the treatment of the rest of the frame - that is, should be encoded at a QP of -12. |
Default('-1/10')
|
clear
|
Boolean
|
If set to true, remove any existing regions of interest marked on the frame before adding the new one. |
Default('false')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
adeclick
¶
adeclick(
*,
window: Double = Default("55"),
overlap: Double = Default("75"),
arorder: Double = Default("2"),
threshold: Double = Default("2"),
burst: Double = Default("2"),
method: (
Int | Literal["add", "a", "save", "s"] | Default
) = Default("add"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Remove impulsive noise from input audio.
Samples detected as impulsive noise are replaced by interpolated samples using autoregressive modelling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
window
|
Double
|
Set window size, in milliseconds. Allowed range is from 10 to 100. Default value is 55 milliseconds. This sets size of window which will be processed at once. |
Default('55')
|
overlap
|
Double
|
Set window overlap, in percentage of window size. Allowed range is from 50 to 95. Default value is 75 percent. Setting this to a very high value increases impulsive noise removal but makes whole process much slower. |
Default('75')
|
arorder
|
Double
|
Set autoregression order, in percentage of window size. Allowed range is from 0 to 25. Default value is 2 percent. This option also controls quality of interpolated samples using neighbour good samples. |
Default('2')
|
threshold
|
Double
|
Set threshold value. Allowed range is from 1 to 100. Default value is 2. This controls the strength of impulsive noise which is going to be removed. The lower value, the more samples will be detected as impulsive noise. |
Default('2')
|
burst
|
Double
|
Set burst fusion, in percentage of window size. Allowed range is 0 to 10. Default value is 2. If any two samples detected as noise are spaced less than this value then any sample between those two samples will be also detected as noise. |
Default('2')
|
method
|
Int | Literal['add', 'a', 'save', 's'] | Default
|
Set overlap method. It accepts the following values: @end table Default value is a. |
Default('add')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
adeclip
¶
adeclip(
*,
window: Double = Default("55"),
overlap: Double = Default("75"),
arorder: Double = Default("8"),
threshold: Double = Default("10"),
hsize: Int = Default("1000"),
method: (
Int | Literal["add", "a", "save", "s"] | Default
) = Default("add"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Remove clipped samples from input audio.
Samples detected as clipped are replaced by interpolated samples using autoregressive modelling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
window
|
Double
|
Set window size, in milliseconds. Allowed range is from 10 to 100. Default value is 55 milliseconds. This sets size of window which will be processed at once. |
Default('55')
|
overlap
|
Double
|
Set window overlap, in percentage of window size. Allowed range is from 50 to 95. Default value is 75 percent. |
Default('75')
|
arorder
|
Double
|
Set autoregression order, in percentage of window size. Allowed range is from 0 to 25. Default value is 8 percent. This option also controls quality of interpolated samples using neighbour good samples. |
Default('8')
|
threshold
|
Double
|
Set threshold value. Allowed range is from 1 to 100. Default value is 10. Higher values make clip detection less aggressive. |
Default('10')
|
hsize
|
Int
|
Set size of histogram used to detect clips. Allowed range is from 100 to 9999. Default value is 1000. Higher values make clip detection less aggressive. |
Default('1000')
|
method
|
Int | Literal['add', 'a', 'save', 's'] | Default
|
Set overlap method. It accepts the following values: @end table Default value is a. |
Default('add')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
adecorrelate
¶
adecorrelate(
*,
stages: Int = Default("6"),
seed: Int64 = Default("-1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply decorrelation to input audio stream.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stages
|
Int
|
Set decorrelation stages of filtering. Allowed range is from 1 to 16. Default value is 6. |
Default('6')
|
seed
|
Int64
|
Set random seed used for setting delay in samples across channels. |
Default('-1')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
adelay
¶
adelay(
*,
delays: String = Default(None),
all: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Delay one or more audio channels.
Samples in delayed channel are filled with silence.
The filter accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delays
|
String
|
Set list of delays in milliseconds for each channel separated by '|'. Unused delays will be silently ignored. If number of given delays is smaller than number of channels all remaining channels will not be delayed. If you want to delay exact number of samples, append 'S' to number. If you want instead to delay in seconds, append 's' to number. |
Default(None)
|
all
|
Boolean
|
Use last set delay for all remaining channels. By default is disabled. This option if enabled changes how option delays is interpreted. |
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 |
AudioStream
|
the audio stream |
References
adenorm
¶
adenorm(
*,
level: Double = Default("-351"),
type: (
Int
| Literal["dc", "ac", "square", "pulse"]
| Default
) = Default("dc"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Remedy denormals in audio by adding extremely low-level noise.
This filter shall be placed before any filter that can produce denormals.
A description of the accepted parameters follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
Double
|
Set level of added noise in dB. Default is -351. Allowed range is from -451 to -90. |
Default('-351')
|
type
|
Int | Literal['dc', 'ac', 'square', 'pulse'] | Default
|
Set type of added noise. @end table Default is dc. |
Default('dc')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
aderivative
¶
aderivative(
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None,
) -> AudioStream
Compute derivative/integral of audio stream.
Applying both filters one after another produces original audio.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
adrawgraph
¶
adrawgraph(
*,
m1: String = Default(""),
fg1: String = Default("0xffff0000"),
m2: String = Default(""),
fg2: String = Default("0xff00ff00"),
m3: String = Default(""),
fg3: String = Default("0xffff00ff"),
m4: String = Default(""),
fg4: String = Default("0xffffff00"),
bg: Color = Default("white"),
min: Float = Default("-1"),
max: Float = Default("1"),
mode: (
Int | Literal["bar", "dot", "line"] | Default
) = Default("line"),
slide: (
Int
| Literal[
"frame",
"replace",
"scroll",
"rscroll",
"picture",
]
| Default
) = Default("frame"),
size: Image_size = Default("900x256"),
rate: Video_rate = Default("25"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Draw a graph using input audio metadata.
See drawgraph
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m1
|
String
|
set 1st metadata key (default "") |
Default('')
|
fg1
|
String
|
set 1st foreground color expression (default "0xffff0000") |
Default('0xffff0000')
|
m2
|
String
|
set 2nd metadata key (default "") |
Default('')
|
fg2
|
String
|
set 2nd foreground color expression (default "0xff00ff00") |
Default('0xff00ff00')
|
m3
|
String
|
set 3rd metadata key (default "") |
Default('')
|
fg3
|
String
|
set 3rd foreground color expression (default "0xffff00ff") |
Default('0xffff00ff')
|
m4
|
String
|
set 4th metadata key (default "") |
Default('')
|
fg4
|
String
|
set 4th foreground color expression (default "0xffffff00") |
Default('0xffffff00')
|
bg
|
Color
|
set background color (default "white") |
Default('white')
|
min
|
Float
|
set minimal value (from INT_MIN to INT_MAX) (default -1) |
Default('-1')
|
max
|
Float
|
set maximal value (from INT_MIN to INT_MAX) (default 1) |
Default('1')
|
mode
|
Int | Literal['bar', 'dot', 'line'] | Default
|
set graph mode (from 0 to 2) (default line) |
Default('line')
|
slide
|
Int | Literal['frame', 'replace', 'scroll', 'rscroll', 'picture'] | Default
|
set slide mode (from 0 to 4) (default frame) |
Default('frame')
|
size
|
Image_size
|
set graph size (default "900x256") |
Default('900x256')
|
rate
|
Video_rate
|
set video 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
adynamicequalizer
¶
adynamicequalizer(
*,
threshold: Double = Default("0"),
dfrequency: Double = Default("1000"),
dqfactor: Double = Default("1"),
tfrequency: Double = Default("1000"),
tqfactor: Double = Default("1"),
attack: Double = Default("20"),
release: Double = Default("200"),
knee: Double = Default("1"),
ratio: Double = Default("1"),
makeup: Double = Default("0"),
range: Double = Default("0"),
slew: Double = Default("1"),
mode: (
Int | Literal["listen", "cut", "boost"] | Default
) = Default("cut"),
tftype: (
Int
| Literal["bell", "lowshelf", "highshelf"]
| Default
) = Default("bell"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply dynamic equalization to input audio stream.
A description of the accepted options follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
Double
|
Set the detection threshold used to trigger equalization. Threshold detection is using bandpass filter. Default value is 0. Allowed range is from 0 to 100. |
Default('0')
|
dfrequency
|
Double
|
Set the detection frequency in Hz used for bandpass filter used to trigger equalization. Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz. |
Default('1000')
|
dqfactor
|
Double
|
Set the detection resonance factor for bandpass filter used to trigger equalization. Default value is 1. Allowed range is from 0.001 to 1000. |
Default('1')
|
tfrequency
|
Double
|
Set the target frequency of equalization filter. Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz. |
Default('1000')
|
tqfactor
|
Double
|
Set the target resonance factor for target equalization filter. Default value is 1. Allowed range is from 0.001 to 1000. |
Default('1')
|
attack
|
Double
|
Set the amount of milliseconds the signal from detection has to rise above the detection threshold before equalization starts. Default is 20. Allowed range is between 1 and 2000. |
Default('20')
|
release
|
Double
|
Set the amount of milliseconds the signal from detection has to fall below the detection threshold before equalization ends. Default is 200. Allowed range is between 1 and 2000. |
Default('200')
|
knee
|
Double
|
Curve the sharp knee around the detection threshold to calculate equalization gain more softly. Default is 1. Allowed range is between 0 and 8. |
Default('1')
|
ratio
|
Double
|
Set the ratio by which the equalization gain is raised. Default is 1. Allowed range is between 1 and 20. |
Default('1')
|
makeup
|
Double
|
Set the makeup offset in dB by which the equalization gain is raised. Default is 0. Allowed range is between 0 and 30. |
Default('0')
|
range
|
Double
|
Set the max allowed cut/boost amount in dB. Default is 0. Allowed range is from 0 to 200. |
Default('0')
|
slew
|
Double
|
Set the slew factor. Default is 1. Allowed range is from 1 to 200. |
Default('1')
|
mode
|
Int | Literal['listen', 'cut', 'boost'] | Default
|
Set the mode of filter operation, can be one of the following: @end table Default mode is cut. |
Default('cut')
|
tftype
|
Int | Literal['bell', 'lowshelf', 'highshelf'] | Default
|
Set the type of target filter, can be one of the following: @end table Default type is bell. |
Default('bell')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
adynamicsmooth
¶
adynamicsmooth(
*,
sensitivity: Double = Default("2"),
basefreq: Double = Default("22050"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply dynamic smoothing to input audio stream.
A description of the accepted options follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sensitivity
|
Double
|
Set an amount of sensitivity to frequency fluctations. Default is 2. Allowed range is from 0 to 1e+06. |
Default('2')
|
basefreq
|
Double
|
Set a base frequency for smoothing. Default value is 22050. Allowed range is from 2 to 1e+06. |
Default('22050')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
aecho
¶
aecho(
*,
in_gain: Float = Default("0.6"),
out_gain: Float = Default("0.3"),
delays: String = Default("1000"),
decays: String = Default("0.5"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply echoing to the input audio.
Echoes are reflected sound and can occur naturally amongst mountains (and sometimes large buildings) when talking or shouting; digital echo effects emulate this behaviour and are often used to help fill out the sound of a single instrument or vocal. The time difference between the original signal and the reflection is the delay, and the loudness of the reflected signal is the decay. Multiple echoes can have different delays and decays.
A description of the accepted parameters follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
in_gain
|
Float
|
Set input gain of reflected signal. Default is 0.6. |
Default('0.6')
|
out_gain
|
Float
|
Set output gain of reflected signal. Default is 0.3. |
Default('0.3')
|
delays
|
String
|
Set list of time intervals in milliseconds between original signal and reflections separated by '|'. Allowed range for each delay is (0 - 90000.0]. Default is 1000. |
Default('1000')
|
decays
|
String
|
Set list of loudness of reflected signals separated by '|'. Allowed range for each decay is (0 - 1.0]. Default is 0.5. |
Default('0.5')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
aemphasis
¶
aemphasis(
*,
level_in: Double = Default("1"),
level_out: Double = Default("1"),
mode: (
Int
| Literal["reproduction", "production"]
| Default
) = Default("reproduction"),
type: (
Int
| Literal[
"col",
"emi",
"bsi",
"riaa",
"cd",
"50fm",
"75fm",
"50kf",
"75kf",
]
| Default
) = Default("cd"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Audio emphasis filter creates or restores material directly taken from LPs or emphased CDs with different filter curves. E.g. to store music on vinyl the signal has to be altered by a filter first to even out the disadvantages of this recording medium. Once the material is played back the inverse filter has to be applied to restore the distortion of the frequency response.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_in
|
Double
|
Set input gain. |
Default('1')
|
level_out
|
Double
|
Set output gain. |
Default('1')
|
mode
|
Int | Literal['reproduction', 'production'] | Default
|
Set filter mode. For restoring material use reproduction mode, otherwise use production mode. Default is reproduction mode. |
Default('reproduction')
|
type
|
Int | Literal['col', 'emi', 'bsi', 'riaa', 'cd', '50fm', '75fm', '50kf', '75kf'] | Default
|
Set filter type. Selects medium. Can be one of the following: @end table |
Default('cd')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
aeval
¶
aeval(
*,
exprs: String = Default(None),
channel_layout: String = Default(None),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Modify an audio signal according to the specified expressions.
This filter accepts one or more expressions (one for each channel), which are evaluated and used to modify a corresponding audio signal.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exprs
|
String
|
Set the '|'-separated expressions list for each separate channel. If the number of input channels is greater than the number of expressions, the last specified expression is used for the remaining output channels. |
Default(None)
|
channel_layout
|
String
|
Set output channel layout. If not specified, the channel layout is specified by the number of expressions. If set to same, it will use by default the same input channel layout. |
Default(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 |
AudioStream
|
the audio stream |
References
aexciter
¶
aexciter(
*,
level_in: Double = Default("1"),
level_out: Double = Default("1"),
amount: Double = Default("1"),
drive: Double = Default("8.5"),
blend: Double = Default("0"),
freq: Double = Default("7500"),
ceil: Double = Default("9999"),
listen: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
An exciter is used to produce high sound that is not present in the original signal. This is done by creating harmonic distortions of the signal which are restricted in range and added to the original signal. An Exciter raises the upper end of an audio signal without simply raising the higher frequencies like an equalizer would do to create a more "crisp" or "brilliant" sound.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_in
|
Double
|
Set input level prior processing of signal. Allowed range is from 0 to 64. Default value is 1. |
Default('1')
|
level_out
|
Double
|
Set output level after processing of signal. Allowed range is from 0 to 64. Default value is 1. |
Default('1')
|
amount
|
Double
|
Set the amount of harmonics added to original signal. Allowed range is from 0 to 64. Default value is 1. |
Default('1')
|
drive
|
Double
|
Set the amount of newly created harmonics. Allowed range is from 0.1 to 10. Default value is 8.5. |
Default('8.5')
|
blend
|
Double
|
Set the octave of newly created harmonics. Allowed range is from -10 to 10. Default value is 0. |
Default('0')
|
freq
|
Double
|
Set the lower frequency limit of producing harmonics in Hz. Allowed range is from 2000 to 12000 Hz. Default is 7500 Hz. |
Default('7500')
|
ceil
|
Double
|
Set the upper frequency limit of producing harmonics. Allowed range is from 9999 to 20000 Hz. If value is lower than 10000 Hz no limit is applied. |
Default('9999')
|
listen
|
Boolean
|
Mute the original signal and output only added harmonics. By default is disabled. |
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 |
AudioStream
|
the audio stream |
References
afade
¶
afade(
*,
type: Int | Literal["in", "out"] | Default = Default(
"in"
),
start_sample: Int64 = Default("0"),
nb_samples: Int64 = Default("44100"),
start_time: Duration = Default("0"),
duration: Duration = Default("0"),
curve: (
Int
| Literal[
"nofade",
"tri",
"qsin",
"esin",
"hsin",
"log",
"ipar",
"qua",
"cub",
"squ",
"cbr",
"par",
"exp",
"iqsin",
"ihsin",
"dese",
"desi",
"losi",
"sinc",
"isinc",
]
| Default
) = Default("tri"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply fade-in/out effect to input audio.
A description of the accepted parameters follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
Int | Literal['in', 'out'] | Default
|
Specify the effect type, can be either in for fade-in, or out for a fade-out effect. Default is in. |
Default('in')
|
start_sample
|
Int64
|
Specify the number of the start sample for starting to apply the fade effect. Default is 0. |
Default('0')
|
nb_samples
|
Int64
|
Specify the number of samples for which the fade effect has to last. At the end of the fade-in effect the output audio will have the same volume as the input audio, at the end of the fade-out transition the output audio will be silence. Default is 44100. |
Default('44100')
|
start_time
|
Duration
|
Specify the start time of the fade effect. Default is 0. The value must be specified as a time duration; see the Time duration section in the ffmpeg-utils(1) manual for the accepted syntax. If set this option is used instead of start_sample. |
Default('0')
|
duration
|
Duration
|
Specify the duration of the fade effect. See the Time duration section in the ffmpeg-utils(1) manual for the accepted syntax. At the end of the fade-in effect the output audio will have the same volume as the input audio, at the end of the fade-out transition the output audio will be silence. By default the duration is determined by nb_samples. If set this option is used instead of nb_samples. |
Default('0')
|
curve
|
Int | Literal['nofade', 'tri', 'qsin', 'esin', 'hsin', 'log', 'ipar', 'qua', 'cub', 'squ', 'cbr', 'par', 'exp', 'iqsin', 'ihsin', 'dese', 'desi', 'losi', 'sinc', 'isinc'] | Default
|
Set curve for fade transition. It accepts the following values: @end table |
Default('tri')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
afftdn
¶
afftdn(
*,
noise_reduction: Float = Default("12"),
noise_floor: Float = Default("-50"),
noise_type: (
Int
| Literal[
"white",
"w",
"vinyl",
"v",
"shellac",
"s",
"custom",
"c",
]
| Default
) = Default("white"),
band_noise: String = Default(None),
residual_floor: Float = Default("-38"),
track_noise: Boolean = Default("false"),
track_residual: Boolean = Default("false"),
output_mode: (
Int
| Literal["input", "i", "output", "o", "noise", "n"]
| Default
) = Default("output"),
adaptivity: Float = Default("0.5"),
floor_offset: Float = Default("1"),
noise_link: (
Int
| Literal["none", "min", "max", "average"]
| Default
) = Default("min"),
band_multiplier: Float = Default("1.25"),
sample_noise: (
Int
| Literal["none", "start", "begin", "stop", "end"]
| Default
) = Default("none"),
gain_smooth: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Denoise audio samples with FFT.
A description of the accepted parameters follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
noise_reduction
|
Float
|
Set the noise reduction in dB, allowed range is 0.01 to 97. Default value is 12 dB. |
Default('12')
|
noise_floor
|
Float
|
Set the noise floor in dB, allowed range is -80 to -20. Default value is -50 dB. |
Default('-50')
|
noise_type
|
Int | Literal['white', 'w', 'vinyl', 'v', 'shellac', 's', 'custom', 'c'] | Default
|
Set the noise type. It accepts the following values: @end table |
Default('white')
|
band_noise
|
String
|
Set custom band noise profile for every one of 15 bands. Bands are separated by ' ' or '|'. |
Default(None)
|
residual_floor
|
Float
|
Set the residual floor in dB, allowed range is -80 to -20. Default value is -38 dB. |
Default('-38')
|
track_noise
|
Boolean
|
Enable noise floor tracking. By default is disabled. With this enabled, noise floor is automatically adjusted. |
Default('false')
|
track_residual
|
Boolean
|
Enable residual tracking. By default is disabled. |
Default('false')
|
output_mode
|
Int | Literal['input', 'i', 'output', 'o', 'noise', 'n'] | Default
|
Set the output mode. It accepts the following values: @end table |
Default('output')
|
adaptivity
|
Float
|
Set the adaptivity factor, used how fast to adapt gains adjustments per each frequency bin. Value 0 enables instant adaptation, while higher values react much slower. Allowed range is from 0 to 1. Default value is 0.5. |
Default('0.5')
|
floor_offset
|
Float
|
Set the noise floor offset factor. This option is used to adjust offset applied to measured noise floor. It is only effective when noise floor tracking is enabled. Allowed range is from -2.0 to 2.0. Default value is 1.0. |
Default('1')
|
noise_link
|
Int | Literal['none', 'min', 'max', 'average'] | Default
|
Set the noise link used for multichannel audio. It accepts the following values: @end table |
Default('min')
|
band_multiplier
|
Float
|
Set the band multiplier factor, used how much to spread bands across frequency bins. Allowed range is from 0.2 to 5. Default value is 1.25. |
Default('1.25')
|
sample_noise
|
Int | Literal['none', 'start', 'begin', 'stop', 'end'] | Default
|
Toggle capturing and measurement of noise profile from input audio. It accepts the following values: @end table |
Default('none')
|
gain_smooth
|
Int
|
Set gain smooth spatial radius, used to smooth gains applied to each frequency bin. Useful to reduce random music noise artefacts. Higher values increases smoothing of gains. Allowed range is from 0 to 50. Default value is 0. |
Default('0')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
afftfilt
¶
afftfilt(
*,
real: String = Default("re"),
imag: String = Default("im"),
win_size: Int = Default("4096"),
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",
]
| Default
) = Default("hann"),
overlap: Float = Default("0.75"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply arbitrary expressions to samples in frequency domain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
real
|
String
|
Set frequency domain real expression for each separate channel separated by '|'. Default is "re". If the number of input channels is greater than the number of expressions, the last specified expression is used for the remaining output channels. |
Default('re')
|
imag
|
String
|
Set frequency domain imaginary expression for each separate channel separated by '|'. Default is "im". Each expression in real and imag can contain the following constants and functions: @end table |
Default('im')
|
win_size
|
Int
|
Set window size. Allowed range is from 16 to 131072. Default is 4096 |
Default('4096')
|
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'] | Default
|
Set window function. It accepts the following values: @end table Default is hann. |
Default('hann')
|
overlap
|
Float
|
Set window overlap. If set to 1, the recommended overlap for selected window function will be picked. Default is 0.75. |
Default('0.75')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
afifo
¶
afifo(
extra_options: dict[str, Any] | None = None,
) -> AudioStream
Buffer input images and send them when they are requested.
It is mainly useful when auto-inserted by the libavfilter framework.
It does not take parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
aformat
¶
aformat(
*,
sample_fmts: String = Default(None),
sample_rates: String = Default(None),
channel_layouts: String = Default(None),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Set output format constraints for the input audio. The framework will negotiate the most appropriate format to minimize conversions.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample_fmts
|
String
|
A '|'-separated list of requested sample formats. |
Default(None)
|
sample_rates
|
String
|
A '|'-separated list of requested sample rates. |
Default(None)
|
channel_layouts
|
String
|
A '|'-separated list of requested channel layouts. See the Channel Layout section in the ffmpeg-utils(1) manual for the required syntax. |
Default(None)
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
afreqshift
¶
afreqshift(
*,
shift: Double = Default("0"),
level: Double = Default("1"),
order: Int = Default("8"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply frequency shift to input audio samples.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shift
|
Double
|
Specify frequency shift. Allowed range is -INT_MAX to INT_MAX. Default value is 0.0. |
Default('0')
|
level
|
Double
|
Set output gain applied to final output. Allowed range is from 0.0 to 1.0. Default value is 1.0. |
Default('1')
|
order
|
Int
|
Set filter order used for filtering. Allowed range is from 1 to 16. Default value is 8. |
Default('8')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
afwtdn
¶
afwtdn(
*,
sigma: Double = Default("0"),
levels: Int = Default("10"),
wavet: (
Int
| Literal[
"sym2",
"sym4",
"rbior68",
"deb10",
"sym10",
"coif5",
"bl3",
]
| Default
) = Default("sym10"),
percent: Double = Default("85"),
profile: Boolean = Default("false"),
adaptive: Boolean = Default("false"),
samples: Int = Default("8192"),
softness: Double = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Reduce broadband noise from input samples using Wavelets.
A description of the accepted options follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma
|
Double
|
Set the noise sigma, allowed range is from 0 to 1. Default value is 0. This option controls strength of denoising applied to input samples. Most useful way to set this option is via decibels, eg. -45dB. |
Default('0')
|
levels
|
Int
|
Set the number of wavelet levels of decomposition. Allowed range is from 1 to 12. Default value is 10. Setting this too low make denoising performance very poor. |
Default('10')
|
wavet
|
Int | Literal['sym2', 'sym4', 'rbior68', 'deb10', 'sym10', 'coif5', 'bl3'] | Default
|
Set wavelet type for decomposition of input frame. They are sorted by number of coefficients, from lowest to highest. More coefficients means worse filtering speed, but overall better quality. Available wavelets are: @end table |
Default('sym10')
|
percent
|
Double
|
Set percent of full denoising. Allowed range is from 0 to 100 percent. Default value is 85 percent or partial denoising. |
Default('85')
|
profile
|
Boolean
|
If enabled, first input frame will be used as noise profile. If first frame samples contain non-noise performance will be very poor. |
Default('false')
|
adaptive
|
Boolean
|
If enabled, input frames are analyzed for presence of noise. If noise is detected with high possibility then input frame profile will be used for processing following frames, until new noise frame is detected. |
Default('false')
|
samples
|
Int
|
Set size of single frame in number of samples. Allowed range is from 512 to 65536. Default frame size is 8192 samples. |
Default('8192')
|
softness
|
Double
|
Set softness applied inside thresholding function. Allowed range is from 0 to 10. Default softness is 1. |
Default('1')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
agate
¶
agate(
*,
level_in: Double = Default("1"),
mode: (
Int | Literal["downward", "upward"] | Default
) = Default("downward"),
range: Double = Default("0.06125"),
threshold: Double = Default("0.125"),
ratio: Double = Default("2"),
attack: Double = Default("20"),
release: Double = Default("250"),
makeup: Double = Default("1"),
knee: Double = Default("2.82843"),
detection: (
Int | Literal["peak", "rms"] | Default
) = Default("rms"),
link: (
Int | Literal["average", "maximum"] | Default
) = Default("average"),
level_sc: Double = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
A gate is mainly used to reduce lower parts of a signal. This kind of signal processing reduces disturbing noise between useful signals.
Gating is done by detecting the volume below a chosen level threshold and dividing it by the factor set with ratio. The bottom of the noise floor is set via range. Because an exact manipulation of the signal would cause distortion of the waveform the reduction can be levelled over time. This is done by setting attack and release.
attack determines how long the signal has to fall below the threshold before any reduction will occur and release sets the time the signal has to rise above the threshold to reduce the reduction again. Shorter signals than the chosen attack time will be left untouched.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_in
|
Double
|
Set input level before filtering. Default is 1. Allowed range is from 0.015625 to 64. |
Default('1')
|
mode
|
Int | Literal['downward', 'upward'] | Default
|
Set the mode of operation. Can be upward or downward. Default is downward. If set to upward mode, higher parts of signal will be amplified, expanding dynamic range in upward direction. Otherwise, in case of downward lower parts of signal will be reduced. |
Default('downward')
|
range
|
Double
|
Set the level of gain reduction when the signal is below the threshold. Default is 0.06125. Allowed range is from 0 to 1. Setting this to 0 disables reduction and then filter behaves like expander. |
Default('0.06125')
|
threshold
|
Double
|
If a signal rises above this level the gain reduction is released. Default is 0.125. Allowed range is from 0 to 1. |
Default('0.125')
|
ratio
|
Double
|
Set a ratio by which the signal is reduced. Default is 2. Allowed range is from 1 to 9000. |
Default('2')
|
attack
|
Double
|
Amount of milliseconds the signal has to rise above the threshold before gain reduction stops. Default is 20 milliseconds. Allowed range is from 0.01 to 9000. |
Default('20')
|
release
|
Double
|
Amount of milliseconds the signal has to fall below the threshold before the reduction is increased again. Default is 250 milliseconds. Allowed range is from 0.01 to 9000. |
Default('250')
|
makeup
|
Double
|
Set amount of amplification of signal after processing. Default is 1. Allowed range is from 1 to 64. |
Default('1')
|
knee
|
Double
|
Curve the sharp knee around the threshold to enter gain reduction more softly. Default is 2.828427125. Allowed range is from 1 to 8. |
Default('2.82843')
|
detection
|
Int | Literal['peak', 'rms'] | Default
|
Choose if exact signal should be taken for detection or an RMS like one. Default is rms. Can be peak or rms. |
Default('rms')
|
link
|
Int | Literal['average', 'maximum'] | Default
|
Choose if the average level between all channels or the louder channel affects the reduction. Default is average. Can be average or maximum. |
Default('average')
|
level_sc
|
Double
|
set sidechain gain (from 0.015625 to 64) (default 1) |
Default('1')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
agraphmonitor
¶
agraphmonitor(
*,
size: Image_size = Default("hd720"),
opacity: Float = Default("0.9"),
mode: (
Int | Literal["full", "compact"] | Default
) = Default("full"),
flags: (
Flags
| Literal[
"queue",
"frame_count_in",
"frame_count_out",
"frame_count_delta",
"pts",
"pts_delta",
"time",
"time_delta",
"timebase",
"format",
"size",
"rate",
"eof",
"sample_count_in",
"sample_count_out",
"sample_count_delta",
]
| Default
) = Default("queue"),
rate: Video_rate = Default("25"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
See graphmonitor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
Image_size
|
set monitor size (default "hd720") |
Default('hd720')
|
opacity
|
Float
|
set video opacity (from 0 to 1) (default 0.9) |
Default('0.9')
|
mode
|
Int | Literal['full', 'compact'] | Default
|
set mode (from 0 to 1) (default full) |
Default('full')
|
flags
|
Flags | Literal['queue', 'frame_count_in', 'frame_count_out', 'frame_count_delta', 'pts', 'pts_delta', 'time', 'time_delta', 'timebase', 'format', 'size', 'rate', 'eof', 'sample_count_in', 'sample_count_out', 'sample_count_delta'] | Default
|
set flags (default queue) |
Default('queue')
|
rate
|
Video_rate
|
set video 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
ahistogram
¶
ahistogram(
*,
dmode: (
Int | Literal["single", "separate"] | Default
) = Default("single"),
rate: Video_rate = Default("25"),
size: Image_size = Default("hd720"),
scale: (
Int
| Literal["log", "sqrt", "cbrt", "lin", "rlog"]
| Default
) = Default("log"),
ascale: Int | Literal["log", "lin"] | Default = Default(
"log"
),
acount: Int = Default("1"),
rheight: Float = Default("0.1"),
slide: (
Int | Literal["replace", "scroll"] | Default
) = Default("replace"),
hmode: Int | Literal["abs", "sign"] | Default = Default(
"abs"
),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert input audio to a video output, displaying the volume histogram.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dmode
|
Int | Literal['single', 'separate'] | Default
|
Specify how histogram is calculated. It accepts the following values: @end table Default is single. |
Default('single')
|
rate
|
Video_rate
|
Set frame rate, expressed as number of frames per second. Default value is "25". |
Default('25')
|
size
|
Image_size
|
Specify the video size for the output. For the syntax of this option, check the "Video size" section in the ffmpeg-utils manual. Default value is hd720. |
Default('hd720')
|
scale
|
Int | Literal['log', 'sqrt', 'cbrt', 'lin', 'rlog'] | Default
|
Set display scale. It accepts the following values: @end table Default is log. |
Default('log')
|
ascale
|
Int | Literal['log', 'lin'] | Default
|
Set amplitude scale. It accepts the following values: @end table Default is log. |
Default('log')
|
acount
|
Int
|
Set how much frames to accumulate in histogram. Default is 1. Setting this to -1 accumulates all frames. |
Default('1')
|
rheight
|
Float
|
Set histogram ratio of window height. |
Default('0.1')
|
slide
|
Int | Literal['replace', 'scroll'] | Default
|
Set sonogram sliding. It accepts the following values: @end table Default is replace. |
Default('replace')
|
hmode
|
Int | Literal['abs', 'sign'] | Default
|
Set histogram mode. It accepts the following values: @end table Default is abs. |
Default('abs')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
aiir
¶
aiir(
*,
zeros: String = Default("1+0i 1-0i"),
poles: String = Default("1+0i 1-0i"),
gains: String = Default("1|1"),
dry: Double = Default("1"),
wet: Double = Default("1"),
format: (
Int
| Literal["ll", "sf", "tf", "zp", "pr", "pd", "sp"]
| Default
) = Default("zp"),
process: (
Int | Literal["d", "s", "p"] | Default
) = Default("s"),
precision: (
Int | Literal["dbl", "flt", "i32", "i16"] | Default
) = Default("dbl"),
e: (
Int | Literal["dbl", "flt", "i32", "i16"] | Default
) = Default("dbl"),
normalize: Boolean = Default("true"),
mix: Double = Default("1"),
response: Boolean = Default("false"),
channel: Int = Default("0"),
size: Image_size = Default("hd720"),
rate: Video_rate = Default("25"),
extra_options: dict[str, Any] | None = None
) -> FilterNode
Apply an arbitrary Infinite Impulse Response filter.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
zeros
|
String
|
Set B/numerator/zeros/reflection coefficients. |
Default('1+0i 1-0i')
|
poles
|
String
|
Set A/denominator/poles/ladder coefficients. |
Default('1+0i 1-0i')
|
gains
|
String
|
Set channels gains. |
Default('1|1')
|
dry
|
Double
|
set dry gain (from 0 to 1) (default 1) |
Default('1')
|
wet
|
Double
|
set wet gain (from 0 to 1) (default 1) |
Default('1')
|
format
|
Int | Literal['ll', 'sf', 'tf', 'zp', 'pr', 'pd', 'sp'] | Default
|
Set coefficients format. @end table |
Default('zp')
|
process
|
Int | Literal['d', 's', 'p'] | Default
|
Set type of processing. @end table |
Default('s')
|
precision
|
Int | Literal['dbl', 'flt', 'i32', 'i16'] | Default
|
Set filtering precision. @end table |
Default('dbl')
|
e
|
Int | Literal['dbl', 'flt', 'i32', 'i16'] | Default
|
Set filtering precision. @end table |
Default('dbl')
|
normalize
|
Boolean
|
Normalize filter coefficients, by default is enabled. Enabling it will normalize magnitude response at DC to 0dB. |
Default('true')
|
mix
|
Double
|
How much to use filtered signal in output. Default is 1. Range is between 0 and 1. |
Default('1')
|
response
|
Boolean
|
Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream. By default it is disabled. |
Default('false')
|
channel
|
Int
|
Set for which IR channel to display frequency response. By default is first channel displayed. This option is used only when response is enabled. |
Default('0')
|
size
|
Image_size
|
Set video stream size. This option is used only when response is enabled. |
Default('hd720')
|
rate
|
Video_rate
|
set video rate (default "25") |
Default('25')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
filter_node |
FilterNode
|
the filter node |
References
aintegral
¶
aintegral(
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None,
) -> AudioStream
Compute derivative/integral of audio stream.
Applying both filters one after another produces original audio.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
alatency
¶
alatency(
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None,
) -> AudioStream
Measure filtering latency.
Report previous filter filtering latency, delay in number of audio samples for audio filters or number of video frames for video filters.
On end of input stream, filter will report min and max measured latency for previous running filter in filtergraph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
alimiter
¶
alimiter(
*,
level_in: Double = Default("1"),
level_out: Double = Default("1"),
limit: Double = Default("1"),
attack: Double = Default("5"),
release: Double = Default("50"),
asc: Boolean = Default("false"),
asc_level: Double = Default("0.5"),
level: Boolean = Default("true"),
latency: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
The limiter prevents an input signal from rising over a desired threshold. This limiter uses lookahead technology to prevent your signal from distorting. It means that there is a small delay after the signal is processed. Keep in mind that the delay it produces is the attack time you set.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_in
|
Double
|
Set input gain. Default is 1. |
Default('1')
|
level_out
|
Double
|
Set output gain. Default is 1. |
Default('1')
|
limit
|
Double
|
Don't let signals above this level pass the limiter. Default is 1. |
Default('1')
|
attack
|
Double
|
The limiter will reach its attenuation level in this amount of time in milliseconds. Default is 5 milliseconds. |
Default('5')
|
release
|
Double
|
Come back from limiting to attenuation 1.0 in this amount of milliseconds. Default is 50 milliseconds. |
Default('50')
|
asc
|
Boolean
|
When gain reduction is always needed ASC takes care of releasing to an average reduction level rather than reaching a reduction of 0 in the release time. |
Default('false')
|
asc_level
|
Double
|
Select how much the release time is affected by ASC, 0 means nearly no changes in release time while 1 produces higher release times. |
Default('0.5')
|
level
|
Boolean
|
Auto level output signal. Default is enabled. This normalizes audio back to 0dB if enabled. |
Default('true')
|
latency
|
Boolean
|
Compensate the delay introduced by using the lookahead buffer set with attack parameter. Also flush the valid audio data in the lookahead buffer when the stream hits EOF. |
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 |
AudioStream
|
the audio stream |
References
allpass
¶
allpass(
*,
frequency: Double = Default("3000"),
width_type: (
Int | Literal["h", "q", "o", "s", "k"] | Default
) = Default("q"),
width: Double = Default("0.707"),
mix: Double = Default("1"),
channels: String = Default("all"),
normalize: Boolean = Default("false"),
order: Int = Default("2"),
transform: (
Int
| Literal[
"di", "dii", "tdi", "tdii", "latt", "svf", "zdf"
]
| Default
) = Default("di"),
precision: (
Int
| Literal["auto", "s16", "s32", "f32", "f64"]
| Default
) = Default("auto"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply a two-pole all-pass filter with central frequency (in Hz) frequency, and filter-width width. An all-pass filter changes the audio's frequency to phase relationship without changing its frequency to amplitude relationship.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequency
|
Double
|
Change allpass frequency. Syntax for the command is : "frequency" |
Default('3000')
|
width_type
|
Int | Literal['h', 'q', 'o', 's', 'k'] | Default
|
Change allpass width_type. Syntax for the command is : "width_type" |
Default('q')
|
width
|
Double
|
Change allpass width. Syntax for the command is : "width" |
Default('0.707')
|
mix
|
Double
|
Change allpass mix. Syntax for the command is : "mix" |
Default('1')
|
channels
|
String
|
Specify which channels to filter, by default all available are filtered. |
Default('all')
|
normalize
|
Boolean
|
Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. |
Default('false')
|
order
|
Int
|
Set the filter order, can be 1 or 2. Default is 2. |
Default('2')
|
transform
|
Int | Literal['di', 'dii', 'tdi', 'tdii', 'latt', 'svf', 'zdf'] | Default
|
Set transform type of IIR filter. @end table |
Default('di')
|
precision
|
Int | Literal['auto', 's16', 's32', 'f32', 'f64'] | Default
|
Set precison of filtering. @end table |
Default('auto')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
aloop
¶
aloop(
*,
loop: Int = Default("0"),
size: Int64 = Default("0"),
start: Int64 = Default("0"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Loop audio samples.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
loop
|
Int
|
Set the number of loops. Setting this value to -1 will result in infinite loops. Default is 0. |
Default('0')
|
size
|
Int64
|
Set maximal number of samples. Default is 0. |
Default('0')
|
start
|
Int64
|
Set first sample of loop. Default is 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
alphaextract
¶
alphaextract(
extra_options: dict[str, Any] | None = None,
) -> VideoStream
Extract the alpha component from the input as a grayscale video. This is especially useful with the alphamerge filter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
alphamerge
¶
alphamerge(
_alpha: VideoStream,
framesync_options: FFMpegFrameSyncOption | None = None,
eof_action: str | None = None,
shortest: bool | None = None,
repeatlast: bool | None = None,
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None,
) -> VideoStream
Add or replace the alpha component of the primary input with the grayscale value of a second input. This is intended for use with alphaextract to allow the transmission or storage of frame sequences that have alpha in a format that doesn't support an alpha channel.
For example, to reconstruct full frames from a normal YUV-encoded video and a separate video created with alphaextract, you might use: @example movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out] @end example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
framesync_options
|
FFMpegFrameSyncOption | None
|
Framesync options |
None
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
ametadata
¶
ametadata(
*,
mode: (
Int
| Literal[
"select", "add", "modify", "delete", "print"
]
| Default
) = Default("select"),
key: String = Default(None),
value: String = Default(None),
function: (
Int
| Literal[
"same_str",
"starts_with",
"less",
"equal",
"greater",
"expr",
"ends_with",
]
| Default
) = Default("same_str"),
expr: String = Default(None),
file: String = Default(None),
direct: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Manipulate frame metadata.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Int | Literal['select', 'add', 'modify', 'delete', 'print'] | Default
|
Set mode of operation of the filter. Can be one of the following: @end table |
Default('select')
|
key
|
String
|
Set key used with all modes. Must be set for all modes except print and delete. |
Default(None)
|
value
|
String
|
Set metadata value which will be used. This option is mandatory for modify and add mode. |
Default(None)
|
function
|
Int | Literal['same_str', 'starts_with', 'less', 'equal', 'greater', 'expr', 'ends_with'] | Default
|
Which function to use when comparing metadata value and value. Can be one of following: @end table |
Default('same_str')
|
expr
|
String
|
Set expression which is used when function is set to expr. The expression is evaluated through the eval API and can contain the following constants: @end table |
Default(None)
|
file
|
String
|
If specified in print mode, output is written to the named file. Instead of plain filename any writable url can be specified. Filename ``-'' is a shorthand for standard output. If file option is not set, output is written to the log with AV_LOG_INFO loglevel. |
Default(None)
|
direct
|
Boolean
|
Reduces buffering in print mode when output is written to a URL set using file. |
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 |
AudioStream
|
the audio stream |
References
amplify
¶
amplify(
*,
radius: Int = Default("2"),
factor: Float = Default("2"),
threshold: Float = Default("10"),
tolerance: Float = Default("0"),
low: Float = Default("65535"),
high: Float = Default("65535"),
planes: Flags = Default("7"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Amplify differences between current pixel and pixels of adjacent frames in same pixel location.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radius
|
Int
|
Set frame radius. Default is 2. Allowed range is from 1 to 63. For example radius of 3 will instruct filter to calculate average of 7 frames. |
Default('2')
|
factor
|
Float
|
set factor (from 0 to 65535) (default 2) |
Default('2')
|
threshold
|
Float
|
set threshold (from 0 to 65535) (default 10) |
Default('10')
|
tolerance
|
Float
|
set tolerance (from 0 to 65535) (default 0) |
Default('0')
|
low
|
Float
|
set low limit for amplification (from 0 to 65535) (default 65535) |
Default('65535')
|
high
|
Float
|
set high limit for amplification (from 0 to 65535) (default 65535) |
Default('65535')
|
planes
|
Flags
|
set what planes to filter (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
amultiply
¶
amultiply(
_multiply1: AudioStream,
extra_options: dict[str, Any] | None = None,
) -> AudioStream
Multiply first audio stream with second audio stream and store result in output audio stream. Multiplication is done by multiplying each sample from first stream with sample at same position from second stream.
With this element-wise multiplication one can create amplitude fades and amplitude modulations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
anequalizer
¶
anequalizer(
*,
params: String = Default(""),
curves: Boolean = Default("false"),
size: Image_size = Default("hd720"),
mgain: Double = Default("60"),
fscale: Int | Literal["lin", "log"] | Default = Default(
"log"
),
colors: String = Default(
"red|green|blue|yellow|orange|lime|pink|magenta|brown"
),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> FilterNode
High-order parametric multiband equalizer for each channel.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
String
|
This option string is in format: "cchn f=cf w=w g=g t=f | ..." Each equalizer band is separated by '|'. @end table |
Default('')
|
curves
|
Boolean
|
With this option activated frequency response of anequalizer is displayed in video stream. |
Default('false')
|
size
|
Image_size
|
Set video stream size. Only useful if curves option is activated. |
Default('hd720')
|
mgain
|
Double
|
Set max gain that will be displayed. Only useful if curves option is activated. Setting this to a reasonable value makes it possible to display gain which is derived from neighbour bands which are too close to each other and thus produce higher gain when both are activated. |
Default('60')
|
fscale
|
Int | Literal['lin', 'log'] | Default
|
Set frequency scale used to draw frequency response in video output. Can be linear or logarithmic. Default is logarithmic. |
Default('log')
|
colors
|
String
|
Set color for each channel curve which is going to be displayed in video stream. This is list of color names separated by space or by '|'. Unrecognised or missing colors will be replaced by white color. |
Default('red|green|blue|yellow|orange|lime|pink|magenta|brown')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
filter_node |
FilterNode
|
the filter node |
References
anlmdn
¶
anlmdn(
*,
strength: Float = Default("1e-05"),
patch: Duration = Default("0.002"),
research: Duration = Default("0.006"),
output: (
Int | Literal["i", "o", "n"] | Default
) = Default("o"),
smooth: Float = Default("11"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Reduce broadband noise in audio samples using Non-Local Means algorithm.
Each sample is adjusted by looking for other samples with similar contexts. This context similarity is defined by comparing their surrounding patches of size p. Patches are searched in an area of r around the sample.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strength
|
Float
|
Set denoising strength. Allowed range is from 0.00001 to 10000. Default value is 0.00001. |
Default('1e-05')
|
patch
|
Duration
|
Set patch radius duration. Allowed range is from 1 to 100 milliseconds. Default value is 2 milliseconds. |
Default('0.002')
|
research
|
Duration
|
Set research radius duration. Allowed range is from 2 to 300 milliseconds. Default value is 6 milliseconds. |
Default('0.006')
|
output
|
Int | Literal['i', 'o', 'n'] | Default
|
Set the output mode. It accepts the following values: @end table |
Default('o')
|
smooth
|
Float
|
Set smooth factor. Default value is 11. Allowed range is from 1 to 1000. |
Default('11')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
anlmf
¶
anlmf(
_desired: AudioStream,
*,
order: Int = Default("256"),
mu: Float = Default("0.75"),
eps: Float = Default("1"),
leakage: Float = Default("0"),
out_mode: (
Int | Literal["i", "d", "o", "n"] | Default
) = Default("o"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply Normalized Least-Mean-(Squares|Fourth) algorithm to the first audio stream using the second audio stream.
This adaptive filter is used to mimic a desired filter by finding the filter coefficients that relate to producing the least mean square of the error signal (difference between the desired, 2nd input audio stream and the actual signal, the 1st input audio stream).
A description of the accepted options follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order
|
Int
|
Set filter order. |
Default('256')
|
mu
|
Float
|
Set filter mu. |
Default('0.75')
|
eps
|
Float
|
Set the filter eps. |
Default('1')
|
leakage
|
Float
|
Set the filter leakage. |
Default('0')
|
out_mode
|
Int | Literal['i', 'd', 'o', 'n'] | Default
|
It accepts the following values: @end table |
Default('o')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
anlms
¶
anlms(
_desired: AudioStream,
*,
order: Int = Default("256"),
mu: Float = Default("0.75"),
eps: Float = Default("1"),
leakage: Float = Default("0"),
out_mode: (
Int | Literal["i", "d", "o", "n"] | Default
) = Default("o"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply Normalized Least-Mean-(Squares|Fourth) algorithm to the first audio stream using the second audio stream.
This adaptive filter is used to mimic a desired filter by finding the filter coefficients that relate to producing the least mean square of the error signal (difference between the desired, 2nd input audio stream and the actual signal, the 1st input audio stream).
A description of the accepted options follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order
|
Int
|
Set filter order. |
Default('256')
|
mu
|
Float
|
Set filter mu. |
Default('0.75')
|
eps
|
Float
|
Set the filter eps. |
Default('1')
|
leakage
|
Float
|
Set the filter leakage. |
Default('0')
|
out_mode
|
Int | Literal['i', 'd', 'o', 'n'] | Default
|
It accepts the following values: @end table |
Default('o')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
anull
¶
anull(
extra_options: dict[str, Any] | None = None,
) -> AudioStream
Pass the audio source unchanged to the output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
apad
¶
apad(
*,
packet_size: Int = Default("4096"),
pad_len: Int64 = Default("-1"),
whole_len: Int64 = Default("-1"),
pad_dur: Duration = Default("-0.000001"),
whole_dur: Duration = Default("-0.000001"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Pad the end of an audio stream with silence.
This can be used together with ffmpeg -shortest to extend audio streams to the same length as the video stream.
A description of the accepted options follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
packet_size
|
Int
|
Set silence packet size. Default value is 4096. |
Default('4096')
|
pad_len
|
Int64
|
Set the number of samples of silence to add to the end. After the value is reached, the stream is terminated. This option is mutually exclusive with whole_len. |
Default('-1')
|
whole_len
|
Int64
|
Set the minimum total number of samples in the output audio stream. If the value is longer than the input audio length, silence is added to the end, until the value is reached. This option is mutually exclusive with pad_len. |
Default('-1')
|
pad_dur
|
Duration
|
Specify the duration of samples of silence to add. See the Time duration section in the ffmpeg-utils(1) manual for the accepted syntax. Used only if set to non-negative value. |
Default('-0.000001')
|
whole_dur
|
Duration
|
Specify the minimum total duration in the output audio stream. See the Time duration section in the ffmpeg-utils(1) manual for the accepted syntax. Used only if set to non-negative value. If the value is longer than the input audio length, silence is added to the end, until the value is reached. This option is mutually exclusive with pad_dur |
Default('-0.000001')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
aperms
¶
aperms(
*,
mode: (
Int
| Literal["none", "ro", "rw", "toggle", "random"]
| Default
) = Default("none"),
seed: Int64 = Default("-1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Set read/write permissions for the output frames.
These filters are mainly aimed at developers to test direct path in the following filter in the filtergraph.
The filters accept the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Int | Literal['none', 'ro', 'rw', 'toggle', 'random'] | Default
|
Select the permissions mode. It accepts the following values: @end table |
Default('none')
|
seed
|
Int64
|
Set the seed for the random mode, must be an integer included between 0 and UINT32_MAX. If not specified, or if explicitly set to -1, the filter will try to use a good random seed on a best effort basis. |
Default('-1')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
aphasemeter
¶
aphasemeter(
*,
rate: Video_rate = Default("25"),
size: Image_size = Default("800x400"),
rc: Int = Default("2"),
gc: Int = Default("7"),
bc: Int = Default("1"),
mpc: String = Default("none"),
video: Boolean = Default("true"),
phasing: Boolean = Default("false"),
tolerance: Float = Default("0"),
angle: Float = Default("170"),
duration: Duration = Default("2"),
extra_options: dict[str, Any] | None = None
) -> FilterNode
Measures phase of input audio, which is exported as metadata lavfi.aphasemeter.phase, representing mean phase of current audio frame. A video output can also be produced and is enabled by default. The audio is passed through as first output.
Audio will be rematrixed to stereo if it has a different channel layout. Phase value is in range [-1, 1] where -1 means left and right channels are completely out of phase and 1 means channels are in phase.
The filter accepts the following options, all related to its video output:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rate
|
Video_rate
|
Set the output frame rate. Default value is 25. |
Default('25')
|
size
|
Image_size
|
Set the video size for the output. For the syntax of this option, check the "Video size" section in the ffmpeg-utils manual. Default value is 800x400. |
Default('800x400')
|
rc
|
Int
|
set red contrast (from 0 to 255) (default 2) |
Default('2')
|
gc
|
Int
|
set green contrast (from 0 to 255) (default 7) |
Default('7')
|
bc
|
Int
|
Specify the red, green, blue contrast. Default values are 2, 7 and 1. Allowed range is [0, 255]. |
Default('1')
|
mpc
|
String
|
Set color which will be used for drawing median phase. If color is none which is default, no median phase value will be drawn. |
Default('none')
|
video
|
Boolean
|
Enable video output. Default is enabled. |
Default('true')
|
phasing
|
Boolean
|
Enable mono and out of phase detection. Default is disabled. |
Default('false')
|
tolerance
|
Float
|
Set phase tolerance for mono detection, in amplitude ratio. Default is 0. Allowed range is [0, 1]. |
Default('0')
|
angle
|
Float
|
Set angle threshold for out of phase detection, in degree. Default is 170. Allowed range is [90, 180]. |
Default('170')
|
duration
|
Duration
|
Set mono or out of phase duration until notification, expressed in seconds. Default is 2. |
Default('2')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
filter_node |
FilterNode
|
the filter node |
References
aphaser
¶
aphaser(
*,
in_gain: Double = Default("0.4"),
out_gain: Double = Default("0.74"),
delay: Double = Default("3"),
decay: Double = Default("0.4"),
speed: Double = Default("0.5"),
type: (
Int
| Literal["triangular", "t", "sinusoidal", "s"]
| Default
) = Default("triangular"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Add a phasing effect to the input audio.
A phaser filter creates series of peaks and troughs in the frequency spectrum. The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
A description of the accepted parameters follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
in_gain
|
Double
|
Set input gain. Default is 0.4. |
Default('0.4')
|
out_gain
|
Double
|
Set output gain. Default is 0.74 |
Default('0.74')
|
delay
|
Double
|
Set delay in milliseconds. Default is 3.0. |
Default('3')
|
decay
|
Double
|
Set decay. Default is 0.4. |
Default('0.4')
|
speed
|
Double
|
Set modulation speed in Hz. Default is 0.5. |
Default('0.5')
|
type
|
Int | Literal['triangular', 't', 'sinusoidal', 's'] | Default
|
Set modulation type. Default is triangular. It accepts the following values: @end table |
Default('triangular')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
aphaseshift
¶
aphaseshift(
*,
shift: Double = Default("0"),
level: Double = Default("1"),
order: Int = Default("8"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply phase shift to input audio samples.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shift
|
Double
|
Specify phase shift. Allowed range is from -1.0 to 1.0. Default value is 0.0. |
Default('0')
|
level
|
Double
|
Set output gain applied to final output. Allowed range is from 0.0 to 1.0. Default value is 1.0. |
Default('1')
|
order
|
Int
|
Set filter order used for filtering. Allowed range is from 1 to 16. Default value is 8. |
Default('8')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
apsyclip
¶
apsyclip(
*,
level_in: Double = Default("1"),
level_out: Double = Default("1"),
clip: Double = Default("1"),
diff: Boolean = Default("false"),
adaptive: Double = Default("0.5"),
iterations: Int = Default("10"),
level: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply Psychoacoustic clipper to input audio stream.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_in
|
Double
|
Set input gain. By default it is 1. Range is [0.015625 - 64]. |
Default('1')
|
level_out
|
Double
|
Set output gain. By default it is 1. Range is [0.015625 - 64]. |
Default('1')
|
clip
|
Double
|
Set the clipping start value. Default value is 0dBFS or 1. |
Default('1')
|
diff
|
Boolean
|
Output only difference samples, useful to hear introduced distortions. By default is disabled. |
Default('false')
|
adaptive
|
Double
|
Set strength of adaptive distortion applied. Default value is 0.5. Allowed range is from 0 to 1. |
Default('0.5')
|
iterations
|
Int
|
Set number of iterations of psychoacoustic clipper. Allowed range is from 1 to 20. Default value is 10. |
Default('10')
|
level
|
Boolean
|
Auto level output signal. Default is disabled. This normalizes audio back to 0dBFS if enabled. |
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 |
AudioStream
|
the audio stream |
References
apulsator
¶
apulsator(
*,
level_in: Double = Default("1"),
level_out: Double = Default("1"),
mode: (
Int
| Literal[
"sine", "triangle", "square", "sawup", "sawdown"
]
| Default
) = Default("sine"),
amount: Double = Default("1"),
offset_l: Double = Default("0"),
offset_r: Double = Default("0.5"),
width: Double = Default("1"),
timing: (
Int | Literal["bpm", "ms", "hz"] | Default
) = Default("hz"),
bpm: Double = Default("120"),
ms: Int = Default("500"),
hz: Double = Default("2"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Audio pulsator is something between an autopanner and a tremolo. But it can produce funny stereo effects as well. Pulsator changes the volume of the left and right channel based on a LFO (low frequency oscillator) with different waveforms and shifted phases. This filter have the ability to define an offset between left and right channel. An offset of 0 means that both LFO shapes match each other. The left and right channel are altered equally - a conventional tremolo. An offset of 50% means that the shape of the right channel is exactly shifted in phase (or moved backwards about half of the frequency) - pulsator acts as an autopanner. At 1 both curves match again. Every setting in between moves the phase shift gapless between all stages and produces some "bypassing" sounds with sine and triangle waveforms. The more you set the offset near 1 (starting from the 0.5) the faster the signal passes from the left to the right speaker.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_in
|
Double
|
Set input gain. By default it is 1. Range is [0.015625 - 64]. |
Default('1')
|
level_out
|
Double
|
Set output gain. By default it is 1. Range is [0.015625 - 64]. |
Default('1')
|
mode
|
Int | Literal['sine', 'triangle', 'square', 'sawup', 'sawdown'] | Default
|
Set waveform shape the LFO will use. Can be one of: sine, triangle, square, sawup or sawdown. Default is sine. |
Default('sine')
|
amount
|
Double
|
Set modulation. Define how much of original signal is affected by the LFO. |
Default('1')
|
offset_l
|
Double
|
Set left channel offset. Default is 0. Allowed range is [0 - 1]. |
Default('0')
|
offset_r
|
Double
|
Set right channel offset. Default is 0.5. Allowed range is [0 - 1]. |
Default('0.5')
|
width
|
Double
|
Set pulse width. Default is 1. Allowed range is [0 - 2]. |
Default('1')
|
timing
|
Int | Literal['bpm', 'ms', 'hz'] | Default
|
Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz. |
Default('hz')
|
bpm
|
Double
|
Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing is set to bpm. |
Default('120')
|
ms
|
Int
|
Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing is set to ms. |
Default('500')
|
hz
|
Double
|
Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used if timing is set to hz. |
Default('2')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
arealtime
¶
arealtime(
*,
limit: Duration = Default("2"),
speed: Double = Default("1"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Slow down filtering to match real time approximately.
These filters will pause the filtering for a variable amount of time to match the output rate with the input timestamps. They are similar to the re option to ffmpeg.
They accept the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
Duration
|
Time limit for the pauses. Any pause longer than that will be considered a timestamp discontinuity and reset the timer. Default is 2 seconds. |
Default('2')
|
speed
|
Double
|
Speed factor for processing. The value must be a float larger than zero. Values larger than 1.0 will result in faster than realtime processing, smaller will slow processing down. The limit is automatically adapted accordingly. Default is 1.0. A processing speed faster than what is possible without these filters cannot be achieved. |
Default('1')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
aresample
¶
aresample(
*,
sample_rate: Int = Default("0"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Resample the input audio to the specified parameters, using the libswresample library. If none are specified then the filter will automatically convert between its input and output.
This filter is also able to stretch/squeeze the audio data to make it match the timestamps or to inject silence / cut out audio to make it match the timestamps, do a combination of both or do neither.
The filter accepts the syntax [sample_rate:]resampler_options, where sample_rate expresses a sample rate and resampler_options is a list of key=value pairs, separated by ":". See the "Resampler Options" section in the ffmpeg-resampler(1) manual for the complete list of supported options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample_rate
|
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
areverse
¶
areverse(
extra_options: dict[str, Any] | None = None,
) -> AudioStream
Reverse an audio clip.
Warning: This filter requires memory to buffer the entire clip, so trimming is suggested.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
arnndn
¶
arnndn(
*,
model: String = Default(None),
mix: Float = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Reduce noise from speech using Recurrent Neural Networks.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
String
|
Set train model file to load. This option is always required. |
Default(None)
|
mix
|
Float
|
Set how much to mix filtered samples into final output. Allowed range is from -1 to 1. Default value is 1. Negative values are special, they set how much to keep filtered noise in the final filter output. Set this option to -1 to hear actual noise removed from input signal. |
Default('1')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
asdr
¶
asdr(
_input1: AudioStream,
extra_options: dict[str, Any] | None = None,
) -> AudioStream
Measure Audio Signal-to-Distortion Ratio.
This filter takes two audio streams for input, and outputs first audio stream. Results are in dB per channel at end of either input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
asegment
¶
asegment(
*,
timestamps: String = Default(None),
samples: String = Default(None),
extra_options: dict[str, Any] | None = None
) -> FilterNode
Split single input stream into multiple streams.
This filter does opposite of concat filters.
segment works on video frames, asegment on audio samples.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timestamps
|
String
|
Timestamps of output segments separated by '|'. The first segment will run from the beginning of the input stream. The last segment will run until the end of the input stream |
Default(None)
|
samples
|
String
|
Exact frame/sample count to split the segments. |
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
aselect
¶
aselect(
*,
expr: String = Default("1"),
outputs: Int = Default("1"),
extra_options: dict[str, Any] | None = None
) -> FilterNode
Select frames to pass in output.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expr
|
String
|
Set expression, which is evaluated for each input frame. If the expression is evaluated to zero, the frame is discarded. If the evaluation result is negative or NaN, the frame is sent to the first output; otherwise it is sent to the output with index ceil(val)-1, assuming that the input index starts from 0. For example a value of 1.2 corresponds to the output with index ceil(1.2)-1 = 2-1 = 1, that is the second output. |
Default('1')
|
outputs
|
Int
|
Set the number of outputs. The output to which to send the selected frame is based on the result of the evaluation. Default value is 1. |
Default('1')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
filter_node |
FilterNode
|
the filter node |
References
asendcmd
¶
asendcmd(
*,
commands: String = Default(None),
filename: String = Default(None),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Send commands to filters in the filtergraph.
These filters read commands to be sent to other filters in the filtergraph.
sendcmd must be inserted between two video filters, asendcmd must be inserted between two audio filters, but apart from that they act the same way.
The specification of commands can be provided in the filter arguments with the commands option, or in a file specified by the filename option.
These filters accept the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
commands
|
String
|
Set the commands to be read and sent to the other filters. |
Default(None)
|
filename
|
String
|
Set the filename of the commands to be read and sent to the other filters. |
Default(None)
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
asetnsamples
¶
asetnsamples(
*,
nb_out_samples: Int = Default("1024"),
pad: Boolean = Default("true"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Set the number of samples per each output audio frame.
The last output packet may contain a different number of samples, as the filter will flush all the remaining samples when the input audio signals its end.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nb_out_samples
|
Int
|
Set the number of frames per each output audio frame. The number is intended as the number of samples per each channel. Default value is 1024. |
Default('1024')
|
pad
|
Boolean
|
If set to 1, the filter will pad the last audio frame with zeroes, so that the last frame will contain the same number of samples as the previous ones. Default value is 1. |
Default('true')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
asetpts
¶
asetpts(
*,
expr: String = Default("PTS"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Change the PTS (presentation timestamp) of the input frames.
setpts works on video frames, asetpts on audio frames.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expr
|
String
|
The expression which is evaluated for each frame to construct its timestamp. |
Default('PTS')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
asetrate
¶
asetrate(
*,
sample_rate: Int = Default("44100"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Set the sample rate without altering the PCM data. This will result in a change of speed and pitch.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample_rate
|
Int
|
Set the output sample rate. Default is 44100 Hz. |
Default('44100')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
asettb
¶
asettb(
*,
expr: String = Default("intb"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Set the timebase to use for the output frames timestamps. It is mainly useful for testing timebase configuration.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expr
|
String
|
The expression which is evaluated into the output timebase. |
Default('intb')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
ashowinfo
¶
ashowinfo(
extra_options: dict[str, Any] | None = None,
) -> AudioStream
Show a line containing various information for each input audio frame. The input audio is not modified.
The shown line contains a sequence of key/value pairs of the form key:value.
The following values are shown in the output:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
asidedata
¶
asidedata(
*,
mode: (
Int | Literal["select", "delete"] | Default
) = Default("select"),
type: (
Int
| Literal[
"PANSCAN",
"A53_CC",
"STEREO3D",
"MATRIXENCODING",
"DOWNMIX_INFO",
"REPLAYGAIN",
"DISPLAYMATRIX",
"AFD",
"MOTION_VECTORS",
"SKIP_SAMPLES",
"AUDIO_SERVICE_TYPE",
"MASTERING_DISPLAY_METADATA",
"GOP_TIMECODE",
"SPHERICAL",
"CONTENT_LIGHT_LEVEL",
"ICC_PROFILE",
"S12M_TIMECOD",
"DYNAMIC_HDR_PLUS",
"REGIONS_OF_INTEREST",
"DETECTION_BOUNDING_BOXES",
"SEI_UNREGISTERED",
]
| Default
) = Default("-1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Delete frame side data, or select frames based on it.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Int | Literal['select', 'delete'] | Default
|
Set mode of operation of the filter. Can be one of the following: @end table |
Default('select')
|
type
|
Int | Literal['PANSCAN', 'A53_CC', 'STEREO3D', 'MATRIXENCODING', 'DOWNMIX_INFO', 'REPLAYGAIN', 'DISPLAYMATRIX', 'AFD', 'MOTION_VECTORS', 'SKIP_SAMPLES', 'AUDIO_SERVICE_TYPE', 'MASTERING_DISPLAY_METADATA', 'GOP_TIMECODE', 'SPHERICAL', 'CONTENT_LIGHT_LEVEL', 'ICC_PROFILE', 'S12M_TIMECOD', 'DYNAMIC_HDR_PLUS', 'REGIONS_OF_INTEREST', 'DETECTION_BOUNDING_BOXES', 'SEI_UNREGISTERED'] | Default
|
Set side data type used with all modes. Must be set for select mode. For the list of frame side data types, refer to the AVFrameSideDataType enum in libavutil/frame.h. For example, to choose AV_FRAME_DATA_PANSCAN side data, you must specify PANSCAN. |
Default('-1')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
asoftclip
¶
asoftclip(
*,
type: (
Int
| Literal[
"hard",
"tanh",
"atan",
"cubic",
"exp",
"alg",
"quintic",
"sin",
"erf",
]
| Default
) = Default("tanh"),
threshold: Double = Default("1"),
output: Double = Default("1"),
param: Double = Default("1"),
oversample: Int = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply audio soft clipping.
Soft clipping is a type of distortion effect where the amplitude of a signal is saturated along a smooth curve, rather than the abrupt shape of hard-clipping.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
Int | Literal['hard', 'tanh', 'atan', 'cubic', 'exp', 'alg', 'quintic', 'sin', 'erf'] | Default
|
Set type of soft-clipping. It accepts the following values: @end table |
Default('tanh')
|
threshold
|
Double
|
Set threshold from where to start clipping. Default value is 0dB or 1. |
Default('1')
|
output
|
Double
|
Set gain applied to output. Default value is 0dB or 1. |
Default('1')
|
param
|
Double
|
Set additional parameter which controls sigmoid function. |
Default('1')
|
oversample
|
Int
|
Set oversampling factor. |
Default('1')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
aspectralstats
¶
aspectralstats(
*,
win_size: Int = Default("2048"),
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",
]
| Default
) = Default("hann"),
overlap: Float = Default("0.5"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Display frequency domain statistical information about the audio channels. Statistics are calculated and stored as metadata for each audio channel and for each audio frame.
It accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
win_size
|
Int
|
Set the window length in samples. Default value is 2048. Allowed range is from 32 to 65536. |
Default('2048')
|
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'] | Default
|
Set window function. It accepts the following values: @end table Default is hann. |
Default('hann')
|
overlap
|
Float
|
Set window overlap. Allowed range is from 0 to 1. Default value is 0.5. |
Default('0.5')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
asplit
¶
asplit(
*,
outputs: Int = Default("2"),
extra_options: dict[str, Any] | None = None
) -> FilterNode
Split input into several identical outputs.
asplit works with audio input, split with video.
The filter accepts a single parameter which specifies the number of outputs. If unspecified, it defaults to 2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
outputs
|
Int
|
set number of outputs (from 1 to INT_MAX) (default 2) |
Default('2')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
filter_node |
FilterNode
|
the filter node |
References
ass
¶
ass(
*,
filename: String = Default(None),
original_size: Image_size = Default(None),
fontsdir: String = Default(None),
alpha: Boolean = Default("false"),
shaping: (
Int | Literal["auto", "simple", "complex"] | Default
) = Default("auto"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Same as the subtitles filter, except that it doesn't require libavcodec and libavformat to work. On the other hand, it is limited to ASS (Advanced Substation Alpha) subtitles files.
This filter accepts the following option in addition to the common options from the subtitles filter:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
String
|
set the filename of file to read |
Default(None)
|
original_size
|
Image_size
|
set the size of the original video (used to scale fonts) |
Default(None)
|
fontsdir
|
String
|
set the directory containing the fonts to read |
Default(None)
|
alpha
|
Boolean
|
enable processing of alpha channel (default false) |
Default('false')
|
shaping
|
Int | Literal['auto', 'simple', 'complex'] | Default
|
Set the shaping engine Available values are: @end table The default is auto. |
Default('auto')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
astats
¶
astats(
*,
length: Double = Default("0.05"),
metadata: Boolean = Default("false"),
reset: Int = Default("0"),
measure_perchannel: (
Flags
| Literal[
"none",
"all",
"DC_offset",
"Min_level",
"Max_level",
"Min_difference",
"Max_difference",
"Mean_difference",
"RMS_difference",
"Peak_level",
"RMS_level",
"RMS_peak",
"RMS_trough",
"Crest_factor",
"Flat_factor",
"Peak_count",
"Bit_depth",
"Dynamic_range",
"Zero_crossings",
"Zero_crossings_rate",
"Noise_floor",
"Noise_floor_count",
"Entropy",
"Number_of_samples",
"Number_of_NaNs",
"Number_of_Infs",
"Number_of_denormals",
]
| Default
) = Default(
"all+DC_offset+Min_level+Max_level+Min_difference+Max_difference+Mean_difference+RMS_difference+Peak_level+RMS_level+RMS_peak+RMS_trough+Crest_factor+Flat_factor+Peak_count+Bit_depth+Dynamic_range+Zero_crossings+Zero_crossings_rate+Noise_floor+Noise_floor_count+Entropy+Number_of_samples+Number_of_NaNs+Number_of_Infs+Number_of_denormals"
),
measure_overall: (
Flags
| Literal[
"none",
"all",
"DC_offset",
"Min_level",
"Max_level",
"Min_difference",
"Max_difference",
"Mean_difference",
"RMS_difference",
"Peak_level",
"RMS_level",
"RMS_peak",
"RMS_trough",
"Crest_factor",
"Flat_factor",
"Peak_count",
"Bit_depth",
"Dynamic_range",
"Zero_crossings",
"Zero_crossings_rate",
"Noise_floor",
"Noise_floor_count",
"Entropy",
"Number_of_samples",
"Number_of_NaNs",
"Number_of_Infs",
"Number_of_denormals",
]
| Default
) = Default(
"all+DC_offset+Min_level+Max_level+Min_difference+Max_difference+Mean_difference+RMS_difference+Peak_level+RMS_level+RMS_peak+RMS_trough+Crest_factor+Flat_factor+Peak_count+Bit_depth+Dynamic_range+Zero_crossings+Zero_crossings_rate+Noise_floor+Noise_floor_count+Entropy+Number_of_samples+Number_of_NaNs+Number_of_Infs+Number_of_denormals"
),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Display time domain statistical information about the audio channels. Statistics are calculated and displayed for each audio channel and, where applicable, an overall figure is also given.
It accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
length
|
Double
|
Short window length in seconds, used for peak and trough RMS measurement. Default is 0.05 (50 milliseconds). Allowed range is [0 - 10]. |
Default('0.05')
|
metadata
|
Boolean
|
Set metadata injection. All the metadata keys are prefixed with lavfi.astats.X, where X is channel number starting from 1 or string Overall. Default is disabled. Available keys for each channel are: DC_offset Min_level Max_level Min_difference Max_difference Mean_difference RMS_difference Peak_level RMS_peak RMS_trough Crest_factor Flat_factor Peak_count Noise_floor Noise_floor_count Entropy Bit_depth Dynamic_range Zero_crossings Zero_crossings_rate Number_of_NaNs Number_of_Infs Number_of_denormals and for Overall: DC_offset Min_level Max_level Min_difference Max_difference Mean_difference RMS_difference Peak_level RMS_level RMS_peak RMS_trough Flat_factor Peak_count Noise_floor Noise_floor_count Entropy Bit_depth Number_of_samples Number_of_NaNs Number_of_Infs Number_of_denormals For example full key look like this lavfi.astats.1.DC_offset or this lavfi.astats.Overall.Peak_count. For description what each key means read below. |
Default('false')
|
reset
|
Int
|
Set the number of frames over which cumulative stats are calculated before being reset Default is disabled. |
Default('0')
|
measure_perchannel
|
Flags | Literal['none', 'all', 'DC_offset', 'Min_level', 'Max_level', 'Min_difference', 'Max_difference', 'Mean_difference', 'RMS_difference', 'Peak_level', 'RMS_level', 'RMS_peak', 'RMS_trough', 'Crest_factor', 'Flat_factor', 'Peak_count', 'Bit_depth', 'Dynamic_range', 'Zero_crossings', 'Zero_crossings_rate', 'Noise_floor', 'Noise_floor_count', 'Entropy', 'Number_of_samples', 'Number_of_NaNs', 'Number_of_Infs', 'Number_of_denormals'] | Default
|
Select the parameters which are measured per channel. The metadata keys can be used as flags, default is all which measures everything. none disables all per channel measurement. |
Default('all+DC_offset+Min_level+Max_level+Min_difference+Max_difference+Mean_difference+RMS_difference+Peak_level+RMS_level+RMS_peak+RMS_trough+Crest_factor+Flat_factor+Peak_count+Bit_depth+Dynamic_range+Zero_crossings+Zero_crossings_rate+Noise_floor+Noise_floor_count+Entropy+Number_of_samples+Number_of_NaNs+Number_of_Infs+Number_of_denormals')
|
measure_overall
|
Flags | Literal['none', 'all', 'DC_offset', 'Min_level', 'Max_level', 'Min_difference', 'Max_difference', 'Mean_difference', 'RMS_difference', 'Peak_level', 'RMS_level', 'RMS_peak', 'RMS_trough', 'Crest_factor', 'Flat_factor', 'Peak_count', 'Bit_depth', 'Dynamic_range', 'Zero_crossings', 'Zero_crossings_rate', 'Noise_floor', 'Noise_floor_count', 'Entropy', 'Number_of_samples', 'Number_of_NaNs', 'Number_of_Infs', 'Number_of_denormals'] | Default
|
Select the parameters which are measured overall. The metadata keys can be used as flags, default is all which measures everything. none disables all overall measurement. |
Default('all+DC_offset+Min_level+Max_level+Min_difference+Max_difference+Mean_difference+RMS_difference+Peak_level+RMS_level+RMS_peak+RMS_trough+Crest_factor+Flat_factor+Peak_count+Bit_depth+Dynamic_range+Zero_crossings+Zero_crossings_rate+Noise_floor+Noise_floor_count+Entropy+Number_of_samples+Number_of_NaNs+Number_of_Infs+Number_of_denormals')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
asubboost
¶
asubboost(
*,
dry: Double = Default("1"),
wet: Double = Default("1"),
boost: Double = Default("2"),
decay: Double = Default("0"),
feedback: Double = Default("0.9"),
cutoff: Double = Default("100"),
slope: Double = Default("0.5"),
delay: Double = Default("20"),
channels: String = Default("all"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Boost subwoofer frequencies.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dry
|
Double
|
Set dry gain, how much of original signal is kept. Allowed range is from 0 to 1. Default value is 1.0. |
Default('1')
|
wet
|
Double
|
Set wet gain, how much of filtered signal is kept. Allowed range is from 0 to 1. Default value is 1.0. |
Default('1')
|
boost
|
Double
|
Set max boost factor. Allowed range is from 1 to 12. Default value is 2. |
Default('2')
|
decay
|
Double
|
Set delay line decay gain value. Allowed range is from 0 to 1. Default value is 0.0. |
Default('0')
|
feedback
|
Double
|
Set delay line feedback gain value. Allowed range is from 0 to 1. Default value is 0.9. |
Default('0.9')
|
cutoff
|
Double
|
Set cutoff frequency in Hertz. Allowed range is 50 to 900. Default value is 100. |
Default('100')
|
slope
|
Double
|
Set slope amount for cutoff frequency. Allowed range is 0.0001 to 1. Default value is 0.5. |
Default('0.5')
|
delay
|
Double
|
Set delay. Allowed range is from 1 to 100. Default value is 20. |
Default('20')
|
channels
|
String
|
Set the channels to process. Default value is all available. |
Default('all')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
asubcut
¶
asubcut(
*,
cutoff: Double = Default("20"),
order: Int = Default("10"),
level: Double = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Cut subwoofer frequencies.
This filter allows to set custom, steeper roll off than highpass filter, and thus is able to more attenuate frequency content in stop-band.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cutoff
|
Double
|
Set cutoff frequency in Hertz. Allowed range is 2 to 200. Default value is 20. |
Default('20')
|
order
|
Int
|
Set filter order. Available values are from 3 to 20. Default value is 10. |
Default('10')
|
level
|
Double
|
Set input gain level. Allowed range is from 0 to 1. Default value is 1. |
Default('1')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
asupercut
¶
asupercut(
*,
cutoff: Double = Default("20000"),
order: Int = Default("10"),
level: Double = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Cut super frequencies.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cutoff
|
Double
|
Set cutoff frequency in Hertz. Allowed range is 20000 to 192000. Default value is 20000. |
Default('20000')
|
order
|
Int
|
Set filter order. Available values are from 3 to 20. Default value is 10. |
Default('10')
|
level
|
Double
|
Set input gain level. Allowed range is from 0 to 1. Default value is 1. |
Default('1')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
asuperpass
¶
asuperpass(
*,
centerf: Double = Default("1000"),
order: Int = Default("4"),
qfactor: Double = Default("1"),
level: Double = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply high order Butterworth band-pass filter.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
centerf
|
Double
|
Set center frequency in Hertz. Allowed range is 2 to 999999. Default value is 1000. |
Default('1000')
|
order
|
Int
|
Set filter order. Available values are from 4 to 20. Default value is 4. |
Default('4')
|
qfactor
|
Double
|
Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1. |
Default('1')
|
level
|
Double
|
Set input gain level. Allowed range is from 0 to 2. Default value is 1. |
Default('1')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
asuperstop
¶
asuperstop(
*,
centerf: Double = Default("1000"),
order: Int = Default("4"),
qfactor: Double = Default("1"),
level: Double = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply high order Butterworth band-stop filter.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
centerf
|
Double
|
Set center frequency in Hertz. Allowed range is 2 to 999999. Default value is 1000. |
Default('1000')
|
order
|
Int
|
Set filter order. Available values are from 4 to 20. Default value is 4. |
Default('4')
|
qfactor
|
Double
|
Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1. |
Default('1')
|
level
|
Double
|
Set input gain level. Allowed range is from 0 to 2. Default value is 1. |
Default('1')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
atadenoise
¶
atadenoise(
*,
_0a: Float = Default("0.02"),
_0b: Float = Default("0.04"),
_1a: Float = Default("0.02"),
_1b: Float = Default("0.04"),
_2a: Float = Default("0.02"),
_2b: Float = Default("0.04"),
s: Int = Default("9"),
p: Flags = Default("7"),
a: Int | Literal["p", "s"] | Default = Default("p"),
_0s: Float = Default("32767"),
_1s: Float = Default("32767"),
_2s: Float = Default("32767"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply an Adaptive Temporal Averaging Denoiser to the video input.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
_0a
|
Float
|
Set threshold A for 1st plane. Default is 0.02. Valid range is 0 to 0.3. |
Default('0.02')
|
_0b
|
Float
|
Set threshold B for 1st plane. Default is 0.04. Valid range is 0 to 5. |
Default('0.04')
|
_1a
|
Float
|
Set threshold A for 2nd plane. Default is 0.02. Valid range is 0 to 0.3. |
Default('0.02')
|
_1b
|
Float
|
Set threshold B for 2nd plane. Default is 0.04. Valid range is 0 to 5. |
Default('0.04')
|
_2a
|
Float
|
Set threshold A for 3rd plane. Default is 0.02. Valid range is 0 to 0.3. |
Default('0.02')
|
_2b
|
Float
|
Set threshold B for 3rd plane. Default is 0.04. Valid range is 0 to 5. Threshold A is designed to react on abrupt changes in the input signal and threshold B is designed to react on continuous changes in the input signal. |
Default('0.04')
|
s
|
Int
|
Set number of frames filter will use for averaging. Default is 9. Must be odd number in range [5, 129]. |
Default('9')
|
p
|
Flags
|
Set what planes of frame filter will use for averaging. Default is all. |
Default('7')
|
a
|
Int | Literal['p', 's'] | Default
|
Set what variant of algorithm filter will use for averaging. Default is p parallel. Alternatively can be set to s serial. Parallel can be faster then serial, while other way around is never true. Parallel will abort early on first change being greater then thresholds, while serial will continue processing other side of frames if they are equal or below thresholds. |
Default('p')
|
_0s
|
Float
|
set sigma for 1st plane (from 0 to 32767) (default 32767) |
Default('32767')
|
_1s
|
Float
|
set sigma for 2nd plane (from 0 to 32767) (default 32767) |
Default('32767')
|
_2s
|
Float
|
Set sigma for 1st plane, 2nd plane or 3rd plane. Default is 32767. Valid range is from 0 to 32767. This options controls weight for each pixel in radius defined by size. Default value means every pixel have same weight. Setting this option to 0 effectively disables filtering. |
Default('32767')
|
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
atempo
¶
atempo(
*,
tempo: Double = Default("1"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Adjust audio tempo.
The filter accepts exactly one parameter, the audio tempo. If not specified then the filter will assume nominal 1.0 tempo. Tempo must be in the [0.5, 100.0] range.
Note that tempo greater than 2 will skip some samples rather than blend them in. If for any reason this is a concern it is always possible to daisy-chain several instances of atempo to achieve the desired product tempo.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tempo
|
Double
|
Change filter tempo scale factor. Syntax for the command is : "tempo" |
Default('1')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
atilt
¶
atilt(
*,
freq: Double = Default("10000"),
slope: Double = Default("0"),
width: Double = Default("1000"),
order: Int = Default("5"),
level: Double = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply spectral tilt filter to audio stream.
This filter apply any spectral roll-off slope over any specified frequency band.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
freq
|
Double
|
Set central frequency of tilt in Hz. Default is 10000 Hz. |
Default('10000')
|
slope
|
Double
|
Set slope direction of tilt. Default is 0. Allowed range is from -1 to 1. |
Default('0')
|
width
|
Double
|
Set width of tilt. Default is 1000. Allowed range is from 100 to 10000. |
Default('1000')
|
order
|
Int
|
Set order of tilt filter. |
Default('5')
|
level
|
Double
|
Set input volume level. Allowed range is from 0 to 4. Defalt is 1. |
Default('1')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
atrim
¶
atrim(
*,
start: Duration = Default("INT64_MAX"),
end: Duration = Default("INT64_MAX"),
start_pts: Int64 = Default("I64_MIN"),
end_pts: Int64 = Default("I64_MIN"),
duration: Duration = Default("0"),
start_sample: Int64 = Default("-1"),
end_sample: Int64 = Default("I64_MAX"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Trim the input so that the output contains one continuous subpart of the input.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start
|
Duration
|
Timestamp (in seconds) of the start of the section to keep. I.e. the audio sample with the timestamp start will be the first sample in the output. |
Default('INT64_MAX')
|
end
|
Duration
|
Specify time of the first audio sample that will be dropped, i.e. the audio sample immediately preceding the one with the timestamp end will be the last sample in the output. |
Default('INT64_MAX')
|
start_pts
|
Int64
|
Same as start, except this option sets the start timestamp in samples instead of seconds. |
Default('I64_MIN')
|
end_pts
|
Int64
|
Same as end, except this option sets the end timestamp in samples instead of seconds. |
Default('I64_MIN')
|
duration
|
Duration
|
The maximum duration of the output in seconds. |
Default('0')
|
start_sample
|
Int64
|
The number of the first sample that should be output. |
Default('-1')
|
end_sample
|
Int64
|
The number of the first sample that should be dropped. |
Default('I64_MAX')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
audio_stream
¶
audio_stream(
index: int | None = None, optional: bool = False
) -> AudioStream
Get the audio stream from the input node with a specified index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int | None
|
The index of the audio stream. |
None
|
optional
|
bool
|
Whether the audio stream is optional. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
AudioStream |
AudioStream
|
The audio stream from the input node. |
avectorscope
¶
avectorscope(
*,
mode: (
Int
| Literal["lissajous", "lissajous_xy", "polar"]
| Default
) = Default("lissajous"),
rate: Video_rate = Default("25"),
size: Image_size = Default("400x400"),
rc: Int = Default("40"),
gc: Int = Default("160"),
bc: Int = Default("80"),
ac: Int = Default("255"),
rf: Int = Default("15"),
gf: Int = Default("10"),
bf: Int = Default("5"),
af: Int = Default("5"),
zoom: Double = Default("1"),
draw: Int | Literal["dot", "line"] | Default = Default(
"dot"
),
scale: (
Int
| Literal["lin", "sqrt", "cbrt", "log"]
| Default
) = Default("lin"),
swap: Boolean = Default("true"),
mirror: (
Int | Literal["none", "x", "y", "xy"] | Default
) = Default("none"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert input audio to a video output, representing the audio vector scope.
The filter is used to measure the difference between channels of stereo audio stream. A monaural signal, consisting of identical left and right signal, results in straight vertical line. Any stereo separation is visible as a deviation from this line, creating a Lissajous figure. If the straight (or deviation from it) but horizontal line appears this indicates that the left and right channels are out of phase.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Int | Literal['lissajous', 'lissajous_xy', 'polar'] | Default
|
Set the vectorscope mode. Available values are: @end table Default value is lissajous. |
Default('lissajous')
|
rate
|
Video_rate
|
Set the output frame rate. Default value is 25. |
Default('25')
|
size
|
Image_size
|
Set the video size for the output. For the syntax of this option, check the "Video size" section in the ffmpeg-utils manual. Default value is 400x400. |
Default('400x400')
|
rc
|
Int
|
set red contrast (from 0 to 255) (default 40) |
Default('40')
|
gc
|
Int
|
set green contrast (from 0 to 255) (default 160) |
Default('160')
|
bc
|
Int
|
set blue contrast (from 0 to 255) (default 80) |
Default('80')
|
ac
|
Int
|
Specify the red, green, blue and alpha contrast. Default values are 40, 160, 80 and 255. Allowed range is [0, 255]. |
Default('255')
|
rf
|
Int
|
set red fade (from 0 to 255) (default 15) |
Default('15')
|
gf
|
Int
|
set green fade (from 0 to 255) (default 10) |
Default('10')
|
bf
|
Int
|
set blue fade (from 0 to 255) (default 5) |
Default('5')
|
af
|
Int
|
Specify the red, green, blue and alpha fade. Default values are 15, 10, 5 and 5. Allowed range is [0, 255]. |
Default('5')
|
zoom
|
Double
|
Set the zoom factor. Default value is 1. Allowed range is [0, 10]. Values lower than 1 will auto adjust zoom factor to maximal possible value. |
Default('1')
|
draw
|
Int | Literal['dot', 'line'] | Default
|
Set the vectorscope drawing mode. Available values are: @end table Default value is dot. |
Default('dot')
|
scale
|
Int | Literal['lin', 'sqrt', 'cbrt', 'log'] | Default
|
Specify amplitude scale of audio samples. Available values are: @end table |
Default('lin')
|
swap
|
Boolean
|
Swap left channel axis with right channel axis. |
Default('true')
|
mirror
|
Int | Literal['none', 'x', 'y', 'xy'] | Default
|
Mirror axis. @end table |
Default('none')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
avgblur
¶
avgblur(
*,
sizeX: Int = Default("1"),
planes: Int = Default("15"),
sizeY: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply average blur filter.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sizeX
|
Int
|
Set horizontal radius size. |
Default('1')
|
planes
|
Int
|
Set which planes to filter. By default all planes are filtered. |
Default('15')
|
sizeY
|
Int
|
Set vertical radius size, if zero it will be same as sizeX. Default is 0. |
Default('0')
|
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
axcorrelate
¶
axcorrelate(
_axcorrelate1: AudioStream,
*,
size: Int = Default("256"),
algo: Int | Literal["slow", "fast"] | Default = Default(
"slow"
),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Calculate normalized windowed cross-correlation between two input audio streams.
Resulted samples are always between -1 and 1 inclusive. If result is 1 it means two input samples are highly correlated in that selected segment. Result 0 means they are not correlated at all. If result is -1 it means two input samples are out of phase, which means they cancel each other.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
Int
|
Set size of segment over which cross-correlation is calculated. Default is 256. Allowed range is from 2 to 131072. |
Default('256')
|
algo
|
Int | Literal['slow', 'fast'] | Default
|
Set algorithm for cross-correlation. Can be slow or fast. Default is slow. Fast algorithm assumes mean values over any given segment are always zero and thus need much less calculations to make. This is generally not true, but is valid for typical audio streams. |
Default('slow')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
azmq
¶
azmq(
*,
bind_address: String = Default("tcp://*:5555"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Receive commands sent through a libzmq client, and forward them to filters in the filtergraph.
zmq and azmq work as a pass-through filters. zmq must be inserted between two video filters, azmq between two audio filters. Both are capable to send messages to any filter type.
To enable these filters you need to install the libzmq library and headers and configure FFmpeg with --enable-libzmq.
For more information about libzmq see: http://www.zeromq.org/
The zmq and azmq filters work as a libzmq server, which receives messages sent through a network interface defined by the bind_address (or the abbreviation "b") option. Default value of this option is tcp://localhost:5555. You may want to alter this value to your needs, but do not forget to escape any ':' signs (see filtergraph escaping).
The received message must be in the form: @example TARGET COMMAND [ARG] @end example
TARGET specifies the target of the command, usually the name of
the filter class or a specific filter instance name. The default
filter instance name uses the pattern Parsed_
COMMAND specifies the name of the command for the target filter.
ARG is optional and specifies the optional argument list for the given COMMAND.
Upon reception, the message is processed and the corresponding command is injected into the filtergraph. Depending on the result, the filter will send a reply to the client, adopting the format: @example ERROR_CODE ERROR_REASON MESSAGE @end example
MESSAGE is optional.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bind_address
|
String
|
set bind address (default "tcp://*:5555") |
Default('tcp://*:5555')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
bandpass
¶
bandpass(
*,
frequency: Double = Default("3000"),
width_type: (
Int | Literal["h", "q", "o", "s", "k"] | Default
) = Default("q"),
width: Double = Default("0.5"),
csg: Boolean = Default("false"),
mix: Double = Default("1"),
channels: String = Default("all"),
normalize: Boolean = Default("false"),
transform: (
Int
| Literal[
"di", "dii", "tdi", "tdii", "latt", "svf", "zdf"
]
| Default
) = Default("di"),
precision: (
Int
| Literal["auto", "s16", "s32", "f32", "f64"]
| Default
) = Default("auto"),
blocksize: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply a two-pole Butterworth band-pass filter with central frequency frequency, and (3dB-point) band-width width. The csg option selects a constant skirt gain (peak gain = Q) instead of the default: constant 0dB peak gain. The filter roll off at 6dB per octave (20dB per decade).
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequency
|
Double
|
Change bandpass frequency. Syntax for the command is : "frequency" |
Default('3000')
|
width_type
|
Int | Literal['h', 'q', 'o', 's', 'k'] | Default
|
Change bandpass width_type. Syntax for the command is : "width_type" |
Default('q')
|
width
|
Double
|
Change bandpass width. Syntax for the command is : "width" |
Default('0.5')
|
csg
|
Boolean
|
Constant skirt gain if set to 1. Defaults to 0. |
Default('false')
|
mix
|
Double
|
Change bandpass mix. Syntax for the command is : "mix" |
Default('1')
|
channels
|
String
|
Specify which channels to filter, by default all available are filtered. |
Default('all')
|
normalize
|
Boolean
|
Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. |
Default('false')
|
transform
|
Int | Literal['di', 'dii', 'tdi', 'tdii', 'latt', 'svf', 'zdf'] | Default
|
Set transform type of IIR filter. @end table |
Default('di')
|
precision
|
Int | Literal['auto', 's16', 's32', 'f32', 'f64'] | Default
|
Set precison of filtering. @end table |
Default('auto')
|
blocksize
|
Int
|
set the block size (from 0 to 32768) (default 0) |
Default('0')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
bandreject
¶
bandreject(
*,
frequency: Double = Default("3000"),
width_type: (
Int | Literal["h", "q", "o", "s", "k"] | Default
) = Default("q"),
width: Double = Default("0.5"),
mix: Double = Default("1"),
channels: String = Default("all"),
normalize: Boolean = Default("false"),
transform: (
Int
| Literal[
"di", "dii", "tdi", "tdii", "latt", "svf", "zdf"
]
| Default
) = Default("di"),
precision: (
Int
| Literal["auto", "s16", "s32", "f32", "f64"]
| Default
) = Default("auto"),
blocksize: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply a two-pole Butterworth band-reject filter with central frequency frequency, and (3dB-point) band-width width. The filter roll off at 6dB per octave (20dB per decade).
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequency
|
Double
|
Change bandreject frequency. Syntax for the command is : "frequency" |
Default('3000')
|
width_type
|
Int | Literal['h', 'q', 'o', 's', 'k'] | Default
|
Change bandreject width_type. Syntax for the command is : "width_type" |
Default('q')
|
width
|
Double
|
Change bandreject width. Syntax for the command is : "width" |
Default('0.5')
|
mix
|
Double
|
Change bandreject mix. Syntax for the command is : "mix" |
Default('1')
|
channels
|
String
|
Specify which channels to filter, by default all available are filtered. |
Default('all')
|
normalize
|
Boolean
|
Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. |
Default('false')
|
transform
|
Int | Literal['di', 'dii', 'tdi', 'tdii', 'latt', 'svf', 'zdf'] | Default
|
Set transform type of IIR filter. @end table |
Default('di')
|
precision
|
Int | Literal['auto', 's16', 's32', 'f32', 'f64'] | Default
|
Set precison of filtering. @end table |
Default('auto')
|
blocksize
|
Int
|
set the block size (from 0 to 32768) (default 0) |
Default('0')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
bass
¶
bass(
*,
frequency: Double = Default("100"),
width_type: (
Int | Literal["h", "q", "o", "s", "k"] | Default
) = Default("q"),
width: Double = Default("0.5"),
gain: Double = Default("0"),
poles: Int = Default("2"),
mix: Double = Default("1"),
channels: String = Default("all"),
normalize: Boolean = Default("false"),
transform: (
Int
| Literal[
"di", "dii", "tdi", "tdii", "latt", "svf", "zdf"
]
| Default
) = Default("di"),
precision: (
Int
| Literal["auto", "s16", "s32", "f32", "f64"]
| Default
) = Default("auto"),
blocksize: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Boost or cut the bass (lower) frequencies of the audio using a two-pole shelving filter with a response similar to that of a standard hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequency
|
Double
|
Change bass frequency. Syntax for the command is : "frequency" |
Default('100')
|
width_type
|
Int | Literal['h', 'q', 'o', 's', 'k'] | Default
|
Change bass width_type. Syntax for the command is : "width_type" |
Default('q')
|
width
|
Double
|
Change bass width. Syntax for the command is : "width" |
Default('0.5')
|
gain
|
Double
|
Change bass gain. Syntax for the command is : "gain" |
Default('0')
|
poles
|
Int
|
Set number of poles. Default is 2. |
Default('2')
|
mix
|
Double
|
Change bass mix. Syntax for the command is : "mix" |
Default('1')
|
channels
|
String
|
Specify which channels to filter, by default all available are filtered. |
Default('all')
|
normalize
|
Boolean
|
Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. |
Default('false')
|
transform
|
Int | Literal['di', 'dii', 'tdi', 'tdii', 'latt', 'svf', 'zdf'] | Default
|
Set transform type of IIR filter. @end table |
Default('di')
|
precision
|
Int | Literal['auto', 's16', 's32', 'f32', 'f64'] | Default
|
Set precison of filtering. @end table |
Default('auto')
|
blocksize
|
Int
|
set the block size (from 0 to 32768) (default 0) |
Default('0')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
bbox
¶
bbox(
*,
min_val: Int = Default("16"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Compute the bounding box for the non-black pixels in the input frame luminance plane.
This filter computes the bounding box containing all the pixels with a luminance value greater than the minimum allowed value. The parameters describing the bounding box are printed on the filter log.
The filter accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_val
|
Int
|
Set the minimal luminance value. Default is 16. |
Default('16')
|
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
bench
¶
bench(
*,
action: (
Int | Literal["start", "stop"] | Default
) = Default("start"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Benchmark part of a filtergraph.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
Int | Literal['start', 'stop'] | Default
|
Start or stop a timer. Available values are: @end table |
Default('start')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
bilateral
¶
bilateral(
*,
sigmaS: Float = Default("0.1"),
sigmaR: Float = Default("0.1"),
planes: Int = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply bilateral filter, spatial smoothing while preserving edges.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigmaS
|
Float
|
Set sigma of gaussian function to calculate spatial weight. Allowed range is 0 to 512. Default is 0.1. |
Default('0.1')
|
sigmaR
|
Float
|
Set sigma of gaussian function to calculate range weight. Allowed range is 0 to 1. Default is 0.1. |
Default('0.1')
|
planes
|
Int
|
Set planes to filter. Default is first only. |
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
biquad
¶
biquad(
*,
a0: Double = Default("1"),
a1: Double = Default("0"),
mix: Double = Default("1"),
channels: String = Default("all"),
normalize: Boolean = Default("false"),
transform: (
Int
| Literal[
"di", "dii", "tdi", "tdii", "latt", "svf", "zdf"
]
| Default
) = Default("di"),
precision: (
Int
| Literal["auto", "s16", "s32", "f32", "f64"]
| Default
) = Default("auto"),
blocksize: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply a biquad IIR filter with the given coefficients. Where b0, b1, b2 and a0, a1, a2 are the numerator and denominator coefficients respectively. and channels, c specify which channels to filter, by default all available are filtered.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a0
|
Double
|
(from INT_MIN to INT_MAX) (default 1) |
Default('1')
|
a1
|
Double
|
(from INT_MIN to INT_MAX) (default 0) |
Default('0')
|
mix
|
Double
|
How much to use filtered signal in output. Default is 1. Range is between 0 and 1. |
Default('1')
|
channels
|
String
|
Specify which channels to filter, by default all available are filtered. |
Default('all')
|
normalize
|
Boolean
|
Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. |
Default('false')
|
transform
|
Int | Literal['di', 'dii', 'tdi', 'tdii', 'latt', 'svf', 'zdf'] | Default
|
Set transform type of IIR filter. @end table |
Default('di')
|
precision
|
Int | Literal['auto', 's16', 's32', 'f32', 'f64'] | Default
|
Set precison of filtering. @end table |
Default('auto')
|
blocksize
|
Int
|
set the block size (from 0 to 32768) (default 0) |
Default('0')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
bitplanenoise
¶
bitplanenoise(
*,
bitplane: Int = Default("1"),
filter: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Show and measure bit plane noise.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bitplane
|
Int
|
Set which plane to analyze. Default is 1. |
Default('1')
|
filter
|
Boolean
|
Filter out noisy pixels from bitplane set above. Default is disabled. |
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
blackdetect
¶
blackdetect(
*,
d: Double = Default("2"),
picture_black_ratio_th: Double = Default("0.98"),
pixel_black_th: Double = Default("0.1"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Detect video intervals that are (almost) completely black. Can be useful to detect chapter transitions, commercials, or invalid recordings.
The filter outputs its detection analysis to both the log as well as frame metadata. If a black segment of at least the specified minimum duration is found, a line with the start and end timestamps as well as duration is printed to the log with level info. In addition, a log line with level debug is printed per frame showing the black amount detected for that frame.
The filter also attaches metadata to the first frame of a black segment with key lavfi.black_start and to the first frame after the black segment ends with key lavfi.black_end. The value is the frame's timestamp. This metadata is added regardless of the minimum duration specified.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
d
|
Double
|
Set the minimum detected black duration expressed in seconds. It must be a non-negative floating point number. Default value is 2.0. |
Default('2')
|
picture_black_ratio_th
|
Double
|
Set the threshold for considering a picture "black". Express the minimum value for the ratio: @example nb_black_pixels / nb_pixels @end example for which a picture is considered black. Default value is 0.98. |
Default('0.98')
|
pixel_black_th
|
Double
|
Set the threshold for considering a pixel "black". The threshold expresses the maximum pixel luminance value for which a pixel is considered "black". The provided value is scaled according to the following equation: @example absolute_threshold = luminance_minimum_value + pixel_black_th * luminance_range_size @end example luminance_range_size and luminance_minimum_value depend on the input video format, the range is [0-255] for YUV full-range formats and [16-235] for YUV non full-range formats. Default value is 0.10. |
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
blackframe
¶
blackframe(
*,
amount: Int = Default("98"),
threshold: Int = Default("32"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Detect frames that are (almost) completely black. Can be useful to detect chapter transitions or commercials. Output lines consist of the frame number of the detected frame, the percentage of blackness, the position in the file if known or -1 and the timestamp in seconds.
In order to display the output lines, you need to set the loglevel at least to the AV_LOG_INFO value.
This filter exports frame metadata lavfi.blackframe.pblack. The value represents the percentage of pixels in the picture that are below the threshold value.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amount
|
Int
|
The percentage of the pixels that have to be below the threshold; it defaults to 98. |
Default('98')
|
threshold
|
Int
|
The threshold below which a pixel value is considered black; it defaults to 32. |
Default('32')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
blend
¶
blend(
_bottom: VideoStream,
*,
c0_mode: (
Int
| Literal[
"addition",
"addition128",
"grainmerge",
"and",
"average",
"burn",
"darken",
"difference",
"difference128",
"grainextract",
"divide",
"dodge",
"exclusion",
"extremity",
"freeze",
"glow",
"hardlight",
"hardmix",
"heat",
"lighten",
"linearlight",
"multiply",
"multiply128",
"negation",
"normal",
"or",
"overlay",
"phoenix",
"pinlight",
"reflect",
"screen",
"softlight",
"subtract",
"vividlight",
"xor",
"softdifference",
"geometric",
"harmonic",
"bleach",
"stain",
"interpolate",
"hardoverlay",
]
| Default
) = Default("normal"),
c1_mode: (
Int
| Literal[
"addition",
"addition128",
"grainmerge",
"and",
"average",
"burn",
"darken",
"difference",
"difference128",
"grainextract",
"divide",
"dodge",
"exclusion",
"extremity",
"freeze",
"glow",
"hardlight",
"hardmix",
"heat",
"lighten",
"linearlight",
"multiply",
"multiply128",
"negation",
"normal",
"or",
"overlay",
"phoenix",
"pinlight",
"reflect",
"screen",
"softlight",
"subtract",
"vividlight",
"xor",
"softdifference",
"geometric",
"harmonic",
"bleach",
"stain",
"interpolate",
"hardoverlay",
]
| Default
) = Default("normal"),
c2_mode: (
Int
| Literal[
"addition",
"addition128",
"grainmerge",
"and",
"average",
"burn",
"darken",
"difference",
"difference128",
"grainextract",
"divide",
"dodge",
"exclusion",
"extremity",
"freeze",
"glow",
"hardlight",
"hardmix",
"heat",
"lighten",
"linearlight",
"multiply",
"multiply128",
"negation",
"normal",
"or",
"overlay",
"phoenix",
"pinlight",
"reflect",
"screen",
"softlight",
"subtract",
"vividlight",
"xor",
"softdifference",
"geometric",
"harmonic",
"bleach",
"stain",
"interpolate",
"hardoverlay",
]
| Default
) = Default("normal"),
c3_mode: (
Int
| Literal[
"addition",
"addition128",
"grainmerge",
"and",
"average",
"burn",
"darken",
"difference",
"difference128",
"grainextract",
"divide",
"dodge",
"exclusion",
"extremity",
"freeze",
"glow",
"hardlight",
"hardmix",
"heat",
"lighten",
"linearlight",
"multiply",
"multiply128",
"negation",
"normal",
"or",
"overlay",
"phoenix",
"pinlight",
"reflect",
"screen",
"softlight",
"subtract",
"vividlight",
"xor",
"softdifference",
"geometric",
"harmonic",
"bleach",
"stain",
"interpolate",
"hardoverlay",
]
| Default
) = Default("normal"),
all_mode: (
Int
| Literal[
"addition",
"addition128",
"grainmerge",
"and",
"average",
"burn",
"darken",
"difference",
"difference128",
"grainextract",
"divide",
"dodge",
"exclusion",
"extremity",
"freeze",
"glow",
"hardlight",
"hardmix",
"heat",
"lighten",
"linearlight",
"multiply",
"multiply128",
"negation",
"normal",
"or",
"overlay",
"phoenix",
"pinlight",
"reflect",
"screen",
"softlight",
"subtract",
"vividlight",
"xor",
"softdifference",
"geometric",
"harmonic",
"bleach",
"stain",
"interpolate",
"hardoverlay",
]
| Default
) = Default("-1"),
c0_expr: String = Default(None),
c1_expr: String = Default(None),
c2_expr: String = Default(None),
c3_expr: String = Default(None),
all_expr: String = Default(None),
c0_opacity: Double = Default("1"),
c1_opacity: Double = Default("1"),
c2_opacity: Double = Default("1"),
c3_opacity: Double = Default("1"),
all_opacity: Double = Default("1"),
framesync_options: FFMpegFrameSyncOption | None = None,
eof_action: str | None = None,
shortest: bool | None = None,
repeatlast: bool | None = None,
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Blend two video frames into each other.
The blend filter takes two input streams and outputs one stream, the first input is the "top" layer and second input is "bottom" layer. By default, the output terminates when the longest input terminates.
The tblend (time blend) filter takes two consecutive frames from one single stream, and outputs the result obtained by blending the new frame on top of the old frame.
A description of the accepted options follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
c0_mode
|
Int | Literal['addition', 'addition128', 'grainmerge', 'and', 'average', 'burn', 'darken', 'difference', 'difference128', 'grainextract', 'divide', 'dodge', 'exclusion', 'extremity', 'freeze', 'glow', 'hardlight', 'hardmix', 'heat', 'lighten', 'linearlight', 'multiply', 'multiply128', 'negation', 'normal', 'or', 'overlay', 'phoenix', 'pinlight', 'reflect', 'screen', 'softlight', 'subtract', 'vividlight', 'xor', 'softdifference', 'geometric', 'harmonic', 'bleach', 'stain', 'interpolate', 'hardoverlay'] | Default
|
set component #0 blend mode (from 0 to 39) (default normal) |
Default('normal')
|
c1_mode
|
Int | Literal['addition', 'addition128', 'grainmerge', 'and', 'average', 'burn', 'darken', 'difference', 'difference128', 'grainextract', 'divide', 'dodge', 'exclusion', 'extremity', 'freeze', 'glow', 'hardlight', 'hardmix', 'heat', 'lighten', 'linearlight', 'multiply', 'multiply128', 'negation', 'normal', 'or', 'overlay', 'phoenix', 'pinlight', 'reflect', 'screen', 'softlight', 'subtract', 'vividlight', 'xor', 'softdifference', 'geometric', 'harmonic', 'bleach', 'stain', 'interpolate', 'hardoverlay'] | Default
|
set component #1 blend mode (from 0 to 39) (default normal) |
Default('normal')
|
c2_mode
|
Int | Literal['addition', 'addition128', 'grainmerge', 'and', 'average', 'burn', 'darken', 'difference', 'difference128', 'grainextract', 'divide', 'dodge', 'exclusion', 'extremity', 'freeze', 'glow', 'hardlight', 'hardmix', 'heat', 'lighten', 'linearlight', 'multiply', 'multiply128', 'negation', 'normal', 'or', 'overlay', 'phoenix', 'pinlight', 'reflect', 'screen', 'softlight', 'subtract', 'vividlight', 'xor', 'softdifference', 'geometric', 'harmonic', 'bleach', 'stain', 'interpolate', 'hardoverlay'] | Default
|
set component #2 blend mode (from 0 to 39) (default normal) |
Default('normal')
|
c3_mode
|
Int | Literal['addition', 'addition128', 'grainmerge', 'and', 'average', 'burn', 'darken', 'difference', 'difference128', 'grainextract', 'divide', 'dodge', 'exclusion', 'extremity', 'freeze', 'glow', 'hardlight', 'hardmix', 'heat', 'lighten', 'linearlight', 'multiply', 'multiply128', 'negation', 'normal', 'or', 'overlay', 'phoenix', 'pinlight', 'reflect', 'screen', 'softlight', 'subtract', 'vividlight', 'xor', 'softdifference', 'geometric', 'harmonic', 'bleach', 'stain', 'interpolate', 'hardoverlay'] | Default
|
set component #3 blend mode (from 0 to 39) (default normal) |
Default('normal')
|
all_mode
|
Int | Literal['addition', 'addition128', 'grainmerge', 'and', 'average', 'burn', 'darken', 'difference', 'difference128', 'grainextract', 'divide', 'dodge', 'exclusion', 'extremity', 'freeze', 'glow', 'hardlight', 'hardmix', 'heat', 'lighten', 'linearlight', 'multiply', 'multiply128', 'negation', 'normal', 'or', 'overlay', 'phoenix', 'pinlight', 'reflect', 'screen', 'softlight', 'subtract', 'vividlight', 'xor', 'softdifference', 'geometric', 'harmonic', 'bleach', 'stain', 'interpolate', 'hardoverlay'] | Default
|
Set blend mode for specific pixel component or all pixel components in case of all_mode. Default value is normal. Available values for component modes are: @end table |
Default('-1')
|
c0_expr
|
String
|
set color component #0 expression |
Default(None)
|
c1_expr
|
String
|
set color component #1 expression |
Default(None)
|
c2_expr
|
String
|
set color component #2 expression |
Default(None)
|
c3_expr
|
String
|
set color component #3 expression |
Default(None)
|
all_expr
|
String
|
Set blend expression for specific pixel component or all pixel components in case of all_expr. Note that related mode options will be ignored if those are set. The expressions can use the following variables: @end table |
Default(None)
|
c0_opacity
|
Double
|
set color component #0 opacity (from 0 to 1) (default 1) |
Default('1')
|
c1_opacity
|
Double
|
set color component #1 opacity (from 0 to 1) (default 1) |
Default('1')
|
c2_opacity
|
Double
|
set color component #2 opacity (from 0 to 1) (default 1) |
Default('1')
|
c3_opacity
|
Double
|
set color component #3 opacity (from 0 to 1) (default 1) |
Default('1')
|
all_opacity
|
Double
|
Set blend opacity for specific pixel component or all pixel components in case of all_opacity. Only used in combination with pixel component blend modes. |
Default('1')
|
framesync_options
|
FFMpegFrameSyncOption | None
|
Framesync options |
None
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
blockdetect
¶
blockdetect(
*,
period_min: Int = Default("3"),
period_max: Int = Default("24"),
planes: Int = Default("1"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Determines blockiness of frames without altering the input frames.
Based on Remco Muijs and Ihor Kirenko: "A no-reference blocking artifact measure for adaptive video processing." 2005 13th European signal processing conference.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
period_min
|
Int
|
Minimum period to search for (from 2 to 32) (default 3) |
Default('3')
|
period_max
|
Int
|
Set minimum and maximum values for determining pixel grids (periods). Default values are [3,24]. |
Default('24')
|
planes
|
Int
|
Set planes to filter. Default is first only. |
Default('1')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
blurdetect
¶
blurdetect(
*,
high: Float = Default("0.117647"),
low: Float = Default("0.0588235"),
radius: Int = Default("50"),
block_pct: Int = Default("80"),
block_width: Int = Default("-1"),
planes: Int = Default("1"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Determines blurriness of frames without altering the input frames.
Based on Marziliano, Pina, et al. "A no-reference perceptual blur metric." Allows for a block-based abbreviation.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
high
|
Float
|
Set low and high threshold values used by the Canny thresholding algorithm. The high threshold selects the "strong" edge pixels, which are then connected through 8-connectivity with the "weak" edge pixels selected by the low threshold. low and high threshold values must be chosen in the range [0,1], and low should be lesser or equal to high. Default value for low is 20/255, and default value for high is 50/255. |
Default('0.117647')
|
low
|
Float
|
set low threshold (from 0 to 1) (default 0.0588235) |
Default('0.0588235')
|
radius
|
Int
|
Define the radius to search around an edge pixel for local maxima. |
Default('50')
|
block_pct
|
Int
|
Determine blurriness only for the most significant blocks, given in percentage. |
Default('80')
|
block_width
|
Int
|
Determine blurriness for blocks of width block_width. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of block_height. |
Default('-1')
|
planes
|
Int
|
Set planes to filter. Default is first only. |
Default('1')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
boxblur
¶
boxblur(
*,
luma_radius: String = Default("2"),
luma_power: Int = Default("2"),
chroma_radius: String = Default(None),
chroma_power: Int = Default("-1"),
alpha_radius: String = Default(None),
alpha_power: Int = Default("-1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply a boxblur algorithm to the input video.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
luma_radius
|
String
|
Radius of the luma blurring box (default "2") |
Default('2')
|
luma_power
|
Int
|
How many times should the boxblur be applied to luma (from 0 to INT_MAX) (default 2) |
Default('2')
|
chroma_radius
|
String
|
Radius of the chroma blurring box |
Default(None)
|
chroma_power
|
Int
|
How many times should the boxblur be applied to chroma (from -1 to INT_MAX) (default -1) |
Default('-1')
|
alpha_radius
|
String
|
Set an expression for the box radius in pixels used for blurring the corresponding input plane. The radius value must be a non-negative number, and must not be greater than the value of the expression min(w,h)/2 for the luma and alpha planes, and of min(cw,ch)/2 for the chroma planes. Default value for luma_radius is "2". If not specified, chroma_radius and alpha_radius default to the corresponding value set for luma_radius. The expressions can contain the following constants: @end table |
Default(None)
|
alpha_power
|
Int
|
Specify how many times the boxblur filter is applied to the corresponding plane. Default value for luma_power is 2. If not specified, chroma_power and alpha_power default to the corresponding value set for luma_power. A value of 0 will disable the effect. |
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
bwdif
¶
bwdif(
*,
mode: (
Int | Literal["send_frame", "send_field"] | Default
) = Default("send_field"),
parity: (
Int | Literal["tff", "bff", "auto"] | Default
) = Default("auto"),
deint: (
Int | Literal["all", "interlaced"] | Default
) = Default("all"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Deinterlace the input video ("bwdif" stands for "Bob Weaver Deinterlacing Filter").
Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic interpolation algorithms. It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Int | Literal['send_frame', 'send_field'] | Default
|
The interlacing mode to adopt. It accepts one of the following values: @end table The default value is send_field. |
Default('send_field')
|
parity
|
Int | Literal['tff', 'bff', 'auto'] | Default
|
The picture field parity assumed for the input interlaced video. It accepts one of the following values: @end table The default value is auto. If the interlacing is unknown or the decoder does not export this information, top field first will be assumed. |
Default('auto')
|
deint
|
Int | Literal['all', 'interlaced'] | Default
|
Specify which frames to deinterlace. Accepts one of the following values: @end table The default value is all. |
Default('all')
|
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
cas
¶
cas(
*,
strength: Float = Default("0"),
planes: Flags = Default("7"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply Contrast Adaptive Sharpen filter to video stream.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strength
|
Float
|
Set the sharpening strength. Default value is 0. |
Default('0')
|
planes
|
Flags
|
Set planes to filter. Default value is to filter all planes except alpha plane. |
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
channelmap
¶
channelmap(
*,
map: String = Default(None),
channel_layout: String = Default(None),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Remap input channels to new locations.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
map
|
String
|
Map channels from input to output. The argument is a '|'-separated list of mappings, each in the in_channel-out_channel or in_channel form. in_channel can be either the name of the input channel (e.g. FL for front left) or its index in the input channel layout. out_channel is the name of the output channel or its index in the output channel layout. If out_channel is not given then it is implicitly an index, starting with zero and increasing by one for each mapping. |
Default(None)
|
channel_layout
|
String
|
The channel layout of the output stream. |
Default(None)
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
channelsplit
¶
channelsplit(
*,
channel_layout: String = Default("stereo"),
channels: String = Default("all"),
extra_options: dict[str, Any] | None = None
) -> FilterNode
Split each channel from an input audio stream into a separate output stream.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel_layout
|
String
|
The channel layout of the input stream. The default is "stereo". |
Default('stereo')
|
channels
|
String
|
A channel layout describing the channels to be extracted as separate output streams or "all" to extract each input channel as a separate stream. The default is "all". Choosing channels not present in channel layout in the input will result in an error. |
Default('all')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
filter_node |
FilterNode
|
the filter node |
References
chorus
¶
chorus(
*,
in_gain: Float = Default("0.4"),
out_gain: Float = Default("0.4"),
delays: String = Default(None),
decays: String = Default(None),
speeds: String = Default(None),
depths: String = Default(None),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Add a chorus effect to the audio.
Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
Chorus resembles an echo effect with a short delay, but whereas with echo the delay is constant, with chorus, it is varied using using sinusoidal or triangular modulation. The modulation depth defines the range the modulated delay is played before or after the delay. Hence the delayed sound will sound slower or faster, that is the delayed sound tuned around the original one, like in a chorus where some vocals are slightly off key.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
in_gain
|
Float
|
Set input gain. Default is 0.4. |
Default('0.4')
|
out_gain
|
Float
|
Set output gain. Default is 0.4. |
Default('0.4')
|
delays
|
String
|
Set delays. A typical delay is around 40ms to 60ms. |
Default(None)
|
decays
|
String
|
Set decays. |
Default(None)
|
speeds
|
String
|
Set speeds. |
Default(None)
|
depths
|
String
|
Set depths. |
Default(None)
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
chromahold
¶
chromahold(
*,
color: Color = Default("black"),
similarity: Float = Default("0.01"),
blend: Float = Default("0"),
yuv: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Remove all color information for all colors except for certain one.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
color
|
Color
|
The color which will not be replaced with neutral chroma. |
Default('black')
|
similarity
|
Float
|
Similarity percentage with the above color. 0.01 matches only the exact key color, while 1.0 matches everything. |
Default('0.01')
|
blend
|
Float
|
Blend percentage. 0.0 makes pixels either fully gray, or not gray at all. Higher values result in more preserved color. |
Default('0')
|
yuv
|
Boolean
|
Signals that the color passed is already in YUV instead of RGB. Literal colors like "green" or "red" don't make sense with this enabled anymore. This can be used to pass exact YUV values as hexadecimal numbers. |
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
chromakey
¶
chromakey(
*,
color: Color = Default("black"),
similarity: Float = Default("0.01"),
blend: Float = Default("0"),
yuv: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
YUV colorspace color/chroma keying.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
color
|
Color
|
The color which will be replaced with transparency. |
Default('black')
|
similarity
|
Float
|
Similarity percentage with the key color. 0.01 matches only the exact key color, while 1.0 matches everything. |
Default('0.01')
|
blend
|
Float
|
Blend percentage. 0.0 makes pixels either fully transparent, or not transparent at all. Higher values result in semi-transparent pixels, with a higher transparency the more similar the pixels color is to the key color. |
Default('0')
|
yuv
|
Boolean
|
Signals that the color passed is already in YUV instead of RGB. Literal colors like "green" or "red" don't make sense with this enabled anymore. This can be used to pass exact YUV values as hexadecimal numbers. |
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
chromanr
¶
chromanr(
*,
thres: Float = Default("30"),
sizew: Int = Default("5"),
sizeh: Int = Default("5"),
stepw: Int = Default("1"),
steph: Int = Default("1"),
threy: Float = Default("200"),
threu: Float = Default("200"),
threv: Float = Default("200"),
distance: (
Int | Literal["manhattan", "euclidean"] | Default
) = Default("manhattan"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Reduce chrominance noise.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
thres
|
Float
|
Set threshold for averaging chrominance values. Sum of absolute difference of Y, U and V pixel components of current pixel and neighbour pixels lower than this threshold will be used in averaging. Luma component is left unchanged and is copied to output. Default value is 30. Allowed range is from 1 to 200. |
Default('30')
|
sizew
|
Int
|
Set horizontal radius of rectangle used for averaging. Allowed range is from 1 to 100. Default value is 5. |
Default('5')
|
sizeh
|
Int
|
Set vertical radius of rectangle used for averaging. Allowed range is from 1 to 100. Default value is 5. |
Default('5')
|
stepw
|
Int
|
Set horizontal step when averaging. Default value is 1. Allowed range is from 1 to 50. Mostly useful to speed-up filtering. |
Default('1')
|
steph
|
Int
|
Set vertical step when averaging. Default value is 1. Allowed range is from 1 to 50. Mostly useful to speed-up filtering. |
Default('1')
|
threy
|
Float
|
Set Y threshold for averaging chrominance values. Set finer control for max allowed difference between Y components of current pixel and neigbour pixels. Default value is 200. Allowed range is from 1 to 200. |
Default('200')
|
threu
|
Float
|
Set U threshold for averaging chrominance values. Set finer control for max allowed difference between U components of current pixel and neigbour pixels. Default value is 200. Allowed range is from 1 to 200. |
Default('200')
|
threv
|
Float
|
Set V threshold for averaging chrominance values. Set finer control for max allowed difference between V components of current pixel and neigbour pixels. Default value is 200. Allowed range is from 1 to 200. |
Default('200')
|
distance
|
Int | Literal['manhattan', 'euclidean'] | Default
|
Set distance type used in calculations. @end table Default distance type is manhattan. |
Default('manhattan')
|
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
chromashift
¶
chromashift(
*,
cbh: Int = Default("0"),
cbv: Int = Default("0"),
crh: Int = Default("0"),
crv: Int = Default("0"),
edge: (
Int | Literal["smear", "wrap"] | Default
) = Default("smear"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Shift chroma pixels horizontally and/or vertically.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cbh
|
Int
|
Set amount to shift chroma-blue horizontally. |
Default('0')
|
cbv
|
Int
|
Set amount to shift chroma-blue vertically. |
Default('0')
|
crh
|
Int
|
Set amount to shift chroma-red horizontally. |
Default('0')
|
crv
|
Int
|
Set amount to shift chroma-red vertically. |
Default('0')
|
edge
|
Int | Literal['smear', 'wrap'] | Default
|
Set edge mode, can be smear, default, or warp. |
Default('smear')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
ciescope
¶
ciescope(
*,
system: (
Int
| Literal[
"ntsc",
"470m",
"ebu",
"470bg",
"smpte",
"240m",
"apple",
"widergb",
"cie1931",
"hdtv",
"rec709",
"uhdtv",
"rec2020",
"dcip3",
]
| Default
) = Default("hdtv"),
cie: (
Int | Literal["xyy", "ucs", "luv"] | Default
) = Default("xyy"),
gamuts: (
Flags
| Literal[
"ntsc",
"470m",
"ebu",
"470bg",
"smpte",
"240m",
"apple",
"widergb",
"cie1931",
"hdtv",
"rec709",
"uhdtv",
"rec2020",
"dcip3",
]
| Default
) = Default("0"),
size: Int = Default("512"),
intensity: Float = Default("0.001"),
contrast: Float = Default("0.75"),
corrgamma: Boolean = Default("true"),
showwhite: Boolean = Default("false"),
gamma: Double = Default("2.6"),
fill: Boolean = Default("true"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Display CIE color diagram with pixels overlaid onto it.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
Int | Literal['ntsc', '470m', 'ebu', '470bg', 'smpte', '240m', 'apple', 'widergb', 'cie1931', 'hdtv', 'rec709', 'uhdtv', 'rec2020', 'dcip3'] | Default
|
Set color system. @end table |
Default('hdtv')
|
cie
|
Int | Literal['xyy', 'ucs', 'luv'] | Default
|
Set CIE system. @end table |
Default('xyy')
|
gamuts
|
Flags | Literal['ntsc', '470m', 'ebu', '470bg', 'smpte', '240m', 'apple', 'widergb', 'cie1931', 'hdtv', 'rec709', 'uhdtv', 'rec2020', 'dcip3'] | Default
|
Set what gamuts to draw. See system option for available values. |
Default('0')
|
size
|
Int
|
Set ciescope size, by default set to 512. |
Default('512')
|
intensity
|
Float
|
Set intensity used to map input pixel values to CIE diagram. |
Default('0.001')
|
contrast
|
Float
|
Set contrast used to draw tongue colors that are out of active color system gamut. |
Default('0.75')
|
corrgamma
|
Boolean
|
Correct gamma displayed on scope, by default enabled. |
Default('true')
|
showwhite
|
Boolean
|
Show white point on CIE diagram, by default disabled. |
Default('false')
|
gamma
|
Double
|
Set input gamma. Used only with XYZ input color space. |
Default('2.6')
|
fill
|
Boolean
|
Fill with CIE colors. By default is enabled. |
Default('true')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
codecview
¶
codecview(
*,
mv: (
Flags | Literal["pf", "bf", "bb"] | Default
) = Default("0"),
qp: Boolean = Default("false"),
mv_type: (
Flags | Literal["fp", "bp"] | Default
) = Default("0"),
frame_type: (
Flags | Literal["if", "pf", "bf"] | Default
) = Default("0"),
block: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Visualize information exported by some codecs.
Some codecs can export information through frames using side-data or other means. For example, some MPEG based codecs export motion vectors through the export_mvs flag in the codec flags2 option.
The filter accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mv
|
Flags | Literal['pf', 'bf', 'bb'] | Default
|
Set motion vectors to visualize. Available flags for mv are: @end table |
Default('0')
|
qp
|
Boolean
|
Display quantization parameters using the chroma planes. |
Default('false')
|
mv_type
|
Flags | Literal['fp', 'bp'] | Default
|
Set motion vectors type to visualize. Includes MVs from all frames unless specified by frame_type option. Available flags for mv_type are: @end table |
Default('0')
|
frame_type
|
Flags | Literal['if', 'pf', 'bf'] | Default
|
Set frame type to visualize motion vectors of. Available flags for frame_type are: @end table |
Default('0')
|
block
|
Boolean
|
Display block partition structure using the luma plane. |
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
colorbalance
¶
colorbalance(
*,
rs: Float = Default("0"),
gs: Float = Default("0"),
bs: Float = Default("0"),
rm: Float = Default("0"),
gm: Float = Default("0"),
bm: Float = Default("0"),
rh: Float = Default("0"),
gh: Float = Default("0"),
bh: Float = Default("0"),
pl: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Modify intensity of primary colors (red, green and blue) of input frames.
The filter allows an input frame to be adjusted in the shadows, midtones or highlights regions for the red-cyan, green-magenta or blue-yellow balance.
A positive adjustment value shifts the balance towards the primary color, a negative value towards the complementary color.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rs
|
Float
|
set red shadows (from -1 to 1) (default 0) |
Default('0')
|
gs
|
Float
|
set green shadows (from -1 to 1) (default 0) |
Default('0')
|
bs
|
Float
|
Adjust red, green and blue shadows (darkest pixels). |
Default('0')
|
rm
|
Float
|
set red midtones (from -1 to 1) (default 0) |
Default('0')
|
gm
|
Float
|
set green midtones (from -1 to 1) (default 0) |
Default('0')
|
bm
|
Float
|
Adjust red, green and blue midtones (medium pixels). |
Default('0')
|
rh
|
Float
|
set red highlights (from -1 to 1) (default 0) |
Default('0')
|
gh
|
Float
|
set green highlights (from -1 to 1) (default 0) |
Default('0')
|
bh
|
Float
|
Adjust red, green and blue highlights (brightest pixels). Allowed ranges for options are [-1.0, 1.0]. Defaults are 0. |
Default('0')
|
pl
|
Boolean
|
Preserve lightness when changing color balance. Default is disabled. |
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
colorchannelmixer
¶
colorchannelmixer(
*,
rr: Double = Default("1"),
rg: Double = Default("0"),
rb: Double = Default("0"),
ra: Double = Default("0"),
gr: Double = Default("0"),
gg: Double = Default("1"),
gb: Double = Default("0"),
ga: Double = Default("0"),
br: Double = Default("0"),
bg: Double = Default("0"),
bb: Double = Default("1"),
ba: Double = Default("0"),
ar: Double = Default("0"),
ag: Double = Default("0"),
ab: Double = Default("0"),
aa: Double = Default("1"),
pc: (
Int
| Literal[
"none", "lum", "max", "avg", "sum", "nrm", "pwr"
]
| Default
) = Default("none"),
pa: Double = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Adjust video input frames by re-mixing color channels.
This filter modifies a color channel by adding the values associated to the other channels of the same pixels. For example if the value to modify is red, the output value will be: @example red=redrr + bluerb + greenrg + alphara @end example
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rr
|
Double
|
set the red gain for the red channel (from -2 to 2) (default 1) |
Default('1')
|
rg
|
Double
|
set the green gain for the red channel (from -2 to 2) (default 0) |
Default('0')
|
rb
|
Double
|
set the blue gain for the red channel (from -2 to 2) (default 0) |
Default('0')
|
ra
|
Double
|
Adjust contribution of input red, green, blue and alpha channels for output red channel. Default is 1 for rr, and 0 for rg, rb and ra. |
Default('0')
|
gr
|
Double
|
set the red gain for the green channel (from -2 to 2) (default 0) |
Default('0')
|
gg
|
Double
|
set the green gain for the green channel (from -2 to 2) (default 1) |
Default('1')
|
gb
|
Double
|
set the blue gain for the green channel (from -2 to 2) (default 0) |
Default('0')
|
ga
|
Double
|
Adjust contribution of input red, green, blue and alpha channels for output green channel. Default is 1 for gg, and 0 for gr, gb and ga. |
Default('0')
|
br
|
Double
|
set the red gain for the blue channel (from -2 to 2) (default 0) |
Default('0')
|
bg
|
Double
|
set the green gain for the blue channel (from -2 to 2) (default 0) |
Default('0')
|
bb
|
Double
|
set the blue gain for the blue channel (from -2 to 2) (default 1) |
Default('1')
|
ba
|
Double
|
Adjust contribution of input red, green, blue and alpha channels for output blue channel. Default is 1 for bb, and 0 for br, bg and ba. |
Default('0')
|
ar
|
Double
|
set the red gain for the alpha channel (from -2 to 2) (default 0) |
Default('0')
|
ag
|
Double
|
set the green gain for the alpha channel (from -2 to 2) (default 0) |
Default('0')
|
ab
|
Double
|
set the blue gain for the alpha channel (from -2 to 2) (default 0) |
Default('0')
|
aa
|
Double
|
Adjust contribution of input red, green, blue and alpha channels for output alpha channel. Default is 1 for aa, and 0 for ar, ag and ab. Allowed ranges for options are [-2.0, 2.0]. |
Default('1')
|
pc
|
Int | Literal['none', 'lum', 'max', 'avg', 'sum', 'nrm', 'pwr'] | Default
|
Set preserve color mode. The accepted values are: @end table |
Default('none')
|
pa
|
Double
|
Set the preserve color amount when changing colors. Allowed range is from [0.0, 1.0]. Default is 0.0, thus disabled. |
Default('0')
|
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
colorcontrast
¶
colorcontrast(
*,
rc: Float = Default("0"),
gm: Float = Default("0"),
by: Float = Default("0"),
rcw: Float = Default("0"),
gmw: Float = Default("0"),
byw: Float = Default("0"),
pl: Float = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Adjust color contrast between RGB components.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rc
|
Float
|
Set the red-cyan contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. |
Default('0')
|
gm
|
Float
|
Set the green-magenta contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. |
Default('0')
|
by
|
Float
|
Set the blue-yellow contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0. |
Default('0')
|
rcw
|
Float
|
set the red-cyan weight (from 0 to 1) (default 0) |
Default('0')
|
gmw
|
Float
|
set the green-magenta weight (from 0 to 1) (default 0) |
Default('0')
|
byw
|
Float
|
Set the weight of each rc, gm, by option value. Default value is 0.0. Allowed range is from 0.0 to 1.0. If all weights are 0.0 filtering is disabled. |
Default('0')
|
pl
|
Float
|
Set the amount of preserving lightness. Default value is 0.0. Allowed range is from 0.0 to 1.0. |
Default('0')
|
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
colorcorrect
¶
colorcorrect(
*,
rl: Float = Default("0"),
bl: Float = Default("0"),
rh: Float = Default("0"),
bh: Float = Default("0"),
saturation: Float = Default("1"),
analyze: (
Int
| Literal["manual", "average", "minmax", "median"]
| Default
) = Default("manual"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Adjust color white balance selectively for blacks and whites. This filter operates in YUV colorspace.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rl
|
Float
|
Set the red shadow spot. Allowed range is from -1.0 to 1.0. Default value is 0. |
Default('0')
|
bl
|
Float
|
Set the blue shadow spot. Allowed range is from -1.0 to 1.0. Default value is 0. |
Default('0')
|
rh
|
Float
|
Set the red highlight spot. Allowed range is from -1.0 to 1.0. Default value is 0. |
Default('0')
|
bh
|
Float
|
Set the red highlight spot. Allowed range is from -1.0 to 1.0. Default value is 0. |
Default('0')
|
saturation
|
Float
|
Set the amount of saturation. Allowed range is from -3.0 to 3.0. Default value is 1. |
Default('1')
|
analyze
|
Int | Literal['manual', 'average', 'minmax', 'median'] | Default
|
If set to anything other than manual it will analyze every frame and use derived parameters for filtering output frame. Possible values are: @end table Default value is manual. |
Default('manual')
|
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
colorhold
¶
colorhold(
*,
color: Color = Default("black"),
similarity: Float = Default("0.01"),
blend: Float = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Remove all color information for all RGB colors except for certain one.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
color
|
Color
|
The color which will not be replaced with neutral gray. |
Default('black')
|
similarity
|
Float
|
Similarity percentage with the above color. 0.01 matches only the exact key color, while 1.0 matches everything. |
Default('0.01')
|
blend
|
Float
|
Blend percentage. 0.0 makes pixels fully gray. Higher values result in more preserved color. |
Default('0')
|
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
colorize
¶
colorize(
*,
hue: Float = Default("0"),
saturation: Float = Default("0.5"),
lightness: Float = Default("0.5"),
mix: Float = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Overlay a solid color on the video stream.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hue
|
Float
|
Set the color hue. Allowed range is from 0 to 360. Default value is 0. |
Default('0')
|
saturation
|
Float
|
Set the color saturation. Allowed range is from 0 to 1. Default value is 0.5. |
Default('0.5')
|
lightness
|
Float
|
Set the color lightness. Allowed range is from 0 to 1. Default value is 0.5. |
Default('0.5')
|
mix
|
Float
|
Set the mix of source lightness. By default is set to 1.0. Allowed range is from 0.0 to 1.0. |
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
colorkey
¶
colorkey(
*,
color: Color = Default("black"),
similarity: Float = Default("0.01"),
blend: Float = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
RGB colorspace color keying. This filter operates on 8-bit RGB format frames by setting the alpha component of each pixel which falls within the similarity radius of the key color to 0. The alpha value for pixels outside the similarity radius depends on the value of the blend option.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
color
|
Color
|
Set the color for which alpha will be set to 0 (full transparency). See "Color" section in the ffmpeg-utils manual. Default is black. |
Default('black')
|
similarity
|
Float
|
Set the radius from the key color within which other colors also have full transparency. The computed distance is related to the unit fractional distance in 3D space between the RGB values of the key color and the pixel's color. Range is 0.01 to 1.0. 0.01 matches within a very small radius around the exact key color, while 1.0 matches everything. Default is 0.01. |
Default('0.01')
|
blend
|
Float
|
Set how the alpha value for pixels that fall outside the similarity radius is computed. 0.0 makes pixels either fully transparent or fully opaque. Higher values result in semi-transparent pixels, with greater transparency the more similar the pixel color is to the key color. Range is 0.0 to 1.0. Default is 0.0. |
Default('0')
|
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
colorlevels
¶
colorlevels(
*,
rimin: Double = Default("0"),
gimin: Double = Default("0"),
bimin: Double = Default("0"),
aimin: Double = Default("0"),
rimax: Double = Default("1"),
gimax: Double = Default("1"),
bimax: Double = Default("1"),
aimax: Double = Default("1"),
romin: Double = Default("0"),
gomin: Double = Default("0"),
bomin: Double = Default("0"),
aomin: Double = Default("0"),
romax: Double = Default("1"),
gomax: Double = Default("1"),
bomax: Double = Default("1"),
aomax: Double = Default("1"),
preserve: (
Int
| Literal[
"none", "lum", "max", "avg", "sum", "nrm", "pwr"
]
| Default
) = Default("none"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Adjust video input frames using levels.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rimin
|
Double
|
set input red black point (from -1 to 1) (default 0) |
Default('0')
|
gimin
|
Double
|
set input green black point (from -1 to 1) (default 0) |
Default('0')
|
bimin
|
Double
|
set input blue black point (from -1 to 1) (default 0) |
Default('0')
|
aimin
|
Double
|
Adjust red, green, blue and alpha input black point. Allowed ranges for options are [-1.0, 1.0]. Defaults are 0. |
Default('0')
|
rimax
|
Double
|
set input red white point (from -1 to 1) (default 1) |
Default('1')
|
gimax
|
Double
|
set input green white point (from -1 to 1) (default 1) |
Default('1')
|
bimax
|
Double
|
set input blue white point (from -1 to 1) (default 1) |
Default('1')
|
aimax
|
Double
|
Adjust red, green, blue and alpha input white point. Allowed ranges for options are [-1.0, 1.0]. Defaults are 1. Input levels are used to lighten highlights (bright tones), darken shadows (dark tones), change the balance of bright and dark tones. |
Default('1')
|
romin
|
Double
|
set output red black point (from 0 to 1) (default 0) |
Default('0')
|
gomin
|
Double
|
set output green black point (from 0 to 1) (default 0) |
Default('0')
|
bomin
|
Double
|
set output blue black point (from 0 to 1) (default 0) |
Default('0')
|
aomin
|
Double
|
Adjust red, green, blue and alpha output black point. Allowed ranges for options are [0, 1.0]. Defaults are 0. |
Default('0')
|
romax
|
Double
|
set output red white point (from 0 to 1) (default 1) |
Default('1')
|
gomax
|
Double
|
set output green white point (from 0 to 1) (default 1) |
Default('1')
|
bomax
|
Double
|
set output blue white point (from 0 to 1) (default 1) |
Default('1')
|
aomax
|
Double
|
Adjust red, green, blue and alpha output white point. Allowed ranges for options are [0, 1.0]. Defaults are 1. Output levels allows manual selection of a constrained output level range. |
Default('1')
|
preserve
|
Int | Literal['none', 'lum', 'max', 'avg', 'sum', 'nrm', 'pwr'] | Default
|
Set preserve color mode. The accepted values are: @end table |
Default('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
colormap
¶
colormap(
_source: VideoStream,
_target: VideoStream,
*,
patch_size: Image_size = Default("64x64"),
nb_patches: Int = Default("0"),
type: (
Int | Literal["relative", "absolute"] | Default
) = Default("absolute"),
kernel: (
Int | Literal["euclidean", "weuclidean"] | Default
) = Default("euclidean"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply custom color maps to video stream.
This filter needs three input video streams. First stream is video stream that is going to be filtered out. Second and third video stream specify color patches for source color to target color mapping.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
patch_size
|
Image_size
|
Set the source and target video stream patch size in pixels. |
Default('64x64')
|
nb_patches
|
Int
|
Set the max number of used patches from source and target video stream. Default value is number of patches available in additional video streams. Max allowed number of patches is 64. |
Default('0')
|
type
|
Int | Literal['relative', 'absolute'] | Default
|
Set the adjustments used for target colors. Can be relative or absolute. Defaults is absolute. |
Default('absolute')
|
kernel
|
Int | Literal['euclidean', 'weuclidean'] | Default
|
Set the kernel used to measure color differences between mapped colors. The accepted values are: @end table Default is euclidean. |
Default('euclidean')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
colormatrix
¶
colormatrix(
*,
src: (
Int
| Literal[
"bt709",
"fcc",
"bt601",
"bt470",
"bt470bg",
"smpte170m",
"smpte240m",
"bt2020",
]
| Default
) = Default("-1"),
dst: (
Int
| Literal[
"bt709",
"fcc",
"bt601",
"bt470",
"bt470bg",
"smpte170m",
"smpte240m",
"bt2020",
]
| Default
) = Default("-1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert color matrix.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
src
|
Int | Literal['bt709', 'fcc', 'bt601', 'bt470', 'bt470bg', 'smpte170m', 'smpte240m', 'bt2020'] | Default
|
set source color matrix (from -1 to 4) (default -1) |
Default('-1')
|
dst
|
Int | Literal['bt709', 'fcc', 'bt601', 'bt470', 'bt470bg', 'smpte170m', 'smpte240m', 'bt2020'] | Default
|
Specify the source and destination color matrix. Both values must be specified. The accepted values are: @end table |
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
colorspace
¶
colorspace(
*,
all: (
Int
| Literal[
"bt470m",
"bt470bg",
"bt601-6-525",
"bt601-6-625",
"bt709",
"smpte170m",
"smpte240m",
"bt2020",
]
| Default
) = Default("0"),
space: (
Int
| Literal[
"bt709",
"fcc",
"bt470bg",
"smpte170m",
"smpte240m",
"ycgco",
"gbr",
"bt2020nc",
"bt2020ncl",
]
| Default
) = Default("2"),
range: (
Int | Literal["tv", "mpeg", "pc", "jpeg"] | Default
) = Default("0"),
primaries: (
Int
| Literal[
"bt709",
"bt470m",
"bt470bg",
"smpte170m",
"smpte240m",
"smpte428",
"film",
"smpte431",
"smpte432",
"bt2020",
"jedec-p22",
"ebu3213",
]
| Default
) = Default("2"),
trc: (
Int
| Literal[
"bt709",
"bt470m",
"gamma22",
"bt470bg",
"gamma28",
"smpte170m",
"smpte240m",
"linear",
"srgb",
"iec61966-2-1",
"xvycc",
"iec61966-2-4",
"bt2020-10",
"bt2020-12",
]
| Default
) = Default("2"),
format: (
Int
| Literal[
"yuv420p",
"yuv420p10",
"yuv420p12",
"yuv422p",
"yuv422p10",
"yuv422p12",
"yuv444p",
"yuv444p10",
"yuv444p12",
]
| Default
) = Default("-1"),
fast: Boolean = Default("false"),
dither: (
Int | Literal["none", "fsb"] | Default
) = Default("none"),
wpadapt: (
Int
| Literal["bradford", "vonkries", "identity"]
| Default
) = Default("bradford"),
iall: (
Int
| Literal[
"bt470m",
"bt470bg",
"bt601-6-525",
"bt601-6-625",
"bt709",
"smpte170m",
"smpte240m",
"bt2020",
]
| Default
) = Default("0"),
ispace: (
Int
| Literal[
"bt709",
"fcc",
"bt470bg",
"smpte170m",
"smpte240m",
"ycgco",
"gbr",
"bt2020nc",
"bt2020ncl",
]
| Default
) = Default("2"),
irange: (
Int | Literal["tv", "mpeg", "pc", "jpeg"] | Default
) = Default("0"),
iprimaries: (
Int
| Literal[
"bt709",
"bt470m",
"bt470bg",
"smpte170m",
"smpte240m",
"smpte428",
"film",
"smpte431",
"smpte432",
"bt2020",
"jedec-p22",
"ebu3213",
]
| Default
) = Default("2"),
itrc: (
Int
| Literal[
"bt709",
"bt470m",
"gamma22",
"bt470bg",
"gamma28",
"smpte170m",
"smpte240m",
"linear",
"srgb",
"iec61966-2-1",
"xvycc",
"iec61966-2-4",
"bt2020-10",
"bt2020-12",
]
| Default
) = Default("2"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert colorspace, transfer characteristics or color primaries. Input video needs to have an even size.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
all
|
Int | Literal['bt470m', 'bt470bg', 'bt601-6-525', 'bt601-6-625', 'bt709', 'smpte170m', 'smpte240m', 'bt2020'] | Default
|
Specify all color properties at once. The accepted values are: @end table @anchor{space} |
Default('0')
|
space
|
Int | Literal['bt709', 'fcc', 'bt470bg', 'smpte170m', 'smpte240m', 'ycgco', 'gbr', 'bt2020nc', 'bt2020ncl'] | Default
|
Specify output colorspace. The accepted values are: @end table @anchor{trc} |
Default('2')
|
range
|
Int | Literal['tv', 'mpeg', 'pc', 'jpeg'] | Default
|
Specify output color range. The accepted values are: @end table |
Default('0')
|
primaries
|
Int | Literal['bt709', 'bt470m', 'bt470bg', 'smpte170m', 'smpte240m', 'smpte428', 'film', 'smpte431', 'smpte432', 'bt2020', 'jedec-p22', 'ebu3213'] | Default
|
Specify output color primaries. The accepted values are: @end table @anchor{range} |
Default('2')
|
trc
|
Int | Literal['bt709', 'bt470m', 'gamma22', 'bt470bg', 'gamma28', 'smpte170m', 'smpte240m', 'linear', 'srgb', 'iec61966-2-1', 'xvycc', 'iec61966-2-4', 'bt2020-10', 'bt2020-12'] | Default
|
Specify output transfer characteristics. The accepted values are: @end table @anchor{primaries} |
Default('2')
|
format
|
Int | Literal['yuv420p', 'yuv420p10', 'yuv420p12', 'yuv422p', 'yuv422p10', 'yuv422p12', 'yuv444p', 'yuv444p10', 'yuv444p12'] | Default
|
Specify output color format. The accepted values are: @end table |
Default('-1')
|
fast
|
Boolean
|
Do a fast conversion, which skips gamma/primary correction. This will take significantly less CPU, but will be mathematically incorrect. To get output compatible with that produced by the colormatrix filter, use fast=1. |
Default('false')
|
dither
|
Int | Literal['none', 'fsb'] | Default
|
Specify dithering mode. The accepted values are: @end table |
Default('none')
|
wpadapt
|
Int | Literal['bradford', 'vonkries', 'identity'] | Default
|
Whitepoint adaptation mode. The accepted values are: @end table |
Default('bradford')
|
iall
|
Int | Literal['bt470m', 'bt470bg', 'bt601-6-525', 'bt601-6-625', 'bt709', 'smpte170m', 'smpte240m', 'bt2020'] | Default
|
Override all input properties at once. Same accepted values as all. |
Default('0')
|
ispace
|
Int | Literal['bt709', 'fcc', 'bt470bg', 'smpte170m', 'smpte240m', 'ycgco', 'gbr', 'bt2020nc', 'bt2020ncl'] | Default
|
Override input colorspace. Same accepted values as space. |
Default('2')
|
irange
|
Int | Literal['tv', 'mpeg', 'pc', 'jpeg'] | Default
|
Override input color range. Same accepted values as range. |
Default('0')
|
iprimaries
|
Int | Literal['bt709', 'bt470m', 'bt470bg', 'smpte170m', 'smpte240m', 'smpte428', 'film', 'smpte431', 'smpte432', 'bt2020', 'jedec-p22', 'ebu3213'] | Default
|
Override input color primaries. Same accepted values as primaries. |
Default('2')
|
itrc
|
Int | Literal['bt709', 'bt470m', 'gamma22', 'bt470bg', 'gamma28', 'smpte170m', 'smpte240m', 'linear', 'srgb', 'iec61966-2-1', 'xvycc', 'iec61966-2-4', 'bt2020-10', 'bt2020-12'] | Default
|
Override input transfer characteristics. Same accepted values as trc. |
Default('2')
|
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
colortemperature
¶
colortemperature(
*,
temperature: Float = Default("6500"),
mix: Float = Default("1"),
pl: Float = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Adjust color temperature in video to simulate variations in ambient color temperature.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
temperature
|
Float
|
Set the temperature in Kelvin. Allowed range is from 1000 to 40000. Default value is 6500 K. |
Default('6500')
|
mix
|
Float
|
Set mixing with filtered output. Allowed range is from 0 to 1. Default value is 1. |
Default('1')
|
pl
|
Float
|
Set the amount of preserving lightness. Allowed range is from 0 to 1. Default value is 0. |
Default('0')
|
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
compand
¶
compand(
*,
attacks: String = Default("0"),
decays: String = Default("0.8"),
points: String = Default("-70/-70|-60/-20|1/0"),
soft_knee: Double = Default("0.01"),
gain: Double = Default("0"),
volume: Double = Default("0"),
delay: Double = Default("0"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Compress or expand the audio's dynamic range.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
attacks
|
String
|
set time over which increase of volume is determined (default "0") |
Default('0')
|
decays
|
String
|
A list of times in seconds for each channel over which the instantaneous level of the input signal is averaged to determine its volume. attacks refers to increase of volume and decays refers to decrease of volume. For most situations, the attack time (response to the audio getting louder) should be shorter than the decay time, because the human ear is more sensitive to sudden loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and a typical value for decay is 0.8 seconds. If specified number of attacks & decays is lower than number of channels, the last set attack/decay will be used for all remaining channels. |
Default('0.8')
|
points
|
String
|
A list of points for the transfer function, specified in dB relative to the maximum possible signal amplitude. Each key points list must be defined using the following syntax: x0/y0|x1/y1|x2/y2|.... or x0/y0 x1/y1 x2/y2 .... The input values must be in strictly increasing order but the transfer function does not have to be monotonically rising. The point 0/0 is assumed but may be overridden (by 0/out-dBn). Typical values for the transfer function are -70/-70|-60/-20|1/0. |
Default('-70/-70|-60/-20|1/0')
|
soft_knee
|
Double
|
Set the curve radius in dB for all joints. It defaults to 0.01. |
Default('0.01')
|
gain
|
Double
|
Set the additional gain in dB to be applied at all points on the transfer function. This allows for easy adjustment of the overall gain. It defaults to 0. |
Default('0')
|
volume
|
Double
|
Set an initial volume, in dB, to be assumed for each channel when filtering starts. This permits the user to supply a nominal level initially, so that, for example, a very large gain is not applied to initial signal levels before the companding has begun to operate. A typical value for audio which is initially quiet is -90 dB. It defaults to 0. |
Default('0')
|
delay
|
Double
|
Set a delay, in seconds. The input audio is analyzed immediately, but audio is delayed before being fed to the volume adjuster. Specifying a delay approximately equal to the attack/decay times allows the filter to effectively operate in predictive rather than reactive mode. It defaults to 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
compensationdelay
¶
compensationdelay(
*,
mm: Int = Default("0"),
cm: Int = Default("0"),
m: Int = Default("0"),
dry: Double = Default("0"),
wet: Double = Default("1"),
temp: Int = Default("20"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Compensation Delay Line is a metric based delay to compensate differing positions of microphones or speakers.
For example, you have recorded guitar with two microphones placed in different locations. Because the front of sound wave has fixed speed in normal conditions, the phasing of microphones can vary and depends on their location and interposition. The best sound mix can be achieved when these microphones are in phase (synchronized). Note that a distance of ~30 cm between microphones makes one microphone capture the signal in antiphase to the other microphone. That makes the final mix sound moody. This filter helps to solve phasing problems by adding different delays to each microphone track and make them synchronized.
The best result can be reached when you take one track as base and synchronize other tracks one by one with it. Remember that synchronization/delay tolerance depends on sample rate, too. Higher sample rates will give more tolerance.
The filter accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mm
|
Int
|
Set millimeters distance. This is compensation distance for fine tuning. Default is 0. |
Default('0')
|
cm
|
Int
|
Set cm distance. This is compensation distance for tightening distance setup. Default is 0. |
Default('0')
|
m
|
Int
|
Set meters distance. This is compensation distance for hard distance setup. Default is 0. |
Default('0')
|
dry
|
Double
|
Set dry amount. Amount of unprocessed (dry) signal. Default is 0. |
Default('0')
|
wet
|
Double
|
Set wet amount. Amount of processed (wet) signal. Default is 1. |
Default('1')
|
temp
|
Int
|
Set temperature in degrees Celsius. This is the temperature of the environment. Default is 20. |
Default('20')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
convolution
¶
convolution(
*,
_0m: String = Default("0 0 0 0 1 0 0 0 0"),
_1m: String = Default("0 0 0 0 1 0 0 0 0"),
_2m: String = Default("0 0 0 0 1 0 0 0 0"),
_3m: String = Default("0 0 0 0 1 0 0 0 0"),
_0rdiv: Float = Default("0"),
_1rdiv: Float = Default("0"),
_2rdiv: Float = Default("0"),
_3rdiv: Float = Default("0"),
_0bias: Float = Default("0"),
_1bias: Float = Default("0"),
_2bias: Float = Default("0"),
_3bias: Float = Default("0"),
_0mode: (
Int | Literal["square", "row", "column"] | Default
) = Default("square"),
_1mode: (
Int | Literal["square", "row", "column"] | Default
) = Default("square"),
_2mode: (
Int | Literal["square", "row", "column"] | Default
) = Default("square"),
_3mode: (
Int | Literal["square", "row", "column"] | Default
) = Default("square"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
_0m
|
String
|
set matrix for 1st plane (default "0 0 0 0 1 0 0 0 0") |
Default('0 0 0 0 1 0 0 0 0')
|
_1m
|
String
|
set matrix for 2nd plane (default "0 0 0 0 1 0 0 0 0") |
Default('0 0 0 0 1 0 0 0 0')
|
_2m
|
String
|
set matrix for 3rd plane (default "0 0 0 0 1 0 0 0 0") |
Default('0 0 0 0 1 0 0 0 0')
|
_3m
|
String
|
Set matrix for each plane. Matrix is sequence of 9, 25 or 49 signed integers in square mode, and from 1 to 49 odd number of signed integers in row mode. |
Default('0 0 0 0 1 0 0 0 0')
|
_0rdiv
|
Float
|
set rdiv for 1st plane (from 0 to INT_MAX) (default 0) |
Default('0')
|
_1rdiv
|
Float
|
set rdiv for 2nd plane (from 0 to INT_MAX) (default 0) |
Default('0')
|
_2rdiv
|
Float
|
set rdiv for 3rd plane (from 0 to INT_MAX) (default 0) |
Default('0')
|
_3rdiv
|
Float
|
Set multiplier for calculated value for each plane. If unset or 0, it will be sum of all matrix elements. |
Default('0')
|
_0bias
|
Float
|
set bias for 1st plane (from 0 to INT_MAX) (default 0) |
Default('0')
|
_1bias
|
Float
|
set bias for 2nd plane (from 0 to INT_MAX) (default 0) |
Default('0')
|
_2bias
|
Float
|
set bias for 3rd plane (from 0 to INT_MAX) (default 0) |
Default('0')
|
_3bias
|
Float
|
Set bias for each plane. This value is added to the result of the multiplication. Useful for making the overall image brighter or darker. Default is 0.0. |
Default('0')
|
_0mode
|
Int | Literal['square', 'row', 'column'] | Default
|
set matrix mode for 1st plane (from 0 to 2) (default square) |
Default('square')
|
_1mode
|
Int | Literal['square', 'row', 'column'] | Default
|
set matrix mode for 2nd plane (from 0 to 2) (default square) |
Default('square')
|
_2mode
|
Int | Literal['square', 'row', 'column'] | Default
|
set matrix mode for 3rd plane (from 0 to 2) (default square) |
Default('square')
|
_3mode
|
Int | Literal['square', 'row', 'column'] | Default
|
Set matrix mode for each plane. Can be square, row or column. Default is square. |
Default('square')
|
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
convolve
¶
convolve(
_impulse: VideoStream,
*,
planes: Int = Default("7"),
impulse: (
Int | Literal["first", "all"] | Default
) = Default("all"),
noise: Float = Default("1e-07"),
framesync_options: FFMpegFrameSyncOption | None = None,
eof_action: str | None = None,
shortest: bool | None = None,
repeatlast: bool | None = None,
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply 2D convolution of video stream in frequency domain using second stream as impulse.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planes
|
Int
|
Set which planes to process. |
Default('7')
|
impulse
|
Int | Literal['first', 'all'] | Default
|
Set which impulse video frames will be processed, can be first or all. Default is all. |
Default('all')
|
noise
|
Float
|
set noise (from 0 to 1) (default 1e-07) |
Default('1e-07')
|
framesync_options
|
FFMpegFrameSyncOption | None
|
Framesync options |
None
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
copy
¶
copy(
extra_options: dict[str, Any] | None = None,
) -> VideoStream
Copy the input video source unchanged to the output. This is mainly useful for testing purposes.
@anchor{coreimage}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
cover_rect
¶
cover_rect(
*,
cover: String = Default(None),
mode: (
Int | Literal["cover", "blur"] | Default
) = Default("blur"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Cover a rectangular object
It accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cover
|
String
|
Filepath of the optional cover image, needs to be in yuv420. |
Default(None)
|
mode
|
Int | Literal['cover', 'blur'] | Default
|
Set covering mode. It accepts the following values: @end table Default value is blur. |
Default('blur')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
crop
¶
crop(
*,
out_w: String = Default("iw"),
out_h: String = Default("ih"),
x: String = Default("(in_w-out_w)/2"),
y: String = Default("(in_h-out_h)/2"),
keep_aspect: Boolean = Default("false"),
exact: Boolean = Default("false"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Crop the input video to given dimensions.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
out_w
|
String
|
set the width crop area expression (default "iw") |
Default('iw')
|
out_h
|
String
|
set the height crop area expression (default "ih") |
Default('ih')
|
x
|
String
|
set the x crop area expression (default "(in_w-out_w)/2") |
Default('(in_w-out_w)/2')
|
y
|
String
|
Set width/height of the output video and the horizontal/vertical position in the input video. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. |
Default('(in_h-out_h)/2')
|
keep_aspect
|
Boolean
|
If set to 1 will force the output display aspect ratio to be the same of the input, by changing the output sample aspect ratio. It defaults to 0. |
Default('false')
|
exact
|
Boolean
|
Enable exact cropping. If enabled, subsampled videos will be cropped at exact width/height/x/y as specified and will not be rounded to nearest smaller value. It defaults to 0. |
Default('false')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
cropdetect
¶
cropdetect(
*,
limit: Float = Default("0.0941176"),
round: Int = Default("16"),
reset: Int = Default("0"),
skip: Int = Default("2"),
reset_count: Int = Default("0"),
max_outliers: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Auto-detect the crop size.
It calculates the necessary cropping parameters and prints the recommended parameters via the logging system. The detected dimensions correspond to the non-black area of the input video.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
Float
|
Set higher black value threshold, which can be optionally specified from nothing (0) to everything (255 for 8-bit based formats). An intensity value greater to the set value is considered non-black. It defaults to 24. You can also specify a value between 0.0 and 1.0 which will be scaled depending on the bitdepth of the pixel format. |
Default('0.0941176')
|
round
|
Int
|
The value which the width/height should be divisible by. It defaults to 16. The offset is automatically adjusted to center the video. Use 2 to get only even dimensions (needed for 4:2:2 video). 16 is best when encoding to most video codecs. |
Default('16')
|
reset
|
Int
|
Set the counter that determines after how many frames cropdetect will reset the previously detected largest video area and start over to detect the current optimal crop area. Default value is 0. This can be useful when channel logos distort the video area. 0 indicates 'never reset', and returns the largest area encountered during playback. |
Default('0')
|
skip
|
Int
|
Set the number of initial frames for which evaluation is skipped. Default is 2. Range is 0 to INT_MAX. |
Default('2')
|
reset_count
|
Int
|
Set the counter that determines after how many frames cropdetect will reset the previously detected largest video area and start over to detect the current optimal crop area. Default value is 0. This can be useful when channel logos distort the video area. 0 indicates 'never reset', and returns the largest area encountered during playback. |
Default('0')
|
max_outliers
|
Int
|
Threshold count of outliers (from 0 to INT_MAX) (default 0) |
Default('0')
|
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
crossfeed
¶
crossfeed(
*,
strength: Double = Default("0.2"),
range: Double = Default("0.5"),
slope: Double = Default("0.5"),
level_in: Double = Default("0.9"),
level_out: Double = Default("1"),
block_size: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply headphone crossfeed filter.
Crossfeed is the process of blending the left and right channels of stereo audio recording. It is mainly used to reduce extreme stereo separation of low frequencies.
The intent is to produce more speaker like sound to the listener.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strength
|
Double
|
Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1. This sets gain of low shelf filter for side part of stereo image. Default is -6dB. Max allowed is -30db when strength is set to 1. |
Default('0.2')
|
range
|
Double
|
Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1. This sets cut off frequency of low shelf filter. Default is cut off near 1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz. |
Default('0.5')
|
slope
|
Double
|
Set curve slope of low shelf filter. Default is 0.5. Allowed range is from 0.01 to 1. |
Default('0.5')
|
level_in
|
Double
|
Set input gain. Default is 0.9. |
Default('0.9')
|
level_out
|
Double
|
Set output gain. Default is 1. |
Default('1')
|
block_size
|
Int
|
Set block size used for reverse IIR processing. If this value is set to high enough value (higher than impulse response length truncated when reaches near zero values) filtering will become linear phase otherwise if not big enough it will just produce nasty artifacts. Note that filter delay will be exactly this many samples when set to non-zero value. |
Default('0')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
crystalizer
¶
crystalizer(
*,
i: Float = Default("2"),
c: Boolean = Default("true"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Simple algorithm for audio noise sharpening.
This filter linearly increases differences betweeen each audio sample.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
i
|
Float
|
Sets the intensity of effect (default: 2.0). Must be in range between -10.0 to 0 (unchanged sound) to 10.0 (maximum effect). To inverse filtering use negative value. |
Default('2')
|
c
|
Boolean
|
Enable clipping. By default is enabled. |
Default('true')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
cue
¶
cue(
*,
cue: Int64 = Default("0"),
preroll: Duration = Default("0"),
buffer: Duration = Default("0"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Delay video filtering until a given wallclock timestamp. The filter first passes on preroll amount of frames, then it buffers at most buffer amount of frames and waits for the cue. After reaching the cue it forwards the buffered frames and also any subsequent frames coming in its input.
The filter can be used synchronize the output of multiple ffmpeg processes for realtime output devices like decklink. By putting the delay in the filtering chain and pre-buffering frames the process can pass on data to output almost immediately after the target wallclock timestamp is reached.
Perfect frame accuracy cannot be guaranteed, but the result is good enough for some use cases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cue
|
Int64
|
The cue timestamp expressed in a UNIX timestamp in microseconds. Default is 0. |
Default('0')
|
preroll
|
Duration
|
The duration of content to pass on as preroll expressed in seconds. Default is 0. |
Default('0')
|
buffer
|
Duration
|
The maximum duration of content to buffer before waiting for the cue expressed in seconds. Default is 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
curves
¶
curves(
*,
preset: (
Int
| Literal[
"none",
"color_negative",
"cross_process",
"darker",
"increase_contrast",
"lighter",
"linear_contrast",
"medium_contrast",
"negative",
"strong_contrast",
"vintage",
]
| Default
) = Default("none"),
master: String = Default(None),
red: String = Default(None),
green: String = Default(None),
blue: String = Default(None),
all: String = Default(None),
psfile: String = Default(None),
plot: String = Default(None),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply color adjustments using curves.
This filter is similar to the Adobe Photoshop and GIMP curves tools. Each component (red, green and blue) has its values defined by N key points tied from each other using a smooth curve. The x-axis represents the pixel values from the input frame, and the y-axis the new pixel values to be set for the output frame.
By default, a component curve is defined by the two points (0;0) and (1;1). This creates a straight line where each original pixel value is "adjusted" to its own value, which means no change to the image.
The filter allows you to redefine these two points and add some more. A new curve (using a natural cubic spline interpolation) will be define to pass smoothly through all these new coordinates. The new defined points needs to be strictly increasing over the x-axis, and their x and y values must be in the [0;1] interval. If the computed curves happened to go outside the vector spaces, the values will be clipped accordingly.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
preset
|
Int | Literal['none', 'color_negative', 'cross_process', 'darker', 'increase_contrast', 'lighter', 'linear_contrast', 'medium_contrast', 'negative', 'strong_contrast', 'vintage'] | Default
|
Select one of the available color presets. This option can be used in addition to the r, g, b parameters; in this case, the later options takes priority on the preset values. Available presets are: @end table Default is none. |
Default('none')
|
master
|
String
|
Set the master key points. These points will define a second pass mapping. It is sometimes called a "luminance" or "value" mapping. It can be used with r, g, b or all since it acts like a post-processing LUT. |
Default(None)
|
red
|
String
|
Set the key points for the red component. |
Default(None)
|
green
|
String
|
Set the key points for the green component. |
Default(None)
|
blue
|
String
|
Set the key points for the blue component. |
Default(None)
|
all
|
String
|
Set the key points for all components (not including master). Can be used in addition to the other key points component options. In this case, the unset component(s) will fallback on this all setting. |
Default(None)
|
psfile
|
String
|
Specify a Photoshop curves file (.acv) to import the settings from. |
Default(None)
|
plot
|
String
|
Save Gnuplot script of the curves in specified file. |
Default(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
datascope
¶
datascope(
*,
size: Image_size = Default("hd720"),
x: Int = Default("0"),
y: Int = Default("0"),
mode: (
Int | Literal["mono", "color", "color2"] | Default
) = Default("mono"),
axis: Boolean = Default("false"),
opacity: Float = Default("0.75"),
format: Int | Literal["hex", "dec"] | Default = Default(
"hex"
),
components: Int = Default("15"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Video data analysis filter.
This filter shows hexadecimal pixel values of part of video.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
Image_size
|
Set output video size. |
Default('hd720')
|
x
|
Int
|
Set x offset from where to pick pixels. |
Default('0')
|
y
|
Int
|
Set y offset from where to pick pixels. |
Default('0')
|
mode
|
Int | Literal['mono', 'color', 'color2'] | Default
|
Set scope mode, can be one of the following: @end table |
Default('mono')
|
axis
|
Boolean
|
Draw rows and columns numbers on left and top of video. |
Default('false')
|
opacity
|
Float
|
Set background opacity. |
Default('0.75')
|
format
|
Int | Literal['hex', 'dec'] | Default
|
Set display number format. Can be hex, or dec. Default is hex. |
Default('hex')
|
components
|
Int
|
Set pixel components to display. By default all pixel components are displayed. |
Default('15')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
dblur
¶
dblur(
*,
angle: Float = Default("45"),
radius: Float = Default("5"),
planes: Int = Default("15"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply Directional blur filter.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
angle
|
Float
|
Set angle of directional blur. Default is 45. |
Default('45')
|
radius
|
Float
|
Set radius of directional blur. Default is 5. |
Default('5')
|
planes
|
Int
|
Set which planes to filter. By default all planes are filtered. |
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
dcshift
¶
dcshift(
*,
shift: Double = Default("0"),
limitergain: Double = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply a DC shift to the audio.
This can be useful to remove a DC offset (caused perhaps by a hardware problem in the recording chain) from the audio. The effect of a DC offset is reduced headroom and hence volume. The astats filter can be used to determine if a signal has a DC offset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shift
|
Double
|
Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift the audio. |
Default('0')
|
limitergain
|
Double
|
Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is used to prevent clipping. |
Default('0')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
dctdnoiz
¶
dctdnoiz(
*,
sigma: Float = Default("0"),
overlap: Int = Default("-1"),
expr: String = Default(None),
n: Int = Default("3"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Denoise frames using 2D DCT (frequency domain filtering).
This filter is not designed for real time.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma
|
Float
|
Set the noise sigma constant. This sigma defines a hard threshold of 3 * sigma; every DCT coefficient (absolute value) below this threshold with be dropped. If you need a more advanced filtering, see expr. Default is 0. |
Default('0')
|
overlap
|
Int
|
Set number overlapping pixels for each block. Since the filter can be slow, you may want to reduce this value, at the cost of a less effective filter and the risk of various artefacts. If the overlapping value doesn't permit processing the whole input width or height, a warning will be displayed and according borders won't be denoised. Default value is blocksize-1, which is the best possible setting. |
Default('-1')
|
expr
|
String
|
Set the coefficient factor expression. For each coefficient of a DCT block, this expression will be evaluated as a multiplier value for the coefficient. If this is option is set, the sigma option will be ignored. The absolute value of the coefficient can be accessed through the c variable. |
Default(None)
|
n
|
Int
|
Set the blocksize using the number of bits. 1<<n defines the blocksize, which is the width and height of the processed blocks. The default value is 3 (8x8) and can be raised to 4 for a blocksize of 16x16. Note that changing this setting has huge consequences on the speed processing. Also, a larger block size does not necessarily means a better de-noising. |
Default('3')
|
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
deband
¶
deband(
*,
_1thr: Float = Default("0.02"),
_2thr: Float = Default("0.02"),
_3thr: Float = Default("0.02"),
_4thr: Float = Default("0.02"),
range: Int = Default("16"),
direction: Float = Default("6.28319"),
blur: Boolean = Default("true"),
coupling: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Remove banding artifacts from input video. It works by replacing banded pixels with average value of referenced pixels.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
_1thr
|
Float
|
set 1st plane threshold (from 3e-05 to 0.5) (default 0.02) |
Default('0.02')
|
_2thr
|
Float
|
set 2nd plane threshold (from 3e-05 to 0.5) (default 0.02) |
Default('0.02')
|
_3thr
|
Float
|
set 3rd plane threshold (from 3e-05 to 0.5) (default 0.02) |
Default('0.02')
|
_4thr
|
Float
|
Set banding detection threshold for each plane. Default is 0.02. Valid range is 0.00003 to 0.5. If difference between current pixel and reference pixel is less than threshold, it will be considered as banded. |
Default('0.02')
|
range
|
Int
|
Banding detection range in pixels. Default is 16. If positive, random number in range 0 to set value will be used. If negative, exact absolute value will be used. The range defines square of four pixels around current pixel. |
Default('16')
|
direction
|
Float
|
Set direction in radians from which four pixel will be compared. If positive, random direction from 0 to set direction will be picked. If negative, exact of absolute value will be picked. For example direction 0, -PI or -2*PI radians will pick only pixels on same row and -PI/2 will pick only pixels on same column. |
Default('6.28319')
|
blur
|
Boolean
|
If enabled, current pixel is compared with average value of all four surrounding pixels. The default is enabled. If disabled current pixel is compared with all four surrounding pixels. The pixel is considered banded if only all four differences with surrounding pixels are less than threshold. |
Default('true')
|
coupling
|
Boolean
|
If enabled, current pixel is changed if and only if all pixel components are banded, e.g. banding detection threshold is triggered for all color components. The default is disabled. |
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
deblock
¶
deblock(
*,
filter: (
Int | Literal["weak", "strong"] | Default
) = Default("strong"),
block: Int = Default("8"),
alpha: Float = Default("0.098"),
beta: Float = Default("0.05"),
gamma: Float = Default("0.05"),
delta: Float = Default("0.05"),
planes: Int = Default("15"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Remove blocking artifacts from input video.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filter
|
Int | Literal['weak', 'strong'] | Default
|
Set filter type, can be weak or strong. Default is strong. This controls what kind of deblocking is applied. |
Default('strong')
|
block
|
Int
|
Set size of block, allowed range is from 4 to 512. Default is 8. |
Default('8')
|
alpha
|
Float
|
set 1st detection threshold (from 0 to 1) (default 0.098) |
Default('0.098')
|
beta
|
Float
|
set 2nd detection threshold (from 0 to 1) (default 0.05) |
Default('0.05')
|
gamma
|
Float
|
set 3rd detection threshold (from 0 to 1) (default 0.05) |
Default('0.05')
|
delta
|
Float
|
Set blocking detection thresholds. Allowed range is 0 to 1. Defaults are: 0.098 for alpha and 0.05 for the rest. Using higher threshold gives more deblocking strength. Setting alpha controls threshold detection at exact edge of block. Remaining options controls threshold detection near the edge. Each one for below/above or left/right. Setting any of those to 0 disables deblocking. |
Default('0.05')
|
planes
|
Int
|
Set planes to filter. Default is to filter all available planes. |
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
deconvolve
¶
deconvolve(
_impulse: VideoStream,
*,
planes: Int = Default("7"),
impulse: (
Int | Literal["first", "all"] | Default
) = Default("all"),
noise: Float = Default("1e-07"),
framesync_options: FFMpegFrameSyncOption | None = None,
eof_action: str | None = None,
shortest: bool | None = None,
repeatlast: bool | None = None,
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply 2D deconvolution of video stream in frequency domain using second stream as impulse.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planes
|
Int
|
Set which planes to process. |
Default('7')
|
impulse
|
Int | Literal['first', 'all'] | Default
|
Set which impulse video frames will be processed, can be first or all. Default is all. |
Default('all')
|
noise
|
Float
|
Set noise when doing divisions. Default is 0.0000001. Useful when width and height are not same and not power of 2 or if stream prior to convolving had noise. |
Default('1e-07')
|
framesync_options
|
FFMpegFrameSyncOption | None
|
Framesync options |
None
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
dedot
¶
dedot(
*,
m: (
Flags | Literal["dotcrawl", "rainbows"] | Default
) = Default("dotcrawl+rainbows"),
lt: Float = Default("0.079"),
tl: Float = Default("0.079"),
tc: Float = Default("0.058"),
ct: Float = Default("0.019"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from video.
It accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m
|
Flags | Literal['dotcrawl', 'rainbows'] | Default
|
Set mode of operation. Can be combination of dotcrawl for cross-luminance reduction and/or rainbows for cross-color reduction. |
Default('dotcrawl+rainbows')
|
lt
|
Float
|
Set spatial luma threshold. Lower values increases reduction of cross-luminance. |
Default('0.079')
|
tl
|
Float
|
Set tolerance for temporal luma. Higher values increases reduction of cross-luminance. |
Default('0.079')
|
tc
|
Float
|
Set tolerance for chroma temporal variation. Higher values increases reduction of cross-color. |
Default('0.058')
|
ct
|
Float
|
Set temporal chroma threshold. Lower values increases reduction of cross-color. |
Default('0.019')
|
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
deesser
¶
deesser(
*,
i: Double = Default("0"),
m: Double = Default("0.5"),
f: Double = Default("0.5"),
s: Int | Literal["i", "o", "e"] | Default = Default(
"o"
),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply de-essing to the audio samples.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
i
|
Double
|
Set intensity for triggering de-essing. Allowed range is from 0 to 1. Default is 0. |
Default('0')
|
m
|
Double
|
Set amount of ducking on treble part of sound. Allowed range is from 0 to 1. Default is 0.5. |
Default('0.5')
|
f
|
Double
|
How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1. Default is 0.5. |
Default('0.5')
|
s
|
Int | Literal['i', 'o', 'e'] | Default
|
Set the output mode. It accepts the following values: @end table |
Default('o')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
deflate
¶
deflate(
*,
threshold0: Int = Default("65535"),
threshold1: Int = Default("65535"),
threshold2: Int = Default("65535"),
threshold3: Int = Default("65535"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply deflate effect to the video.
This filter replaces the pixel by the local(3x3) average by taking into account only values lower than the pixel.
It accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold0
|
Int
|
set threshold for 1st plane (from 0 to 65535) (default 65535) |
Default('65535')
|
threshold1
|
Int
|
set threshold for 2nd plane (from 0 to 65535) (default 65535) |
Default('65535')
|
threshold2
|
Int
|
set threshold for 3rd plane (from 0 to 65535) (default 65535) |
Default('65535')
|
threshold3
|
Int
|
Limit the maximum change for each plane, default is 65535. If 0, plane will remain unchanged. |
Default('65535')
|
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
deflicker
¶
deflicker(
*,
size: Int = Default("5"),
mode: (
Int
| Literal[
"am", "gm", "hm", "qm", "cm", "pm", "median"
]
| Default
) = Default("am"),
bypass: Boolean = Default("false"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Remove temporal frame luminance variations.
It accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
Int
|
Set moving-average filter size in frames. Default is 5. Allowed range is 2 - 129. |
Default('5')
|
mode
|
Int | Literal['am', 'gm', 'hm', 'qm', 'cm', 'pm', 'median'] | Default
|
Set averaging mode to smooth temporal luminance variations. Available values are: @end table |
Default('am')
|
bypass
|
Boolean
|
Do not actually modify frame. Useful when one only wants metadata. |
Default('false')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
dejudder
¶
dejudder(
*,
cycle: Int = Default("4"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Remove judder produced by partially interlaced telecined content.
Judder can be introduced, for instance, by pullup filter. If the original source was partially telecined content then the output of pullup,dejudder will have a variable frame rate. May change the recorded frame rate of the container. Aside from that change, this filter will not affect constant frame rate video.
The option available in this filter is:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cycle
|
Int
|
Specify the length of the window over which the judder repeats. Accepts any integer greater than 1. Useful values are: @end table The default is 4. |
Default('4')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
delogo
¶
delogo(
*,
x: String = Default("-1"),
y: String = Default("-1"),
w: String = Default("-1"),
h: String = Default("-1"),
show: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Suppress a TV station logo by a simple interpolation of the surrounding pixels. Just set a rectangle covering the logo and watch it disappear (and sometimes something even uglier appear - your mileage may vary).
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
String
|
set logo x position (default "-1") |
Default('-1')
|
y
|
String
|
Specify the top left corner coordinates of the logo. They must be specified. |
Default('-1')
|
w
|
String
|
set logo width (default "-1") |
Default('-1')
|
h
|
String
|
Specify the width and height of the logo to clear. They must be specified. |
Default('-1')
|
show
|
Boolean
|
When set to 1, a green rectangle is drawn on the screen to simplify finding the right x, y, w, and h parameters. The default value is 0. The rectangle is drawn on the outermost pixels which will be (partly) replaced with interpolated values. The values of the next pixels immediately outside this rectangle in each direction will be used to compute the interpolated pixel values inside the rectangle. |
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
derain
¶
derain(
*,
filter_type: (
Int | Literal["derain", "dehaze"] | Default
) = Default("derain"),
dnn_backend: (
Int | Literal["native"] | Default
) = Default("native"),
model: String = Default(None),
input: String = Default("x"),
output: String = Default("y"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Remove the rain in the input image/video by applying the derain methods based on convolutional neural networks. Supported models:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filter_type
|
Int | Literal['derain', 'dehaze'] | Default
|
Specify which filter to use. This option accepts the following values: @end table Default value is derain. |
Default('derain')
|
dnn_backend
|
Int | Literal['native'] | Default
|
Specify which DNN backend to use for model loading and execution. This option accepts the following values: @end table Default value is native. |
Default('native')
|
model
|
String
|
Set path to model file specifying network architecture and its parameters. Note that different backends use different file formats. TensorFlow and native backend can load files for only its format. |
Default(None)
|
input
|
String
|
input name of the model (default "x") |
Default('x')
|
output
|
String
|
output name of the model (default "y") |
Default('y')
|
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
deshake
¶
deshake(
*,
x: Int = Default("-1"),
y: Int = Default("-1"),
w: Int = Default("-1"),
h: Int = Default("-1"),
rx: Int = Default("16"),
ry: Int = Default("16"),
edge: (
Int
| Literal["blank", "original", "clamp", "mirror"]
| Default
) = Default("mirror"),
blocksize: Int = Default("8"),
contrast: Int = Default("125"),
search: (
Int | Literal["exhaustive", "less"] | Default
) = Default("exhaustive"),
filename: String = Default(None),
opencl: Boolean = Default("false"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Attempt to fix small changes in horizontal and/or vertical shift. This filter helps remove camera shake from hand-holding a camera, bumping a tripod, moving on a vehicle, etc.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Int
|
set x for the rectangular search area (from -1 to INT_MAX) (default -1) |
Default('-1')
|
y
|
Int
|
set y for the rectangular search area (from -1 to INT_MAX) (default -1) |
Default('-1')
|
w
|
Int
|
set width for the rectangular search area (from -1 to INT_MAX) (default -1) |
Default('-1')
|
h
|
Int
|
Specify a rectangular area where to limit the search for motion vectors. If desired the search for motion vectors can be limited to a rectangular area of the frame defined by its top left corner, width and height. These parameters have the same meaning as the drawbox filter which can be used to visualise the position of the bounding box. This is useful when simultaneous movement of subjects within the frame might be confused for camera motion by the motion vector search. If any or all of x, y, w and h are set to -1 then the full frame is used. This allows later options to be set without specifying the bounding box for the motion vector search. Default - search the whole frame. |
Default('-1')
|
rx
|
Int
|
set x for the rectangular search area (from 0 to 64) (default 16) |
Default('16')
|
ry
|
Int
|
Specify the maximum extent of movement in x and y directions in the range 0-64 pixels. Default 16. |
Default('16')
|
edge
|
Int | Literal['blank', 'original', 'clamp', 'mirror'] | Default
|
Specify how to generate pixels to fill blanks at the edge of the frame. Available values are: @end table Default value is mirror. |
Default('mirror')
|
blocksize
|
Int
|
Specify the blocksize to use for motion search. Range 4-128 pixels, default 8. |
Default('8')
|
contrast
|
Int
|
Specify the contrast threshold for blocks. Only blocks with more than the specified contrast (difference between darkest and lightest pixels) will be considered. Range 1-255, default 125. |
Default('125')
|
search
|
Int | Literal['exhaustive', 'less'] | Default
|
Specify the search strategy. Available values are: @end table Default value is exhaustive. |
Default('exhaustive')
|
filename
|
String
|
If set then a detailed log of the motion search is written to the specified file. |
Default(None)
|
opencl
|
Boolean
|
ignored (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
despill
¶
despill(
*,
type: (
Int | Literal["green", "blue"] | Default
) = Default("green"),
mix: Float = Default("0.5"),
expand: Float = Default("0"),
red: Float = Default("0"),
green: Float = Default("-1"),
blue: Float = Default("0"),
brightness: Float = Default("0"),
alpha: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Remove unwanted contamination of foreground colors, caused by reflected color of greenscreen or bluescreen.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
Int | Literal['green', 'blue'] | Default
|
Set what type of despill to use. |
Default('green')
|
mix
|
Float
|
Set how spillmap will be generated. |
Default('0.5')
|
expand
|
Float
|
Set how much to get rid of still remaining spill. |
Default('0')
|
red
|
Float
|
Controls amount of red in spill area. |
Default('0')
|
green
|
Float
|
Controls amount of green in spill area. Should be -1 for greenscreen. |
Default('-1')
|
blue
|
Float
|
Controls amount of blue in spill area. Should be -1 for bluescreen. |
Default('0')
|
brightness
|
Float
|
Controls brightness of spill area, preserving colors. |
Default('0')
|
alpha
|
Boolean
|
Modify alpha from generated spillmap. |
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
detelecine
¶
detelecine(
*,
first_field: (
Int | Literal["top", "t", "bottom", "b"] | Default
) = Default("top"),
pattern: String = Default("23"),
start_frame: Int = Default("0"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply an exact inverse of the telecine operation. It requires a predefined pattern specified using the pattern option which must be the same as that passed to the telecine filter.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
first_field
|
Int | Literal['top', 't', 'bottom', 'b'] | Default
|
@end table |
Default('top')
|
pattern
|
String
|
A string of numbers representing the pulldown pattern you wish to apply. The default value is 23. |
Default('23')
|
start_frame
|
Int
|
A number representing position of the first frame with respect to the telecine pattern. This is to be used if the stream is cut. The default value is 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
dialoguenhance
¶
dialoguenhance(
*,
original: Double = Default("1"),
enhance: Double = Default("1"),
voice: Double = Default("2"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Enhance dialogue in stereo audio.
This filter accepts stereo input and produce surround (3.0) channels output. The newly produced front center channel have enhanced speech dialogue originally available in both stereo channels. This filter outputs front left and front right channels same as available in stereo input.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
original
|
Double
|
Set the original center factor to keep in front center channel output. Allowed range is from 0 to 1. Default value is 1. |
Default('1')
|
enhance
|
Double
|
Set the dialogue enhance factor to put in front center channel output. Allowed range is from 0 to 3. Default value is 1. |
Default('1')
|
voice
|
Double
|
Set the voice detection factor. Allowed range is from 2 to 32. Default value is 2. |
Default('2')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
dilation
¶
dilation(
*,
coordinates: Int = Default("255"),
threshold0: Int = Default("65535"),
threshold1: Int = Default("65535"),
threshold2: Int = Default("65535"),
threshold3: Int = Default("65535"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply dilation effect to the video.
This filter replaces the pixel by the local(3x3) maximum.
It accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coordinates
|
Int
|
Flag which specifies the pixel to refer to. Default is 255 i.e. all eight pixels are used. Flags to local 3x3 coordinates maps like this: 1 2 3 4 5 6 7 8 |
Default('255')
|
threshold0
|
Int
|
set threshold for 1st plane (from 0 to 65535) (default 65535) |
Default('65535')
|
threshold1
|
Int
|
set threshold for 2nd plane (from 0 to 65535) (default 65535) |
Default('65535')
|
threshold2
|
Int
|
set threshold for 3rd plane (from 0 to 65535) (default 65535) |
Default('65535')
|
threshold3
|
Int
|
Limit the maximum change for each plane, default is 65535. If 0, plane will remain unchanged. |
Default('65535')
|
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
displace
¶
displace(
_xmap: VideoStream,
_ymap: VideoStream,
*,
edge: (
Int
| Literal["blank", "smear", "wrap", "mirror"]
| Default
) = Default("smear"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Displace pixels as indicated by second and third input stream.
It takes three input streams and outputs one stream, the first input is the source, and second and third input are displacement maps.
The second input specifies how much to displace pixels along the x-axis, while the third input specifies how much to displace pixels along the y-axis. If one of displacement map streams terminates, last frame from that displacement map will be used.
Note that once generated, displacements maps can be reused over and over again.
A description of the accepted options follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
edge
|
Int | Literal['blank', 'smear', 'wrap', 'mirror'] | Default
|
Set displace behavior for pixels that are out of range. Available values are: @end table Default is smear. |
Default('smear')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
dnn_classify
¶
dnn_classify(
*,
dnn_backend: Int = Default("2"),
model: String = Default(None),
input: String = Default(None),
output: String = Default(None),
backend_configs: String = Default(None),
options: String = Default(None),
_async: Boolean = Default("true"),
confidence: Float = Default("0.5"),
labels: String = Default(None),
target: String = Default(None),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Do classification with deep neural networks based on bounding boxes.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dnn_backend
|
Int
|
Specify which DNN backend to use for model loading and execution. This option accepts only openvino now, tensorflow backends will be added. |
Default('2')
|
model
|
String
|
Set path to model file specifying network architecture and its parameters. Note that different backends use different file formats. |
Default(None)
|
input
|
String
|
Set the input name of the dnn network. |
Default(None)
|
output
|
String
|
Set the output name of the dnn network. |
Default(None)
|
backend_configs
|
String
|
Set the configs to be passed into backend For tensorflow backend, you can set its configs with sess_config options, please use tools/python/tf_sess_config.py to get the configs for your system. |
Default(None)
|
options
|
String
|
backend configs (deprecated, use backend_configs) |
Default(None)
|
_async
|
Boolean
|
use DNN async inference (ignored, use backend_configs='async=1') (default true) |
Default('true')
|
confidence
|
Float
|
Set the confidence threshold (default: 0.5). |
Default('0.5')
|
labels
|
String
|
Set path to label file specifying the mapping between label id and name. Each label name is written in one line, tailing spaces and empty lines are skipped. The first line is the name of label id 0, and the second line is the name of label id 1, etc. The label id is considered as name if the label file is not provided. |
Default(None)
|
target
|
String
|
which one to be classified |
Default(None)
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
dnn_detect
¶
dnn_detect(
*,
dnn_backend: Int = Default("2"),
model: String = Default(None),
input: String = Default(None),
output: String = Default(None),
backend_configs: String = Default(None),
options: String = Default(None),
_async: Boolean = Default("true"),
confidence: Float = Default("0.5"),
labels: String = Default(None),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Do object detection with deep neural networks.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dnn_backend
|
Int
|
Specify which DNN backend to use for model loading and execution. This option accepts only openvino now, tensorflow backends will be added. |
Default('2')
|
model
|
String
|
Set path to model file specifying network architecture and its parameters. Note that different backends use different file formats. |
Default(None)
|
input
|
String
|
Set the input name of the dnn network. |
Default(None)
|
output
|
String
|
Set the output name of the dnn network. |
Default(None)
|
backend_configs
|
String
|
Set the configs to be passed into backend. To use async execution, set async (default: set). Roll back to sync execution if the backend does not support async. |
Default(None)
|
options
|
String
|
backend configs (deprecated, use backend_configs) |
Default(None)
|
_async
|
Boolean
|
use DNN async inference (ignored, use backend_configs='async=1') (default true) |
Default('true')
|
confidence
|
Float
|
Set the confidence threshold (default: 0.5). |
Default('0.5')
|
labels
|
String
|
Set path to label file specifying the mapping between label id and name. Each label name is written in one line, tailing spaces and empty lines are skipped. The first line is the name of label id 0 (usually it is 'background'), and the second line is the name of label id 1, etc. The label id is considered as name if the label file is not provided. |
Default(None)
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
dnn_processing
¶
dnn_processing(
*,
dnn_backend: (
Int | Literal["native"] | Default
) = Default("native"),
model: String = Default(None),
input: String = Default(None),
output: String = Default(None),
backend_configs: String = Default(None),
options: String = Default(None),
_async: Boolean = Default("true"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Do image processing with deep neural networks. It works together with another filter which converts the pixel format of the Frame to what the dnn network requires.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dnn_backend
|
Int | Literal['native'] | Default
|
Specify which DNN backend to use for model loading and execution. This option accepts the following values: @end table Default value is native. |
Default('native')
|
model
|
String
|
Set path to model file specifying network architecture and its parameters. Note that different backends use different file formats. TensorFlow, OpenVINO and native backend can load files for only its format. Native model file (.model) can be generated from TensorFlow model file (.pb) by using tools/python/convert.py |
Default(None)
|
input
|
String
|
Set the input name of the dnn network. |
Default(None)
|
output
|
String
|
Set the output name of the dnn network. |
Default(None)
|
backend_configs
|
String
|
Set the configs to be passed into backend. To use async execution, set async (default: set). Roll back to sync execution if the backend does not support async. For tensorflow backend, you can set its configs with sess_config options, please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system. |
Default(None)
|
options
|
String
|
backend configs (deprecated, use backend_configs) |
Default(None)
|
_async
|
Boolean
|
use DNN async inference (ignored, use backend_configs='async=1') (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
doubleweave
¶
doubleweave(
*,
first_field: (
Int | Literal["top", "t", "bottom", "b"] | Default
) = Default("top"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
The weave takes a field-based video input and join each two sequential fields into single frame, producing a new double height clip with half the frame rate and half the frame count.
The doubleweave works same as weave but without halving frame rate and frame count.
It accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
first_field
|
Int | Literal['top', 't', 'bottom', 'b'] | Default
|
Set first field. Available values are: @end table |
Default('top')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
drawbox
¶
drawbox(
*,
x: String = Default("0"),
y: String = Default("0"),
width: String = Default("0"),
height: String = Default("0"),
color: String = Default("black"),
thickness: String = Default("3"),
replace: Boolean = Default("false"),
box_source: String = Default(None),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Draw a colored box on the input image.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
String
|
set horizontal position of the left box edge (default "0") |
Default('0')
|
y
|
String
|
The x and y offset coordinates where the box is drawn. |
Default('0')
|
width
|
String
|
set width of the box (default "0") |
Default('0')
|
height
|
String
|
The expressions which specify the width and height of the box; if 0 they are interpreted as the input width and height. It defaults to 0. |
Default('0')
|
color
|
String
|
Specify the color of the box to write. For the general syntax of this option, check the "Color" section in the ffmpeg-utils manual. If the special value invert is used, the box edge color is the same as the video with inverted luma. |
Default('black')
|
thickness
|
String
|
The expression which sets the thickness of the box edge. A value of fill will create a filled box. Default value is 3. See below for the list of accepted constants. |
Default('3')
|
replace
|
Boolean
|
Applicable if the input has alpha. With value 1, the pixels of the painted box will overwrite the video's color and alpha pixels. Default is 0, which composites the box onto the input, leaving the video's alpha intact. |
Default('false')
|
box_source
|
String
|
Box source can be set as side_data_detection_bboxes if you want to use box data in detection bboxes of side data. If box_source is set, the x, y, width and height will be ignored and still use box data in detection bboxes of side data. So please do not use this parameter if you were not sure about the box source. |
Default(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
drawgraph
¶
drawgraph(
*,
m1: String = Default(""),
fg1: String = Default("0xffff0000"),
m2: String = Default(""),
fg2: String = Default("0xff00ff00"),
m3: String = Default(""),
fg3: String = Default("0xffff00ff"),
m4: String = Default(""),
fg4: String = Default("0xffffff00"),
bg: Color = Default("white"),
min: Float = Default("-1"),
max: Float = Default("1"),
mode: (
Int | Literal["bar", "dot", "line"] | Default
) = Default("line"),
slide: (
Int
| Literal[
"frame",
"replace",
"scroll",
"rscroll",
"picture",
]
| Default
) = Default("frame"),
size: Image_size = Default("900x256"),
rate: Video_rate = Default("25"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Draw a graph using input video metadata.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m1
|
String
|
Set 1st frame metadata key from which metadata values will be used to draw a graph. |
Default('')
|
fg1
|
String
|
Set 1st foreground color expression. |
Default('0xffff0000')
|
m2
|
String
|
Set 2nd frame metadata key from which metadata values will be used to draw a graph. |
Default('')
|
fg2
|
String
|
Set 2nd foreground color expression. |
Default('0xff00ff00')
|
m3
|
String
|
Set 3rd frame metadata key from which metadata values will be used to draw a graph. |
Default('')
|
fg3
|
String
|
Set 3rd foreground color expression. |
Default('0xffff00ff')
|
m4
|
String
|
Set 4th frame metadata key from which metadata values will be used to draw a graph. |
Default('')
|
fg4
|
String
|
Set 4th foreground color expression. |
Default('0xffffff00')
|
bg
|
Color
|
Set graph background color. Default is white. |
Default('white')
|
min
|
Float
|
Set minimal value of metadata value. |
Default('-1')
|
max
|
Float
|
Set maximal value of metadata value. |
Default('1')
|
mode
|
Int | Literal['bar', 'dot', 'line'] | Default
|
Set graph mode. Available values for mode is: @end table Default is line. |
Default('line')
|
slide
|
Int | Literal['frame', 'replace', 'scroll', 'rscroll', 'picture'] | Default
|
Set slide mode. Available values for slide is: @end table Default is frame. |
Default('frame')
|
size
|
Image_size
|
Set size of graph video. For the syntax of this option, check the "Video size" section in the ffmpeg-utils manual. The default value is 900x256. |
Default('900x256')
|
rate
|
Video_rate
|
Set the output frame rate. Default value is 25. The foreground color expressions can use the following variables: @end table The color is defined as 0xAABBGGRR. |
Default('25')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
drawgrid
¶
drawgrid(
*,
x: String = Default("0"),
y: String = Default("0"),
width: String = Default("0"),
height: String = Default("0"),
color: String = Default("black"),
thickness: String = Default("1"),
replace: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Draw a grid on the input image.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
String
|
set horizontal offset (default "0") |
Default('0')
|
y
|
String
|
The x and y coordinates of some point of grid intersection (meant to configure offset). |
Default('0')
|
width
|
String
|
set width of grid cell (default "0") |
Default('0')
|
height
|
String
|
The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the input width and height, respectively, minus thickness, so image gets framed. Default to 0. |
Default('0')
|
color
|
String
|
Specify the color of the grid. For the general syntax of this option, check the "Color" section in the ffmpeg-utils manual. If the special value invert is used, the grid color is the same as the video with inverted luma. |
Default('black')
|
thickness
|
String
|
The expression which sets the thickness of the grid line. Default value is 1. See below for the list of accepted constants. |
Default('1')
|
replace
|
Boolean
|
Applicable if the input has alpha. With 1 the pixels of the painted grid will overwrite the video's color and alpha pixels. Default is 0, which composites the grid onto the input, leaving the video's alpha intact. |
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
drawtext
¶
drawtext(
*,
fontfile: String = Default(None),
text: String = Default(None),
textfile: String = Default(None),
fontcolor: Color = Default("black"),
fontcolor_expr: String = Default(""),
boxcolor: Color = Default("white"),
bordercolor: Color = Default("black"),
shadowcolor: Color = Default("black"),
box: Boolean = Default("false"),
boxborderw: Int = Default("0"),
line_spacing: Int = Default("0"),
fontsize: String = Default(None),
x: String = Default("0"),
y: String = Default("0"),
shadowx: Int = Default("0"),
shadowy: Int = Default("0"),
borderw: Int = Default("0"),
tabsize: Int = Default("4"),
basetime: Int64 = Default("I64_MIN"),
font: String = Default("Sans"),
expansion: (
Int
| Literal["none", "normal", "strftime"]
| Default
) = Default("normal"),
timecode: String = Default(None),
tc24hmax: Boolean = Default("false"),
timecode_rate: Rational = Default("0/1"),
reload: Int = Default("0"),
alpha: String = Default("1"),
fix_bounds: Boolean = Default("false"),
start_number: Int = Default("0"),
text_source: String = Default(None),
ft_load_flags: (
Flags
| Literal[
"default",
"no_scale",
"no_hinting",
"render",
"no_bitmap",
"vertical_layout",
"force_autohint",
"crop_bitmap",
"pedantic",
"ignore_global_advance_width",
"no_recurse",
"ignore_transform",
"monochrome",
"linear_design",
"no_autohint",
]
| Default
) = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Draw a text string or text from a specified file on top of a video, using the libfreetype library.
To enable compilation of this filter, you need to configure FFmpeg with --enable-libfreetype. To enable default font fallback and the font option you need to configure FFmpeg with --enable-libfontconfig. To enable the text_shaping option, you need to configure FFmpeg with --enable-libfribidi.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fontfile
|
String
|
The font file to be used for drawing text. The path must be included. This parameter is mandatory if the fontconfig support is disabled. |
Default(None)
|
text
|
String
|
The text string to be drawn. The text must be a sequence of UTF-8 encoded characters. This parameter is mandatory if no file is specified with the parameter textfile. |
Default(None)
|
textfile
|
String
|
A text file containing text to be drawn. The text must be a sequence of UTF-8 encoded characters. This parameter is mandatory if no text string is specified with the parameter text. If both text and textfile are specified, an error is thrown. |
Default(None)
|
fontcolor
|
Color
|
The color to be used for drawing fonts. For the syntax of this option, check the "Color" section in the ffmpeg-utils manual. The default value of fontcolor is "black". |
Default('black')
|
fontcolor_expr
|
String
|
String which is expanded the same way as text to obtain dynamic fontcolor value. By default this option has empty value and is not processed. When this option is set, it overrides fontcolor option. |
Default('')
|
boxcolor
|
Color
|
The color to be used for drawing box around text. For the syntax of this option, check the "Color" section in the ffmpeg-utils manual. The default value of boxcolor is "white". |
Default('white')
|
bordercolor
|
Color
|
Set the color to be used for drawing border around text. For the syntax of this option, check the "Color" section in the ffmpeg-utils manual. The default value of bordercolor is "black". |
Default('black')
|
shadowcolor
|
Color
|
The color to be used for drawing a shadow behind the drawn text. For the syntax of this option, check the "Color" section in the ffmpeg-utils manual. The default value of shadowcolor is "black". |
Default('black')
|
box
|
Boolean
|
Used to draw a box around text using the background color. The value must be either 1 (enable) or 0 (disable). The default value of box is 0. |
Default('false')
|
boxborderw
|
Int
|
Set the width of the border to be drawn around the box using boxcolor. The default value of boxborderw is 0. |
Default('0')
|
line_spacing
|
Int
|
Set the line spacing in pixels of the border to be drawn around the box using box. The default value of line_spacing is 0. |
Default('0')
|
fontsize
|
String
|
The font size to be used for drawing text. The default value of fontsize is 16. |
Default(None)
|
x
|
String
|
set x expression (default "0") |
Default('0')
|
y
|
String
|
the x and y offset coordinates where the text is drawn. These parameters allow the x and y expressions to refer to each other, so you can for example specify y=x/dar. |
Default('0')
|
shadowx
|
Int
|
set shadow x offset (from INT_MIN to INT_MAX) (default 0) |
Default('0')
|
shadowy
|
Int
|
The x and y offsets for the text shadow position with respect to the position of the text. They can be either positive or negative values. The default value for both is "0". |
Default('0')
|
borderw
|
Int
|
Set the width of the border to be drawn around the text using bordercolor. The default value of borderw is 0. |
Default('0')
|
tabsize
|
Int
|
The size in number of spaces to use for rendering the tab. Default value is 4. |
Default('4')
|
basetime
|
Int64
|
Set a start time for the count. Value is in microseconds. Only applied in the deprecated strftime expansion mode. To emulate in normal expansion mode use the pts function, supplying the start time (in seconds) as the second argument. |
Default('I64_MIN')
|
font
|
String
|
The font family to be used for drawing text. By default Sans. |
Default('Sans')
|
expansion
|
Int | Literal['none', 'normal', 'strftime'] | Default
|
Select how the text is expanded. Can be either none, strftime (deprecated) or normal (default). See the drawtext_expansion section below for details. |
Default('normal')
|
timecode
|
String
|
Set the initial timecode representation in "hh:mm:ss[:;.]ff" format. It can be used with or without text parameter. timecode_rate option must be specified. |
Default(None)
|
tc24hmax
|
Boolean
|
If set to 1, the output of the timecode option will wrap around at 24 hours. Default is 0 (disabled). |
Default('false')
|
timecode_rate
|
Rational
|
Set the timecode frame rate (timecode only). Value will be rounded to nearest integer. Minimum value is "1". Drop-frame timecode is supported for frame rates 30 & 60. |
Default('0/1')
|
reload
|
Int
|
The textfile will be reloaded at specified frame interval. Be sure to update textfile atomically, or it may be read partially, or even fail. Range is 0 to INT_MAX. Default is 0. |
Default('0')
|
alpha
|
String
|
Draw the text applying alpha blending. The value can be a number between 0.0 and 1.0. The expression accepts the same variables x, y as well. The default value is 1. Please see fontcolor_expr. |
Default('1')
|
fix_bounds
|
Boolean
|
If true, check and fix text coords to avoid clipping. |
Default('false')
|
start_number
|
Int
|
The starting frame number for the n/frame_num variable. The default value is "0". |
Default('0')
|
text_source
|
String
|
Text source should be set as side_data_detection_bboxes if you want to use text data in detection bboxes of side data. If text source is set, text and textfile will be ignored and still use text data in detection bboxes of side data. So please do not use this parameter if you are not sure about the text source. |
Default(None)
|
ft_load_flags
|
Flags | Literal['default', 'no_scale', 'no_hinting', 'render', 'no_bitmap', 'vertical_layout', 'force_autohint', 'crop_bitmap', 'pedantic', 'ignore_global_advance_width', 'no_recurse', 'ignore_transform', 'monochrome', 'linear_design', 'no_autohint'] | Default
|
The flags to be used for loading the fonts. The flags map the corresponding flags supported by libfreetype, and are a combination of the following values: @end table Default value is "default". For more information consult the documentation for the FT_LOAD_* libfreetype flags. |
Default('0')
|
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
drmeter
¶
drmeter(
*,
length: Double = Default("3"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Measure audio dynamic range.
DR values of 14 and higher is found in very dynamic material. DR of 8 to 13 is found in transition material. And anything less that 8 have very poor dynamics and is very compressed.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
length
|
Double
|
Set window length in seconds used to split audio into segments of equal length. Default is 3 seconds. |
Default('3')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
dynaudnorm
¶
dynaudnorm(
*,
framelen: Int = Default("500"),
gausssize: Int = Default("31"),
peak: Double = Default("0.95"),
maxgain: Double = Default("10"),
targetrms: Double = Default("0"),
coupling: Boolean = Default("true"),
correctdc: Boolean = Default("false"),
altboundary: Boolean = Default("false"),
compress: Double = Default("0"),
threshold: Double = Default("0"),
channels: String = Default("all"),
overlap: Double = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Dynamic Audio Normalizer.
This filter applies a certain amount of gain to the input audio in order to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in contrast to more "simple" normalization algorithms, the Dynamic Audio Normalizer dynamically re-adjusts the gain factor to the input audio. This allows for applying extra gain to the "quiet" sections of the audio while avoiding distortions or clipping the "loud" sections. In other words: The Dynamic Audio Normalizer will "even out" the volume of quiet and loud sections, in the sense that the volume of each section is brought to the same target level. Note, however, that the Dynamic Audio Normalizer achieves this goal without applying "dynamic range compressing". It will retain 100% of the dynamic range within each section of the audio file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
framelen
|
Int
|
Set the frame length in milliseconds. In range from 10 to 8000 milliseconds. Default is 500 milliseconds. The Dynamic Audio Normalizer processes the input audio in small chunks, referred to as frames. This is required, because a peak magnitude has no meaning for just a single sample value. Instead, we need to determine the peak magnitude for a contiguous sequence of sample values. While a "standard" normalizer would simply use the peak magnitude of the complete file, the Dynamic Audio Normalizer determines the peak magnitude individually for each frame. The length of a frame is specified in milliseconds. By default, the Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has been found to give good results with most files. Note that the exact frame length, in number of samples, will be determined automatically, based on the sampling rate of the individual input audio file. |
Default('500')
|
gausssize
|
Int
|
Set the Gaussian filter window size. In range from 3 to 301, must be odd number. Default is 31. Probably the most important parameter of the Dynamic Audio Normalizer is the window size of the Gaussian smoothing filter. The filter's window size is specified in frames, centered around the current frame. For the sake of simplicity, this must be an odd number. Consequently, the default value of 31 takes into account the current frame, as well as the 15 preceding frames and the 15 subsequent frames. Using a larger window results in a stronger smoothing effect and thus in less gain variation, i.e. slower gain adaptation. Conversely, using a smaller window results in a weaker smoothing effect and thus in more gain variation, i.e. faster gain adaptation. In other words, the more you increase this value, the more the Dynamic Audio Normalizer will behave like a "traditional" normalization filter. On the contrary, the more you decrease this value, the more the Dynamic Audio Normalizer will behave like a dynamic range compressor. |
Default('31')
|
peak
|
Double
|
Set the target peak value. This specifies the highest permissible magnitude level for the normalized audio input. This filter will try to approach the target peak magnitude as closely as possible, but at the same time it also makes sure that the normalized signal will never exceed the peak magnitude. A frame's maximum local gain factor is imposed directly by the target peak magnitude. The default value is 0.95 and thus leaves a headroom of 5%*. It is not recommended to go above this value. |
Default('0.95')
|
maxgain
|
Double
|
Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0. The Dynamic Audio Normalizer determines the maximum possible (local) gain factor for each input frame, i.e. the maximum gain factor that does not result in clipping or distortion. The maximum gain factor is determined by the frame's highest magnitude sample. However, the Dynamic Audio Normalizer additionally bounds the frame's maximum gain factor by a predetermined (global) maximum gain factor. This is done in order to avoid excessive gain factors in "silent" or almost silent frames. By default, the maximum gain factor is 10.0, For most inputs the default value should be sufficient and it usually is not recommended to increase this value. Though, for input with an extremely low overall volume level, it may be necessary to allow even higher gain factors. Note, however, that the Dynamic Audio Normalizer does not simply apply a "hard" threshold (i.e. cut off values above the threshold). Instead, a "sigmoid" threshold function will be applied. This way, the gain factors will smoothly approach the threshold value, but never exceed that value. |
Default('10')
|
targetrms
|
Double
|
Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled. By default, the Dynamic Audio Normalizer performs "peak" normalization. This means that the maximum local gain factor for each frame is defined (only) by the frame's highest magnitude sample. This way, the samples can be amplified as much as possible without exceeding the maximum signal level, i.e. without clipping. Optionally, however, the Dynamic Audio Normalizer can also take into account the frame's root mean square, abbreviated RMS. In electrical engineering, the RMS is commonly used to determine the power of a time-varying signal. It is therefore considered that the RMS is a better approximation of the "perceived loudness" than just looking at the signal's peak magnitude. Consequently, by adjusting all frames to a constant RMS value, a uniform "perceived loudness" can be established. If a target RMS value has been specified, a frame's local gain factor is defined as the factor that would result in exactly that RMS value. Note, however, that the maximum local gain factor is still restricted by the frame's highest magnitude sample, in order to prevent clipping. |
Default('0')
|
coupling
|
Boolean
|
Enable channels coupling. By default is enabled. By default, the Dynamic Audio Normalizer will amplify all channels by the same amount. This means the same gain factor will be applied to all channels, i.e. the maximum possible gain factor is determined by the "loudest" channel. However, in some recordings, it may happen that the volume of the different channels is uneven, e.g. one channel may be "quieter" than the other one(s). In this case, this option can be used to disable the channel coupling. This way, the gain factor will be determined independently for each channel, depending only on the individual channel's highest magnitude sample. This allows for harmonizing the volume of the different channels. |
Default('true')
|
correctdc
|
Boolean
|
Enable DC bias correction. By default is disabled. An audio signal (in the time domain) is a sequence of sample values. In the Dynamic Audio Normalizer these sample values are represented in the -1.0 to 1.0 range, regardless of the original input format. Normally, the audio signal, or "waveform", should be centered around the zero point. That means if we calculate the mean value of all samples in a file, or in a single frame, then the result should be 0.0 or at least very close to that value. If, however, there is a significant deviation of the mean value from 0.0, in either positive or negative direction, this is referred to as a DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic Audio Normalizer provides optional DC bias correction. With DC bias correction enabled, the Dynamic Audio Normalizer will determine the mean value, or "DC correction" offset, of each input frame and subtract that value from all of the frame's sample values which ensures those samples are centered around 0.0 again. Also, in order to avoid "gaps" at the frame boundaries, the DC correction offset values will be interpolated smoothly between neighbouring frames. |
Default('false')
|
altboundary
|
Boolean
|
Enable alternative boundary mode. By default is disabled. The Dynamic Audio Normalizer takes into account a certain neighbourhood around each frame. This includes the preceding frames as well as the subsequent frames. However, for the "boundary" frames, located at the very beginning and at the very end of the audio file, not all neighbouring frames are available. In particular, for the first few frames in the audio file, the preceding frames are not known. And, similarly, for the last few frames in the audio file, the subsequent frames are not known. Thus, the question arises which gain factors should be assumed for the missing frames in the "boundary" region. The Dynamic Audio Normalizer implements two modes to deal with this situation. The default boundary mode assumes a gain factor of exactly 1.0 for the missing frames, resulting in a smooth "fade in" and "fade out" at the beginning and at the end of the input, respectively. |
Default('false')
|
compress
|
Double
|
Set the compress factor. In range from 0.0 to 30.0. Default is 0.0. By default, the Dynamic Audio Normalizer does not apply "traditional" compression. This means that signal peaks will not be pruned and thus the full dynamic range will be retained within each local neighbourhood. However, in some cases it may be desirable to combine the Dynamic Audio Normalizer's normalization algorithm with a more "traditional" compression. For this purpose, the Dynamic Audio Normalizer provides an optional compression (thresholding) function. If (and only if) the compression feature is enabled, all input frames will be processed by a soft knee thresholding function prior to the actual normalization process. Put simply, the thresholding function is going to prune all samples whose magnitude exceeds a certain threshold value. However, the Dynamic Audio Normalizer does not simply apply a fixed threshold value. Instead, the threshold value will be adjusted for each individual frame. In general, smaller parameters result in stronger compression, and vice versa. Values below 3.0 are not recommended, because audible distortion may appear. |
Default('0')
|
threshold
|
Double
|
Set the target threshold value. This specifies the lowest permissible magnitude level for the audio input which will be normalized. If input frame volume is above this value frame will be normalized. Otherwise frame may not be normalized at all. The default value is set to 0, which means all input frames will be normalized. This option is mostly useful if digital noise is not wanted to be amplified. |
Default('0')
|
channels
|
String
|
Specify which channels to filter, by default all available channels are filtered. |
Default('all')
|
overlap
|
Double
|
Specify overlap for frames. If set to 0 (default) no frame overlapping is done. Using >0 and <1 values will make less conservative gain adjustments, like when framelen option is set to smaller value, if framelen option value is compensated for non-zero overlap then gain adjustments will be smoother across time compared to zero overlap case. |
Default('0')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
earwax
¶
earwax(
extra_options: dict[str, Any] | None = None,
) -> AudioStream
Make audio easier to listen to on headphones.
This filter adds `cues' to 44.1kHz stereo (i.e. audio CD format) audio so that when listened to on headphones the stereo image is moved from inside your head (standard for headphones) to outside and in front of the listener (standard for speakers).
Ported from SoX.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
ebur128
¶
ebur128(
*,
video: Boolean = Default("false"),
size: Image_size = Default("640x480"),
meter: Int = Default("9"),
framelog: (
Int | Literal["info", "verbose"] | Default
) = Default("-1"),
metadata: Boolean = Default("false"),
peak: (
Flags | Literal["none", "sample", "true"] | Default
) = Default("0"),
dualmono: Boolean = Default("false"),
panlaw: Double = Default("-3.0103"),
target: Int = Default("-23"),
gauge: (
Int
| Literal["momentary", "m", "shortterm", "s"]
| Default
) = Default("momentary"),
scale: (
Int
| Literal["absolute", "LUFS", "relative", "LU"]
| Default
) = Default("absolute"),
extra_options: dict[str, Any] | None = None
) -> FilterNode
EBU R128 scanner filter. This filter takes an audio stream and analyzes its loudness level. By default, it logs a message at a frequency of 10Hz with the Momentary loudness (identified by M), Short-term loudness (S), Integrated loudness (I) and Loudness Range (LRA).
The filter can only analyze streams which have sample format is double-precision floating point. The input stream will be converted to this specification, if needed. Users may need to insert aformat and/or aresample filters after this filter to obtain the original parameters.
The filter also has a video output (see the video option) with a real time graph to observe the loudness evolution. The graphic contains the logged message mentioned above, so it is not printed anymore when this option is set, unless the verbose logging is set. The main graphing area contains the short-term loudness (3 seconds of analysis), and the gauge on the right is for the momentary loudness (400 milliseconds), but can optionally be configured to instead display short-term loudness (see gauge).
The green area marks a +/- 1LU target range around the target loudness (-23LUFS by default, unless modified through target).
More information about the Loudness Recommendation EBU R128 on http://tech.ebu.ch/loudness.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
video
|
Boolean
|
Activate the video output. The audio stream is passed unchanged whether this option is set or no. The video stream will be the first output stream if activated. Default is 0. |
Default('false')
|
size
|
Image_size
|
Set the video size. This option is for video only. For the syntax of this option, check the "Video size" section in the ffmpeg-utils manual. Default and minimum resolution is 640x480. |
Default('640x480')
|
meter
|
Int
|
Set the EBU scale meter. Default is 9. Common values are 9 and 18, respectively for EBU scale meter +9 and EBU scale meter +18. Any other integer value between this range is allowed. |
Default('9')
|
framelog
|
Int | Literal['info', 'verbose'] | Default
|
Force the frame logging level. Available values are: @end table By default, the logging level is set to info. If the video or the metadata options are set, it switches to verbose. |
Default('-1')
|
metadata
|
Boolean
|
Set metadata injection. If set to 1, the audio input will be segmented into 100ms output frames, each of them containing various loudness information in metadata. All the metadata keys are prefixed with lavfi.r128.. Default is 0. |
Default('false')
|
peak
|
Flags | Literal['none', 'sample', 'true'] | Default
|
Set peak mode(s). Available modes can be cumulated (the option is a flag type). Possible values are: @end table |
Default('0')
|
dualmono
|
Boolean
|
Treat mono input files as "dual mono". If a mono file is intended for playback on a stereo system, its EBU R128 measurement will be perceptually incorrect. If set to true, this option will compensate for this effect. Multi-channel input files are not affected by this option. |
Default('false')
|
panlaw
|
Double
|
Set a specific pan law to be used for the measurement of dual mono files. This parameter is optional, and has a default value of -3.01dB. |
Default('-3.0103')
|
target
|
Int
|
Set a specific target level (in LUFS) used as relative zero in the visualization. This parameter is optional and has a default value of -23LUFS as specified by EBU R128. However, material published online may prefer a level of -16LUFS (e.g. for use with podcasts or video platforms). |
Default('-23')
|
gauge
|
Int | Literal['momentary', 'm', 'shortterm', 's'] | Default
|
Set the value displayed by the gauge. Valid values are momentary and s shortterm. By default the momentary value will be used, but in certain scenarios it may be more useful to observe the short term value instead (e.g. live mixing). |
Default('momentary')
|
scale
|
Int | Literal['absolute', 'LUFS', 'relative', 'LU'] | Default
|
Sets the display scale for the loudness. Valid parameters are absolute (in LUFS) or relative (LU) relative to the target. This only affects the video output, not the summary or continuous log output. |
Default('absolute')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
filter_node |
FilterNode
|
the filter node |
References
edgedetect
¶
edgedetect(
*,
high: Double = Default("0.196078"),
low: Double = Default("0.0784314"),
mode: (
Int
| Literal["wires", "colormix", "canny"]
| Default
) = Default("wires"),
planes: (
Flags
| Literal["y", "u", "v", "r", "g", "b"]
| Default
) = Default("y+u+v+r+g+b"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
high
|
Double
|
Set low and high threshold values used by the Canny thresholding algorithm. The high threshold selects the "strong" edge pixels, which are then connected through 8-connectivity with the "weak" edge pixels selected by the low threshold. low and high threshold values must be chosen in the range [0,1], and low should be lesser or equal to high. Default value for low is 20/255, and default value for high is 50/255. |
Default('0.196078')
|
low
|
Double
|
set low threshold (from 0 to 1) (default 0.0784314) |
Default('0.0784314')
|
mode
|
Int | Literal['wires', 'colormix', 'canny'] | Default
|
Define the drawing mode. @end table Default value is wires. |
Default('wires')
|
planes
|
Flags | Literal['y', 'u', 'v', 'r', 'g', 'b'] | Default
|
Select planes for filtering. By default all available planes are filtered. |
Default('y+u+v+r+g+b')
|
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
elbg
¶
elbg(
*,
codebook_length: Int = Default("256"),
nb_steps: Int = Default("1"),
seed: Int64 = Default("-1"),
pal8: Boolean = Default("false"),
use_alpha: Boolean = Default("false"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
For each input image, the filter will compute the optimal mapping from the input to the output given the codebook length, that is the number of distinct output colors.
This filter accepts the following options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
codebook_length
|
Int
|
Set codebook length. The value must be a positive integer, and represents the number of distinct output colors. Default value is 256. |
Default('256')
|
nb_steps
|
Int
|
Set the maximum number of iterations to apply for computing the optimal mapping. The higher the value the better the result and the higher the computation time. Default value is 1. |
Default('1')
|
seed
|
Int64
|
Set a random seed, must be an integer included between 0 and UINT32_MAX. If not specified, or if explicitly set to -1, the filter will try to use a good random seed on a best effort basis. |
Default('-1')
|
pal8
|
Boolean
|
Set pal8 output pixel format. This option does not work with codebook length greater than 256. Default is disabled. |
Default('false')
|
use_alpha
|
Boolean
|
Include alpha values in the quantization calculation. Allows creating palettized output images (e.g. PNG8) with multiple alpha smooth blending. |
Default('false')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
entropy
¶
entropy(
*,
mode: (
Int | Literal["normal", "diff"] | Default
) = Default("normal"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Measure graylevel entropy in histogram of color channels of video frames.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Int | Literal['normal', 'diff'] | Default
|
Can be either normal or diff. Default is normal. diff mode measures entropy of histogram delta values, absolute differences between neighbour histogram values. |
Default('normal')
|
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
epx
¶
epx(
*,
n: Int = Default("3"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply the EPX magnification filter which is designed for pixel art.
It accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Int
|
Set the scaling dimension: 2 for 2xEPX, 3 for 3xEPX. Default is 3. |
Default('3')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
eq
¶
eq(
*,
contrast: String = Default("1.0"),
brightness: String = Default("0.0"),
saturation: String = Default("1.0"),
gamma: String = Default("1.0"),
gamma_r: String = Default("1.0"),
gamma_g: String = Default("1.0"),
gamma_b: String = Default("1.0"),
gamma_weight: String = Default("1.0"),
eval: (
Int | Literal["init", "frame"] | Default
) = Default("init"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Set brightness, contrast, saturation and approximate gamma adjustment.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
contrast
|
String
|
Set the contrast expression. |
Default('1.0')
|
brightness
|
String
|
Set the brightness expression. |
Default('0.0')
|
saturation
|
String
|
Set the saturation expression. |
Default('1.0')
|
gamma
|
String
|
Set the gamma expression. |
Default('1.0')
|
gamma_r
|
String
|
Set the gamma_r expression. |
Default('1.0')
|
gamma_g
|
String
|
Set gamma_g expression. |
Default('1.0')
|
gamma_b
|
String
|
Set gamma_b expression. |
Default('1.0')
|
gamma_weight
|
String
|
Set gamma_weight expression. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. |
Default('1.0')
|
eval
|
Int | Literal['init', 'frame'] | Default
|
Set when the expressions for brightness, contrast, saturation and gamma expressions are evaluated. It accepts the following values: @end table Default value is init. |
Default('init')
|
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
equalizer
¶
equalizer(
*,
frequency: Double = Default("0"),
width_type: (
Int | Literal["h", "q", "o", "s", "k"] | Default
) = Default("q"),
width: Double = Default("1"),
gain: Double = Default("0"),
mix: Double = Default("1"),
channels: String = Default("all"),
normalize: Boolean = Default("false"),
transform: (
Int
| Literal[
"di", "dii", "tdi", "tdii", "latt", "svf", "zdf"
]
| Default
) = Default("di"),
precision: (
Int
| Literal["auto", "s16", "s32", "f32", "f64"]
| Default
) = Default("auto"),
blocksize: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply a two-pole peaking equalisation (EQ) filter. With this filter, the signal-level at and around a selected frequency can be increased or decreased, whilst (unlike bandpass and bandreject filters) that at all other frequencies is unchanged.
In order to produce complex equalisation curves, this filter can be given several times, each with a different central frequency.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequency
|
Double
|
Change equalizer frequency. Syntax for the command is : "frequency" |
Default('0')
|
width_type
|
Int | Literal['h', 'q', 'o', 's', 'k'] | Default
|
Change equalizer width_type. Syntax for the command is : "width_type" |
Default('q')
|
width
|
Double
|
Change equalizer width. Syntax for the command is : "width" |
Default('1')
|
gain
|
Double
|
Change equalizer gain. Syntax for the command is : "gain" |
Default('0')
|
mix
|
Double
|
Change equalizer mix. Syntax for the command is : "mix" |
Default('1')
|
channels
|
String
|
Specify which channels to filter, by default all available are filtered. |
Default('all')
|
normalize
|
Boolean
|
Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. |
Default('false')
|
transform
|
Int | Literal['di', 'dii', 'tdi', 'tdii', 'latt', 'svf', 'zdf'] | Default
|
Set transform type of IIR filter. @end table |
Default('di')
|
precision
|
Int | Literal['auto', 's16', 's32', 'f32', 'f64'] | Default
|
Set precison of filtering. @end table |
Default('auto')
|
blocksize
|
Int
|
set the block size (from 0 to 32768) (default 0) |
Default('0')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
erosion
¶
erosion(
*,
coordinates: Int = Default("255"),
threshold0: Int = Default("65535"),
threshold1: Int = Default("65535"),
threshold2: Int = Default("65535"),
threshold3: Int = Default("65535"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply erosion effect to the video.
This filter replaces the pixel by the local(3x3) minimum.
It accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coordinates
|
Int
|
Flag which specifies the pixel to refer to. Default is 255 i.e. all eight pixels are used. Flags to local 3x3 coordinates maps like this: 1 2 3 4 5 6 7 8 |
Default('255')
|
threshold0
|
Int
|
set threshold for 1st plane (from 0 to 65535) (default 65535) |
Default('65535')
|
threshold1
|
Int
|
set threshold for 2nd plane (from 0 to 65535) (default 65535) |
Default('65535')
|
threshold2
|
Int
|
set threshold for 3rd plane (from 0 to 65535) (default 65535) |
Default('65535')
|
threshold3
|
Int
|
Limit the maximum change for each plane, default is 65535. If 0, plane will remain unchanged. |
Default('65535')
|
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
estdif
¶
estdif(
*,
mode: (
Int | Literal["frame", "field"] | Default
) = Default("field"),
parity: (
Int | Literal["tff", "bff", "auto"] | Default
) = Default("auto"),
deint: (
Int | Literal["all", "interlaced"] | Default
) = Default("all"),
rslope: Int = Default("1"),
redge: Int = Default("2"),
ecost: Float = Default("1"),
mcost: Float = Default("0.5"),
dcost: Float = Default("0.5"),
interp: (
Int | Literal["2p", "4p", "6p"] | Default
) = Default("4p"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Deinterlace the input video ("estdif" stands for "Edge Slope Tracing Deinterlacing Filter").
Spatial only filter that uses edge slope tracing algorithm to interpolate missing lines. It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Int | Literal['frame', 'field'] | Default
|
The interlacing mode to adopt. It accepts one of the following values: @end table The default value is field. |
Default('field')
|
parity
|
Int | Literal['tff', 'bff', 'auto'] | Default
|
The picture field parity assumed for the input interlaced video. It accepts one of the following values: @end table The default value is auto. If the interlacing is unknown or the decoder does not export this information, top field first will be assumed. |
Default('auto')
|
deint
|
Int | Literal['all', 'interlaced'] | Default
|
Specify which frames to deinterlace. Accepts one of the following values: @end table The default value is all. |
Default('all')
|
rslope
|
Int
|
Specify the search radius for edge slope tracing. Default value is 1. Allowed range is from 1 to 15. |
Default('1')
|
redge
|
Int
|
Specify the search radius for best edge matching. Default value is 2. Allowed range is from 0 to 15. |
Default('2')
|
ecost
|
Float
|
Specify the edge cost for edge matching. Default value is 1.0. Allowed range is from 0 to 9. |
Default('1')
|
mcost
|
Float
|
Specify the middle cost for edge matching. Default value is 0.5. Allowed range is from 0 to 1. |
Default('0.5')
|
dcost
|
Float
|
Specify the distance cost for edge matching. Default value is 0.5. Allowed range is from 0 to 1. |
Default('0.5')
|
interp
|
Int | Literal['2p', '4p', '6p'] | Default
|
Specify the interpolation used. Default is 4-point interpolation. It accepts one of the following values: @end table |
Default('4p')
|
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
exposure
¶
exposure(
*,
exposure: Float = Default("0"),
black: Float = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Adjust exposure of the video stream.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exposure
|
Float
|
Set the exposure correction in EV. Allowed range is from -3.0 to 3.0 EV Default value is 0 EV. |
Default('0')
|
black
|
Float
|
Set the black level correction. Allowed range is from -1.0 to 1.0. Default value is 0. |
Default('0')
|
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
extractplanes
¶
extractplanes(
*,
planes: (
Flags
| Literal["y", "u", "v", "r", "g", "b", "a"]
| Default
) = Default("r"),
extra_options: dict[str, Any] | None = None
) -> FilterNode
Extract color channel components from input video stream into separate grayscale video streams.
The filter accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planes
|
Flags | Literal['y', 'u', 'v', 'r', 'g', 'b', 'a'] | Default
|
Set plane(s) to extract. Available values for planes are: @end table Choosing planes not available in the input will result in an error. That means you cannot select r, g, b planes with y, u, v planes at same time. |
Default('r')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
filter_node |
FilterNode
|
the filter node |
References
extrastereo
¶
extrastereo(
*,
m: Float = Default("2.5"),
c: Boolean = Default("true"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Linearly increases the difference between left and right channels which adds some sort of "live" effect to playback.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m
|
Float
|
Sets the difference coefficient (default: 2.5). 0.0 means mono sound (average of both channels), with 1.0 sound will be unchanged, with -1.0 left and right channels will be swapped. |
Default('2.5')
|
c
|
Boolean
|
Enable clipping. By default is enabled. |
Default('true')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
fade
¶
fade(
*,
type: Int | Literal["in", "out"] | Default = Default(
"in"
),
start_frame: Int = Default("0"),
nb_frames: Int = Default("25"),
alpha: Boolean = Default("false"),
start_time: Duration = Default("0"),
duration: Duration = Default("0"),
color: Color = Default("black"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply a fade-in/out effect to the input video.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
Int | Literal['in', 'out'] | Default
|
The effect type can be either "in" for a fade-in, or "out" for a fade-out effect. Default is in. |
Default('in')
|
start_frame
|
Int
|
Specify the number of the frame to start applying the fade effect at. Default is 0. |
Default('0')
|
nb_frames
|
Int
|
The number of frames that the fade effect lasts. At the end of the fade-in effect, the output video will have the same intensity as the input video. At the end of the fade-out transition, the output video will be filled with the selected color. Default is 25. |
Default('25')
|
alpha
|
Boolean
|
If set to 1, fade only alpha channel, if one exists on the input. Default value is 0. |
Default('false')
|
start_time
|
Duration
|
Specify the timestamp (in seconds) of the frame to start to apply the fade effect. If both start_frame and start_time are specified, the fade will start at whichever comes last. Default is 0. |
Default('0')
|
duration
|
Duration
|
The number of seconds for which the fade effect has to last. At the end of the fade-in effect the output video will have the same intensity as the input video, at the end of the fade-out transition the output video will be filled with the selected color. If both duration and nb_frames are specified, duration is used. Default is 0 (nb_frames is used by default). |
Default('0')
|
color
|
Color
|
Specify the color of the fade. Default is "black". |
Default('black')
|
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
feedback
¶
feedback(
_feedin: VideoStream,
*,
x: Int = Default("0"),
w: Int = Default("0"),
extra_options: dict[str, Any] | None = None
) -> tuple[VideoStream, VideoStream]
Apply feedback video filter.
This filter pass cropped input frames to 2nd output. From there it can be filtered with other video filters. After filter receives frame from 2nd input, that frame is combined on top of original frame from 1st input and passed to 1st output.
The typical usage is filter only part of frame.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Int
|
set top left crop position (from 0 to INT_MAX) (default 0) |
Default('0')
|
w
|
Int
|
set crop size (from 0 to INT_MAX) (default 0) |
Default('0')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
feedout |
VideoStream
|
the video stream |
References
fftdnoiz
¶
fftdnoiz(
*,
sigma: Float = Default("1"),
amount: Float = Default("1"),
block: Int = Default("32"),
overlap: Float = Default("0.5"),
method: (
Int | Literal["wiener", "hard"] | Default
) = Default("wiener"),
prev: Int = Default("0"),
next: Int = Default("0"),
planes: Int = Default("7"),
window: (
Int
| Literal[
"rect",
"bartlett",
"hann",
"hanning",
"hamming",
"blackman",
"welch",
"flattop",
"bharris",
"bnuttall",
"bhann",
"sine",
"nuttall",
"lanczos",
"gauss",
"tukey",
"dolph",
"cauchy",
"parzen",
"poisson",
"bohman",
]
| Default
) = Default("hann"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Denoise frames using 3D FFT (frequency domain filtering).
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma
|
Float
|
Set the noise sigma constant. This sets denoising strength. Default value is 1. Allowed range is from 0 to 30. Using very high sigma with low overlap may give blocking artifacts. |
Default('1')
|
amount
|
Float
|
Set amount of denoising. By default all detected noise is reduced. Default value is 1. Allowed range is from 0 to 1. |
Default('1')
|
block
|
Int
|
Set size of block in pixels, Default is 32, can be 8 to 256. |
Default('32')
|
overlap
|
Float
|
Set block overlap. Default is 0.5. Allowed range is from 0.2 to 0.8. |
Default('0.5')
|
method
|
Int | Literal['wiener', 'hard'] | Default
|
Set denoising method. Default is wiener, can also be hard. |
Default('wiener')
|
prev
|
Int
|
Set number of previous frames to use for denoising. By default is set to 0. |
Default('0')
|
next
|
Int
|
Set number of next frames to to use for denoising. By default is set to 0. |
Default('0')
|
planes
|
Int
|
Set planes which will be filtered, by default are all available filtered except alpha. |
Default('7')
|
window
|
Int | Literal['rect', 'bartlett', 'hann', 'hanning', 'hamming', 'blackman', 'welch', 'flattop', 'bharris', 'bnuttall', 'bhann', 'sine', 'nuttall', 'lanczos', 'gauss', 'tukey', 'dolph', 'cauchy', 'parzen', 'poisson', 'bohman'] | Default
|
set window function (from 0 to 19) (default hann) |
Default('hann')
|
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
fftfilt
¶
fftfilt(
*,
dc_Y: Int = Default("0"),
dc_U: Int = Default("0"),
dc_V: Int = Default("0"),
weight_Y: String = Default("1"),
weight_U: String = Default(None),
weight_V: String = Default(None),
eval: (
Int | Literal["init", "frame"] | Default
) = Default("init"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply arbitrary expressions to samples in frequency domain
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dc_Y
|
Int
|
Adjust the dc value (gain) of the luma plane of the image. The filter accepts an integer value in range 0 to 1000. The default value is set to 0. |
Default('0')
|
dc_U
|
Int
|
Adjust the dc value (gain) of the 1st chroma plane of the image. The filter accepts an integer value in range 0 to 1000. The default value is set to 0. |
Default('0')
|
dc_V
|
Int
|
Adjust the dc value (gain) of the 2nd chroma plane of the image. The filter accepts an integer value in range 0 to 1000. The default value is set to 0. |
Default('0')
|
weight_Y
|
String
|
Set the frequency domain weight expression for the luma plane. |
Default('1')
|
weight_U
|
String
|
Set the frequency domain weight expression for the 1st chroma plane. |
Default(None)
|
weight_V
|
String
|
Set the frequency domain weight expression for the 2nd chroma plane. |
Default(None)
|
eval
|
Int | Literal['init', 'frame'] | Default
|
Set when the expressions are evaluated. It accepts the following values: @end table Default value is init. The filter accepts the following variables: |
Default('init')
|
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
field
¶
field(
*,
type: (
Int | Literal["top", "bottom"] | Default
) = Default("top"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Extract a single field from an interlaced image using stride arithmetic to avoid wasting CPU time. The output frames are marked as non-interlaced.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
Int | Literal['top', 'bottom'] | Default
|
Specify whether to extract the top (if the value is 0 or top) or the bottom field (if the value is 1 or bottom). |
Default('top')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
fieldhint
¶
fieldhint(
*,
hint: String = Default(None),
mode: (
Int
| Literal["absolute", "relative", "pattern"]
| Default
) = Default("absolute"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Create new frames by copying the top and bottom fields from surrounding frames supplied as numbers by the hint file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hint
|
String
|
Set file containing hints: absolute/relative frame numbers. There must be one line for each frame in a clip. Each line must contain two numbers separated by the comma, optionally followed by - or +. Numbers supplied on each line of file can not be out of [N-1,N+1] where N is current frame number for absolute mode or out of [-1, 1] range for relative mode. First number tells from which frame to pick up top field and second number tells from which frame to pick up bottom field. If optionally followed by + output frame will be marked as interlaced, else if followed by - output frame will be marked as progressive, else it will be marked same as input frame. If optionally followed by t output frame will use only top field, or in case of b it will use only bottom field. If line starts with # or ; that line is skipped. |
Default(None)
|
mode
|
Int | Literal['absolute', 'relative', 'pattern'] | Default
|
Can be item absolute or relative or pattern. Default is absolute. The pattern mode is same as relative mode, except at last entry of file if there are more frames to process than hint file is seek back to start. |
Default('absolute')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
fieldorder
¶
fieldorder(
*,
order: Int | Literal["bff", "tff"] | Default = Default(
"tff"
),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Transform the field order of the input video.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order
|
Int | Literal['bff', 'tff'] | Default
|
The output field order. Valid values are tff for top field first or bff for bottom field first. |
Default('tff')
|
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
fifo
¶
fifo(
extra_options: dict[str, Any] | None = None,
) -> VideoStream
Buffer input images and send them when they are requested.
It is mainly useful when auto-inserted by the libavfilter framework.
It does not take parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
fillborders
¶
fillborders(
*,
left: Int = Default("0"),
right: Int = Default("0"),
top: Int = Default("0"),
bottom: Int = Default("0"),
mode: (
Int
| Literal[
"smear",
"mirror",
"fixed",
"reflect",
"wrap",
"fade",
"margins",
]
| Default
) = Default("smear"),
color: Color = Default("black"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Fill borders of the input video, without changing video stream dimensions. Sometimes video can have garbage at the four edges and you may not want to crop video input to keep size multiple of some number.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
left
|
Int
|
Number of pixels to fill from left border. |
Default('0')
|
right
|
Int
|
Number of pixels to fill from right border. |
Default('0')
|
top
|
Int
|
Number of pixels to fill from top border. |
Default('0')
|
bottom
|
Int
|
Number of pixels to fill from bottom border. |
Default('0')
|
mode
|
Int | Literal['smear', 'mirror', 'fixed', 'reflect', 'wrap', 'fade', 'margins'] | Default
|
Set fill mode. It accepts the following values: @end table Default is smear. |
Default('smear')
|
color
|
Color
|
Set color for pixels in fixed or fade mode. Default is black. |
Default('black')
|
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
find_rect
¶
find_rect(
*,
object: String = Default(None),
threshold: Float = Default("0.5"),
mipmaps: Int = Default("3"),
xmin: Int = Default("0"),
discard: Boolean = Default("false"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Find a rectangular object
It accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
object
|
String
|
Filepath of the object image, needs to be in gray8. |
Default(None)
|
threshold
|
Float
|
Detection threshold, default is 0.5. |
Default('0.5')
|
mipmaps
|
Int
|
Number of mipmaps, default is 3. |
Default('3')
|
xmin
|
Int
|
Specifies the rectangle in which to search. |
Default('0')
|
discard
|
Boolean
|
Discard frames where object is not detected. Default is disabled. |
Default('false')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
firequalizer
¶
firequalizer(
*,
gain: String = Default("gain_interpolate(f)"),
gain_entry: String = Default(None),
delay: Double = Default("0.01"),
accuracy: Double = Default("5"),
wfunc: (
Int
| Literal[
"rectangular",
"hann",
"hamming",
"blackman",
"nuttall3",
"mnuttall3",
"nuttall",
"bnuttall",
"bharris",
"tukey",
]
| Default
) = Default("hann"),
fixed: Boolean = Default("false"),
multi: Boolean = Default("false"),
zero_phase: Boolean = Default("false"),
scale: (
Int
| Literal["linlin", "linlog", "loglin", "loglog"]
| Default
) = Default("linlog"),
dumpfile: String = Default(None),
dumpscale: (
Int
| Literal["linlin", "linlog", "loglin", "loglog"]
| Default
) = Default("linlog"),
fft2: Boolean = Default("false"),
min_phase: Boolean = Default("false"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply FIR Equalization using arbitrary frequency response.
The filter accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gain
|
String
|
Set gain curve equation (in dB). The expression can contain variables: @end table and functions: @end table This option is also available as command. Default is gain_interpolate(f). |
Default('gain_interpolate(f)')
|
gain_entry
|
String
|
Set gain entry for gain_interpolate function. The expression can contain functions: @end table This option is also available as command. |
Default(None)
|
delay
|
Double
|
Set filter delay in seconds. Higher value means more accurate. Default is 0.01. |
Default('0.01')
|
accuracy
|
Double
|
Set filter accuracy in Hz. Lower value means more accurate. Default is 5. |
Default('5')
|
wfunc
|
Int | Literal['rectangular', 'hann', 'hamming', 'blackman', 'nuttall3', 'mnuttall3', 'nuttall', 'bnuttall', 'bharris', 'tukey'] | Default
|
Set window function. Acceptable values are: @end table |
Default('hann')
|
fixed
|
Boolean
|
If enabled, use fixed number of audio samples. This improves speed when filtering with large delay. Default is disabled. |
Default('false')
|
multi
|
Boolean
|
Enable multichannels evaluation on gain. Default is disabled. |
Default('false')
|
zero_phase
|
Boolean
|
Enable zero phase mode by subtracting timestamp to compensate delay. Default is disabled. |
Default('false')
|
scale
|
Int | Literal['linlin', 'linlog', 'loglin', 'loglog'] | Default
|
Set scale used by gain. Acceptable values are: @end table |
Default('linlog')
|
dumpfile
|
String
|
Set file for dumping, suitable for gnuplot. |
Default(None)
|
dumpscale
|
Int | Literal['linlin', 'linlog', 'loglin', 'loglog'] | Default
|
Set scale for dumpfile. Acceptable values are same with scale option. Default is linlog. |
Default('linlog')
|
fft2
|
Boolean
|
Enable 2-channel convolution using complex FFT. This improves speed significantly. Default is disabled. |
Default('false')
|
min_phase
|
Boolean
|
Enable minimum phase impulse response. Default is disabled. |
Default('false')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
flanger
¶
flanger(
*,
delay: Double = Default("0"),
depth: Double = Default("2"),
regen: Double = Default("0"),
width: Double = Default("71"),
speed: Double = Default("0.5"),
shape: (
Int
| Literal["triangular", "t", "sinusoidal", "s"]
| Default
) = Default("sinusoidal"),
phase: Double = Default("25"),
interp: (
Int | Literal["linear", "quadratic"] | Default
) = Default("linear"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply a flanging effect to the audio.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delay
|
Double
|
Set base delay in milliseconds. Range from 0 to 30. Default value is 0. |
Default('0')
|
depth
|
Double
|
Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2. |
Default('2')
|
regen
|
Double
|
Set percentage regeneration (delayed signal feedback). Range from -95 to 95. Default value is 0. |
Default('0')
|
width
|
Double
|
Set percentage of delayed signal mixed with original. Range from 0 to 100. Default value is 71. |
Default('71')
|
speed
|
Double
|
Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5. |
Default('0.5')
|
shape
|
Int | Literal['triangular', 't', 'sinusoidal', 's'] | Default
|
Set swept wave shape, can be triangular or sinusoidal. Default value is sinusoidal. |
Default('sinusoidal')
|
phase
|
Double
|
Set swept wave percentage-shift for multi channel. Range from 0 to 100. Default value is 25. |
Default('25')
|
interp
|
Int | Literal['linear', 'quadratic'] | Default
|
Set delay-line interpolation, linear or quadratic. Default is linear. |
Default('linear')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
floodfill
¶
floodfill(
*,
x: Int = Default("0"),
y: Int = Default("0"),
s0: Int = Default("0"),
s1: Int = Default("0"),
s2: Int = Default("0"),
s3: Int = Default("0"),
d0: Int = Default("0"),
d1: Int = Default("0"),
d2: Int = Default("0"),
d3: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Flood area with values of same pixel components with another values.
It accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Int
|
Set pixel x coordinate. |
Default('0')
|
y
|
Int
|
Set pixel y coordinate. |
Default('0')
|
s0
|
Int
|
Set source #0 component value. |
Default('0')
|
s1
|
Int
|
Set source #1 component value. |
Default('0')
|
s2
|
Int
|
Set source #2 component value. |
Default('0')
|
s3
|
Int
|
Set source #3 component value. |
Default('0')
|
d0
|
Int
|
Set destination #0 component value. |
Default('0')
|
d1
|
Int
|
Set destination #1 component value. |
Default('0')
|
d2
|
Int
|
Set destination #2 component value. |
Default('0')
|
d3
|
Int
|
Set destination #3 component value. |
Default('0')
|
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
format
¶
format(
*,
pix_fmts: String = Default(None),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert the input video to one of the specified pixel formats. Libavfilter will try to pick one that is suitable as input to the next filter.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pix_fmts
|
String
|
A '|'-separated list of pixel format names, such as "pix_fmts=yuv420p|monow|rgb24". |
Default(None)
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
fps
¶
fps(
*,
fps: String = Default("25"),
start_time: Double = Default("DBL_MAX"),
round: (
Int
| Literal["zero", "inf", "down", "up", "near"]
| Default
) = Default("near"),
eof_action: (
Int | Literal["round", "pass"] | Default
) = Default("round"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert the video to specified constant frame rate by duplicating or dropping frames as necessary.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fps
|
String
|
The desired output frame rate. It accepts expressions containing the following constants: @end table The default is 25. |
Default('25')
|
start_time
|
Double
|
Assume the first PTS should be the given value, in seconds. This allows for padding/trimming at the start of stream. By default, no assumption is made about the first frame's expected PTS, so no padding or trimming is done. For example, this could be set to 0 to pad the beginning with duplicates of the first frame if a video stream starts after the audio stream or to trim any frames with a negative PTS. |
Default('DBL_MAX')
|
round
|
Int | Literal['zero', 'inf', 'down', 'up', 'near'] | Default
|
Timestamp (PTS) rounding method. Possible values are: @end table The default is near. |
Default('near')
|
eof_action
|
Int | Literal['round', 'pass'] | Default
|
Action performed when reading the last frame. Possible values are: @end table The default is round. |
Default('round')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
framepack
¶
framepack(
_right: VideoStream,
*,
format: (
Int
| Literal[
"sbs", "tab", "frameseq", "lines", "columns"
]
| Default
) = Default("sbs"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Pack two different video streams into a stereoscopic video, setting proper metadata on supported codecs. The two views should have the same size and framerate and processing will stop when the shorter video ends. Please note that you may conveniently adjust view properties with the scale and fps filters.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
format
|
Int | Literal['sbs', 'tab', 'frameseq', 'lines', 'columns'] | Default
|
The desired packing format. Supported values are: @end table |
Default('sbs')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
packed |
VideoStream
|
the video stream |
References
framerate
¶
framerate(
*,
fps: Video_rate = Default("50"),
interp_start: Int = Default("15"),
interp_end: Int = Default("240"),
scene: Double = Default("8.2"),
flags: (
Flags
| Literal["scene_change_detect", "scd"]
| Default
) = Default("scene_change_detect+scd"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Change the frame rate by interpolating new video output frames from the source frames.
This filter is not designed to function correctly with interlaced media. If you wish to change the frame rate of interlaced media then you are required to deinterlace before this filter and re-interlace after this filter.
A description of the accepted options follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fps
|
Video_rate
|
Specify the output frames per second. This option can also be specified as a value alone. The default is 50. |
Default('50')
|
interp_start
|
Int
|
Specify the start of a range where the output frame will be created as a linear interpolation of two frames. The range is [0-255], the default is 15. |
Default('15')
|
interp_end
|
Int
|
Specify the end of a range where the output frame will be created as a linear interpolation of two frames. The range is [0-255], the default is 240. |
Default('240')
|
scene
|
Double
|
Specify the level at which a scene change is detected as a value between 0 and 100 to indicate a new scene; a low value reflects a low probability for the current frame to introduce a new scene, while a higher value means the current frame is more likely to be one. The default is 8.2. |
Default('8.2')
|
flags
|
Flags | Literal['scene_change_detect', 'scd'] | Default
|
Specify flags influencing the filter process. Available value for flags is: @end table |
Default('scene_change_detect+scd')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
framestep
¶
framestep(
*,
step: Int = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Select one frame every N-th frame.
This filter accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
step
|
Int
|
Select frame after every step frames. Allowed values are positive integers higher than 0. Default value is 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
freezedetect
¶
freezedetect(
*,
n: Double = Default("0.001"),
d: Duration = Default("2"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Detect frozen video.
This filter logs a message and sets frame metadata when it detects that the input video has no significant change in content during a specified duration. Video freeze detection calculates the mean average absolute difference of all the components of video frames and compares it to a noise floor.
The printed times and duration are expressed in seconds. The lavfi.freezedetect.freeze_start metadata key is set on the first frame whose timestamp equals or exceeds the detection duration and it contains the timestamp of the first frame of the freeze. The lavfi.freezedetect.freeze_duration and lavfi.freezedetect.freeze_end metadata keys are set on the first frame after the freeze.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Double
|
Set noise tolerance. Can be specified in dB (in case "dB" is appended to the specified value) or as a difference ratio between 0 and 1. Default is -60dB, or 0.001. |
Default('0.001')
|
d
|
Duration
|
Set freeze duration until notification (default is 2 seconds). |
Default('2')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
freezeframes
¶
freezeframes(
_replace: VideoStream,
*,
first: Int64 = Default("0"),
last: Int64 = Default("0"),
replace: Int64 = Default("0"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Freeze video frames.
This filter freezes video frames using frame from 2nd input.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
first
|
Int64
|
Set number of first frame from which to start freeze. |
Default('0')
|
last
|
Int64
|
Set number of last frame from which to end freeze. |
Default('0')
|
replace
|
Int64
|
Set number of frame from 2nd input which will be used instead of replaced frames. |
Default('0')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
fspp
¶
fspp(
*,
quality: Int = Default("4"),
qp: Int = Default("0"),
strength: Int = Default("0"),
use_bframe_qp: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply fast and simple postprocessing. It is a faster version of spp.
It splits (I)DCT into horizontal/vertical passes. Unlike the simple post- processing filter, one of them is performed once per block, not per pixel. This allows for much higher speed.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quality
|
Int
|
Set quality. This option defines the number of levels for averaging. It accepts an integer in the range 4-5. Default value is 4. |
Default('4')
|
qp
|
Int
|
Force a constant quantization parameter. It accepts an integer in range 0-63. If not set, the filter will use the QP from the video stream (if available). |
Default('0')
|
strength
|
Int
|
Set filter strength. It accepts an integer in range -15 to 32. Lower values mean more details but also more artifacts, while higher values make the image smoother but also blurrier. Default value is 0 − PSNR optimal. |
Default('0')
|
use_bframe_qp
|
Boolean
|
Enable the use of the QP from the B-Frames if set to 1. Using this option may cause flicker since the B-Frames have often larger QP. Default is 0 (not enabled). |
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
gblur
¶
gblur(
*,
sigma: Float = Default("0.5"),
steps: Int = Default("1"),
planes: Int = Default("15"),
sigmaV: Float = Default("-1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply Gaussian blur filter.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma
|
Float
|
Set horizontal sigma, standard deviation of Gaussian blur. Default is 0.5. |
Default('0.5')
|
steps
|
Int
|
Set number of steps for Gaussian approximation. Default is 1. |
Default('1')
|
planes
|
Int
|
Set which planes to filter. By default all planes are filtered. |
Default('15')
|
sigmaV
|
Float
|
Set vertical sigma, if negative it will be same as sigma. Default is -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
geq
¶
geq(
*,
lum_expr: String = Default(None),
cb_expr: String = Default(None),
cr_expr: String = Default(None),
alpha_expr: String = Default(None),
red_expr: String = Default(None),
green_expr: String = Default(None),
blue_expr: String = Default(None),
interpolation: (
Int
| Literal["nearest", "n", "bilinear", "b"]
| Default
) = Default("bilinear"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply generic equation to each pixel.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lum_expr
|
String
|
Set the luminance expression. |
Default(None)
|
cb_expr
|
String
|
Set the chrominance blue expression. |
Default(None)
|
cr_expr
|
String
|
Set the chrominance red expression. |
Default(None)
|
alpha_expr
|
String
|
Set the alpha expression. |
Default(None)
|
red_expr
|
String
|
Set the red expression. |
Default(None)
|
green_expr
|
String
|
Set the green expression. |
Default(None)
|
blue_expr
|
String
|
Set the blue expression. |
Default(None)
|
interpolation
|
Int | Literal['nearest', 'n', 'bilinear', 'b'] | Default
|
Set one of interpolation methods: @end table Default is bilinear. |
Default('bilinear')
|
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
gradfun
¶
gradfun(
*,
strength: Float = Default("1.2"),
radius: Int = Default("16"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Fix the banding artifacts that are sometimes introduced into nearly flat regions by truncation to 8-bit color depth. Interpolate the gradients that should go where the bands are, and dither them.
It is designed for playback only. Do not use it prior to lossy compression, because compression tends to lose the dither and bring back the bands.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strength
|
Float
|
The maximum amount by which the filter will change any one pixel. This is also the threshold for detecting nearly flat regions. Acceptable values range from .51 to 64; the default value is 1.2. Out-of-range values will be clipped to the valid range. |
Default('1.2')
|
radius
|
Int
|
The neighborhood to fit the gradient to. A larger radius makes for smoother gradients, but also prevents the filter from modifying the pixels near detailed regions. Acceptable values are 8-32; the default value is 16. Out-of-range values will be clipped to the valid range. |
Default('16')
|
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
graphmonitor
¶
graphmonitor(
*,
size: Image_size = Default("hd720"),
opacity: Float = Default("0.9"),
mode: (
Int | Literal["full", "compact"] | Default
) = Default("full"),
flags: (
Flags
| Literal[
"queue",
"frame_count_in",
"frame_count_out",
"frame_count_delta",
"pts",
"pts_delta",
"time",
"time_delta",
"timebase",
"format",
"size",
"rate",
"eof",
"sample_count_in",
"sample_count_out",
"sample_count_delta",
]
| Default
) = Default("queue"),
rate: Video_rate = Default("25"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Show various filtergraph stats.
With this filter one can debug complete filtergraph. Especially issues with links filling with queued frames.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
Image_size
|
Set video output size. Default is hd720. |
Default('hd720')
|
opacity
|
Float
|
Set video opacity. Default is 0.9. Allowed range is from 0 to 1. |
Default('0.9')
|
mode
|
Int | Literal['full', 'compact'] | Default
|
Set output mode, can be fulll or compact. In compact mode only filters with some queued frames have displayed stats. |
Default('full')
|
flags
|
Flags | Literal['queue', 'frame_count_in', 'frame_count_out', 'frame_count_delta', 'pts', 'pts_delta', 'time', 'time_delta', 'timebase', 'format', 'size', 'rate', 'eof', 'sample_count_in', 'sample_count_out', 'sample_count_delta'] | Default
|
Set flags which enable which stats are shown in video. Available values for flags are: @end table |
Default('queue')
|
rate
|
Video_rate
|
Set upper limit for video rate of output stream, Default value is 25. This guarantee that output video frame rate will not be higher than this value. |
Default('25')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
grayworld
¶
grayworld(
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None,
) -> VideoStream
A color constancy filter that applies color correction based on the grayworld assumption
The algorithm uses linear light, so input data should be linearized beforehand (and possibly correctly tagged).
@example ffmpeg -i INPUT -vf zscale=transfer=linear,grayworld,zscale=transfer=bt709,format=yuv420p OUTPUT @end example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
greyedge
¶
greyedge(
*,
difford: Int = Default("1"),
minknorm: Int = Default("1"),
sigma: Double = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
A color constancy variation filter which estimates scene illumination via grey edge algorithm and corrects the scene colors accordingly.
See: https://staff.science.uva.nl/th.gevers/pub/GeversTIP07.pdf
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
difford
|
Int
|
The order of differentiation to be applied on the scene. Must be chosen in the range [0,2] and default value is 1. |
Default('1')
|
minknorm
|
Int
|
The Minkowski parameter to be used for calculating the Minkowski distance. Must be chosen in the range [0,20] and default value is 1. Set to 0 for getting max value instead of calculating Minkowski distance. |
Default('1')
|
sigma
|
Double
|
The standard deviation of Gaussian blur to be applied on the scene. Must be chosen in the range [0,1024.0] and default value = 1. floor( sigma * break_off_sigma(3) ) can't be equal to 0 if difford is greater than 0. |
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
haas
¶
haas(
*,
level_in: Double = Default("1"),
level_out: Double = Default("1"),
side_gain: Double = Default("1"),
middle_source: (
Int
| Literal["left", "right", "mid", "side"]
| Default
) = Default("mid"),
middle_phase: Boolean = Default("false"),
left_delay: Double = Default("2.05"),
left_balance: Double = Default("-1"),
left_gain: Double = Default("1"),
left_phase: Boolean = Default("false"),
right_delay: Double = Default("2.12"),
right_balance: Double = Default("1"),
right_gain: Double = Default("1"),
right_phase: Boolean = Default("true"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply Haas effect to audio.
Note that this makes most sense to apply on mono signals. With this filter applied to mono signals it give some directionality and stretches its stereo image.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_in
|
Double
|
Set input level. By default is 1, or 0dB |
Default('1')
|
level_out
|
Double
|
Set output level. By default is 1, or 0dB. |
Default('1')
|
side_gain
|
Double
|
Set gain applied to side part of signal. By default is 1. |
Default('1')
|
middle_source
|
Int | Literal['left', 'right', 'mid', 'side'] | Default
|
Set kind of middle source. Can be one of the following: @end table |
Default('mid')
|
middle_phase
|
Boolean
|
Change middle phase. By default is disabled. |
Default('false')
|
left_delay
|
Double
|
Set left channel delay. By default is 2.05 milliseconds. |
Default('2.05')
|
left_balance
|
Double
|
Set left channel balance. By default is -1. |
Default('-1')
|
left_gain
|
Double
|
Set left channel gain. By default is 1. |
Default('1')
|
left_phase
|
Boolean
|
Change left phase. By default is disabled. |
Default('false')
|
right_delay
|
Double
|
Set right channel delay. By defaults is 2.12 milliseconds. |
Default('2.12')
|
right_balance
|
Double
|
Set right channel balance. By default is 1. |
Default('1')
|
right_gain
|
Double
|
Set right channel gain. By default is 1. |
Default('1')
|
right_phase
|
Boolean
|
Change right phase. By default is enabled. |
Default('true')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
haldclut
¶
haldclut(
_clut: VideoStream,
*,
clut: Int | Literal["first", "all"] | Default = Default(
"all"
),
interp: (
Int
| Literal[
"nearest",
"trilinear",
"tetrahedral",
"pyramid",
"prism",
]
| Default
) = Default("tetrahedral"),
framesync_options: FFMpegFrameSyncOption | None = None,
eof_action: str | None = None,
shortest: bool | None = None,
repeatlast: bool | None = None,
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply a Hald CLUT to a video stream.
First input is the video stream to process, and second one is the Hald CLUT. The Hald CLUT input can be a simple picture or a complete video stream.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
clut
|
Int | Literal['first', 'all'] | Default
|
Set which CLUT video frames will be processed from second input stream, can be first or all. Default is all. |
Default('all')
|
interp
|
Int | Literal['nearest', 'trilinear', 'tetrahedral', 'pyramid', 'prism'] | Default
|
select interpolation mode (from 0 to 4) (default tetrahedral) |
Default('tetrahedral')
|
framesync_options
|
FFMpegFrameSyncOption | None
|
Framesync options |
None
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
hdcd
¶
hdcd(
*,
disable_autoconvert: Boolean = Default("true"),
process_stereo: Boolean = Default("true"),
cdt_ms: Int = Default("2000"),
force_pe: Boolean = Default("false"),
analyze_mode: (
Int
| Literal["off", "lle", "pe", "cdt", "tgm"]
| Default
) = Default("off"),
bits_per_sample: (
Int | Literal["16", "20", "24"] | Default
) = Default("16"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with embedded HDCD codes is expanded into a 20-bit PCM stream.
The filter supports the Peak Extend and Low-level Gain Adjustment features of HDCD, and detects the Transient Filter flag.
@example ffmpeg -i HDCD16.flac -af hdcd OUT24.flac @end example
When using the filter with wav, note the default encoding for wav is 16-bit, so the resulting 20-bit stream will be truncated back to 16-bit. Use something like -acodec pcm_s24le after the filter to get 24-bit PCM output. @example ffmpeg -i HDCD16.wav -af hdcd OUT16.wav ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav @end example
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
disable_autoconvert
|
Boolean
|
Disable any automatic format conversion or resampling in the filter graph. |
Default('true')
|
process_stereo
|
Boolean
|
Process the stereo channels together. If target_gain does not match between channels, consider it invalid and use the last valid target_gain. |
Default('true')
|
cdt_ms
|
Int
|
Set the code detect timer period in ms. |
Default('2000')
|
force_pe
|
Boolean
|
Always extend peaks above -3dBFS even if PE isn't signaled. |
Default('false')
|
analyze_mode
|
Int | Literal['off', 'lle', 'pe', 'cdt', 'tgm'] | Default
|
Replace audio with a solid tone and adjust the amplitude to signal some specific aspect of the decoding process. The output file can be loaded in an audio editor alongside the original to aid analysis. analyze_mode=pe:force_pe=true can be used to see all samples above the PE level. Modes are: @end table |
Default('off')
|
bits_per_sample
|
Int | Literal['16', '20', '24'] | Default
|
Valid bits per sample (location of the true LSB). (from 16 to 24) (default 16) |
Default('16')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
hflip
¶
hflip(
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None,
) -> VideoStream
Flip the input video horizontally.
For example, to horizontally flip the input video with ffmpeg: @example ffmpeg -i in.avi -vf "hflip" out.avi @end example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
highpass
¶
highpass(
*,
frequency: Double = Default("3000"),
width_type: (
Int | Literal["h", "q", "o", "s", "k"] | Default
) = Default("q"),
width: Double = Default("0.707"),
poles: Int = Default("2"),
mix: Double = Default("1"),
channels: String = Default("all"),
normalize: Boolean = Default("false"),
transform: (
Int
| Literal[
"di", "dii", "tdi", "tdii", "latt", "svf", "zdf"
]
| Default
) = Default("di"),
precision: (
Int
| Literal["auto", "s16", "s32", "f32", "f64"]
| Default
) = Default("auto"),
blocksize: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply a high-pass filter with 3dB point frequency. The filter can be either single-pole, or double-pole (the default). The filter roll off at 6dB per pole per octave (20dB per pole per decade).
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequency
|
Double
|
Change highpass frequency. Syntax for the command is : "frequency" |
Default('3000')
|
width_type
|
Int | Literal['h', 'q', 'o', 's', 'k'] | Default
|
Change highpass width_type. Syntax for the command is : "width_type" |
Default('q')
|
width
|
Double
|
Change highpass width. Syntax for the command is : "width" |
Default('0.707')
|
poles
|
Int
|
Set number of poles. Default is 2. |
Default('2')
|
mix
|
Double
|
Change highpass mix. Syntax for the command is : "mix" |
Default('1')
|
channels
|
String
|
Specify which channels to filter, by default all available are filtered. |
Default('all')
|
normalize
|
Boolean
|
Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. |
Default('false')
|
transform
|
Int | Literal['di', 'dii', 'tdi', 'tdii', 'latt', 'svf', 'zdf'] | Default
|
Set transform type of IIR filter. @end table |
Default('di')
|
precision
|
Int | Literal['auto', 's16', 's32', 'f32', 'f64'] | Default
|
Set precison of filtering. @end table |
Default('auto')
|
blocksize
|
Int
|
set the block size (from 0 to 32768) (default 0) |
Default('0')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
highshelf
¶
highshelf(
*,
frequency: Double = Default("3000"),
width_type: (
Int | Literal["h", "q", "o", "s", "k"] | Default
) = Default("q"),
width: Double = Default("0.5"),
gain: Double = Default("0"),
poles: Int = Default("2"),
mix: Double = Default("1"),
channels: String = Default("all"),
normalize: Boolean = Default("false"),
transform: (
Int
| Literal[
"di", "dii", "tdi", "tdii", "latt", "svf", "zdf"
]
| Default
) = Default("di"),
precision: (
Int
| Literal["auto", "s16", "s32", "f32", "f64"]
| Default
) = Default("auto"),
blocksize: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Boost or cut treble (upper) frequencies of the audio using a two-pole shelving filter with a response similar to that of a standard hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequency
|
Double
|
Change treble frequency. Syntax for the command is : "frequency" |
Default('3000')
|
width_type
|
Int | Literal['h', 'q', 'o', 's', 'k'] | Default
|
Change treble width_type. Syntax for the command is : "width_type" |
Default('q')
|
width
|
Double
|
Change treble width. Syntax for the command is : "width" |
Default('0.5')
|
gain
|
Double
|
Change treble gain. Syntax for the command is : "gain" |
Default('0')
|
poles
|
Int
|
Set number of poles. Default is 2. |
Default('2')
|
mix
|
Double
|
Change treble mix. Syntax for the command is : "mix" |
Default('1')
|
channels
|
String
|
Specify which channels to filter, by default all available are filtered. |
Default('all')
|
normalize
|
Boolean
|
Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. |
Default('false')
|
transform
|
Int | Literal['di', 'dii', 'tdi', 'tdii', 'latt', 'svf', 'zdf'] | Default
|
Set transform type of IIR filter. @end table |
Default('di')
|
precision
|
Int | Literal['auto', 's16', 's32', 'f32', 'f64'] | Default
|
Set precison of filtering. @end table |
Default('auto')
|
blocksize
|
Int
|
set the block size (from 0 to 32768) (default 0) |
Default('0')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
histeq
¶
histeq(
*,
strength: Float = Default("0.2"),
intensity: Float = Default("0.21"),
antibanding: (
Int | Literal["none", "weak", "strong"] | Default
) = Default("none"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
This filter applies a global color histogram equalization on a per-frame basis.
It can be used to correct video that has a compressed range of pixel intensities. The filter redistributes the pixel intensities to equalize their distribution across the intensity range. It may be viewed as an "automatically adjusting contrast filter". This filter is useful only for correcting degraded or poorly captured source video.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
strength
|
Float
|
Determine the amount of equalization to be applied. As the strength is reduced, the distribution of pixel intensities more-and-more approaches that of the input frame. The value must be a float number in the range [0,1] and defaults to 0.200. |
Default('0.2')
|
intensity
|
Float
|
Set the maximum intensity that can generated and scale the output values appropriately. The strength should be set as desired and then the intensity can be limited if needed to avoid washing-out. The value must be a float number in the range [0,1] and defaults to 0.210. |
Default('0.21')
|
antibanding
|
Int | Literal['none', 'weak', 'strong'] | Default
|
Set the antibanding level. If enabled the filter will randomly vary the luminance of output pixels by a small amount to avoid banding of the histogram. Possible values are none, weak or strong. It defaults to none. |
Default('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
histogram
¶
histogram(
*,
level_height: Int = Default("200"),
scale_height: Int = Default("12"),
display_mode: (
Int
| Literal["overlay", "parade", "stack"]
| Default
) = Default("stack"),
levels_mode: (
Int | Literal["linear", "logarithmic"] | Default
) = Default("linear"),
components: Int = Default("7"),
fgopacity: Float = Default("0.7"),
bgopacity: Float = Default("0.5"),
colors_mode: (
Int
| Literal[
"whiteonblack",
"blackonwhite",
"whiteongray",
"blackongray",
"coloronblack",
"coloronwhite",
"colorongray",
"blackoncolor",
"whiteoncolor",
"grayoncolor",
]
| Default
) = Default("whiteonblack"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Compute and draw a color distribution histogram for the input video.
The computed histogram is a representation of the color component distribution in an image.
Standard histogram displays the color components distribution in an image. Displays color graph for each color component. Shows distribution of the Y, U, V, A or R, G, B components, depending on input format, in the current frame. Below each graph a color component scale meter is shown.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_height
|
Int
|
Set height of level. Default value is 200. Allowed range is [50, 2048]. |
Default('200')
|
scale_height
|
Int
|
Set height of color scale. Default value is 12. Allowed range is [0, 40]. |
Default('12')
|
display_mode
|
Int | Literal['overlay', 'parade', 'stack'] | Default
|
Set display mode. It accepts the following values: @end table Default is stack. |
Default('stack')
|
levels_mode
|
Int | Literal['linear', 'logarithmic'] | Default
|
Set mode. Can be either linear, or logarithmic. Default is linear. |
Default('linear')
|
components
|
Int
|
Set what color components to display. Default is 7. |
Default('7')
|
fgopacity
|
Float
|
Set foreground opacity. Default is 0.7. |
Default('0.7')
|
bgopacity
|
Float
|
Set background opacity. Default is 0.5. |
Default('0.5')
|
colors_mode
|
Int | Literal['whiteonblack', 'blackonwhite', 'whiteongray', 'blackongray', 'coloronblack', 'coloronwhite', 'colorongray', 'blackoncolor', 'whiteoncolor', 'grayoncolor'] | Default
|
Set colors mode. It accepts the following values: @end table Default is whiteonblack. |
Default('whiteonblack')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
hqdn3d
¶
hqdn3d(
*,
luma_spatial: Double = Default("0"),
chroma_spatial: Double = Default("0"),
luma_tmp: Double = Default("0"),
chroma_tmp: Double = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
This is a high precision/quality 3d denoise filter. It aims to reduce image noise, producing smooth images and making still images really still. It should enhance compressibility.
It accepts the following optional parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
luma_spatial
|
Double
|
A non-negative floating point number which specifies spatial luma strength. It defaults to 4.0. |
Default('0')
|
chroma_spatial
|
Double
|
A non-negative floating point number which specifies spatial chroma strength. It defaults to 3.0*luma_spatial/4.0. |
Default('0')
|
luma_tmp
|
Double
|
A floating point number which specifies luma temporal strength. It defaults to 6.0*luma_spatial/4.0. |
Default('0')
|
chroma_tmp
|
Double
|
A floating point number which specifies chroma temporal strength. It defaults to luma_tmp*chroma_spatial/luma_spatial. |
Default('0')
|
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
hqx
¶
hqx(
*,
n: Int = Default("3"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply a high-quality magnification filter designed for pixel art. This filter was originally created by Maxim Stepin.
It accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Int
|
Set the scaling dimension: 2 for hq2x, 3 for hq3x and 4 for hq4x. Default is 3. |
Default('3')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
hsvhold
¶
hsvhold(
*,
hue: Float = Default("0"),
sat: Float = Default("0"),
val: Float = Default("0"),
similarity: Float = Default("0.01"),
blend: Float = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Turns a certain HSV range into gray values.
This filter measures color difference between set HSV color in options and ones measured in video stream. Depending on options, output colors can be changed to be gray or not.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hue
|
Float
|
Set the hue value which will be used in color difference calculation. Allowed range is from -360 to 360. Default value is 0. |
Default('0')
|
sat
|
Float
|
Set the saturation value which will be used in color difference calculation. Allowed range is from -1 to 1. Default value is 0. |
Default('0')
|
val
|
Float
|
Set the value which will be used in color difference calculation. Allowed range is from -1 to 1. Default value is 0. |
Default('0')
|
similarity
|
Float
|
Set similarity percentage with the key color. Allowed range is from 0 to 1. Default value is 0.01. 0.00001 matches only the exact key color, while 1.0 matches everything. |
Default('0.01')
|
blend
|
Float
|
Blend percentage. Allowed range is from 0 to 1. Default value is 0. 0.0 makes pixels either fully gray, or not gray at all. Higher values result in more gray pixels, with a higher gray pixel the more similar the pixels color is to the key color. |
Default('0')
|
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
hsvkey
¶
hsvkey(
*,
hue: Float = Default("0"),
sat: Float = Default("0"),
val: Float = Default("0"),
similarity: Float = Default("0.01"),
blend: Float = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Turns a certain HSV range into transparency.
This filter measures color difference between set HSV color in options and ones measured in video stream. Depending on options, output colors can be changed to transparent by adding alpha channel.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hue
|
Float
|
Set the hue value which will be used in color difference calculation. Allowed range is from -360 to 360. Default value is 0. |
Default('0')
|
sat
|
Float
|
Set the saturation value which will be used in color difference calculation. Allowed range is from -1 to 1. Default value is 0. |
Default('0')
|
val
|
Float
|
Set the value which will be used in color difference calculation. Allowed range is from -1 to 1. Default value is 0. |
Default('0')
|
similarity
|
Float
|
Set similarity percentage with the key color. Allowed range is from 0 to 1. Default value is 0.01. 0.00001 matches only the exact key color, while 1.0 matches everything. |
Default('0.01')
|
blend
|
Float
|
Blend percentage. Allowed range is from 0 to 1. Default value is 0. 0.0 makes pixels either fully transparent, or not transparent at all. Higher values result in semi-transparent pixels, with a higher transparency the more similar the pixels color is to the key color. |
Default('0')
|
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
hue
¶
hue(
*,
h: String = Default(None),
s: String = Default("1"),
H: String = Default(None),
b: String = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Modify the hue and/or the saturation of the input.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
String
|
set the hue angle degrees expression |
Default(None)
|
s
|
String
|
set the saturation expression (default "1") |
Default('1')
|
H
|
String
|
Modify the hue and/or the saturation and/or brightness of the input video. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. |
Default(None)
|
b
|
String
|
set the brightness expression (default "0") |
Default('0')
|
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
huesaturation
¶
huesaturation(
*,
hue: Float = Default("0"),
saturation: Float = Default("0"),
intensity: Float = Default("0"),
colors: (
Flags
| Literal["r", "y", "g", "c", "b", "m", "a"]
| Default
) = Default("r+y+g+c+b+m+a"),
strength: Float = Default("1"),
rw: Float = Default("0.333"),
gw: Float = Default("0.334"),
bw: Float = Default("0.333"),
lightness: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply hue-saturation-intensity adjustments to input video stream.
This filter operates in RGB colorspace.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hue
|
Float
|
Set the hue shift in degrees to apply. Default is 0. Allowed range is from -180 to 180. |
Default('0')
|
saturation
|
Float
|
Set the saturation shift. Default is 0. Allowed range is from -1 to 1. |
Default('0')
|
intensity
|
Float
|
Set the intensity shift. Default is 0. Allowed range is from -1 to 1. |
Default('0')
|
colors
|
Flags | Literal['r', 'y', 'g', 'c', 'b', 'm', 'a'] | Default
|
Set which primary and complementary colors are going to be adjusted. This options is set by providing one or multiple values. This can select multiple colors at once. By default all colors are selected. @end table |
Default('r+y+g+c+b+m+a')
|
strength
|
Float
|
Set strength of filtering. Allowed range is from 0 to 100. Default value is 1. |
Default('1')
|
rw
|
Float
|
Set weight for each RGB component. Allowed range is from 0 to 1. By default is set to 0.333, 0.334, 0.333. Those options are used in saturation and lightess processing. |
Default('0.333')
|
gw
|
Float
|
Set weight for each RGB component. Allowed range is from 0 to 1. By default is set to 0.333, 0.334, 0.333. Those options are used in saturation and lightess processing. |
Default('0.334')
|
bw
|
Float
|
Set weight for each RGB component. Allowed range is from 0 to 1. By default is set to 0.333, 0.334, 0.333. Those options are used in saturation and lightess processing. |
Default('0.333')
|
lightness
|
Boolean
|
Set preserving lightness, by default is disabled. Adjusting hues can change lightness from original RGB triplet, with this option enabled lightness is kept at same value. |
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
hwdownload
¶
hwdownload(
extra_options: dict[str, Any] | None = None,
) -> VideoStream
Download hardware frames to system memory.
The input must be in hardware frames, and the output a non-hardware format. Not all formats will be supported on the output - it may be necessary to insert an additional format filter immediately following in the graph to get the output in a supported format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
hwmap
¶
hwmap(
*,
mode: (
Flags
| Literal["read", "write", "overwrite", "direct"]
| Default
) = Default("read+write"),
derive_device: String = Default(None),
reverse: Int = Default("0"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Map hardware frames to system memory or to another device.
This filter has several different modes of operation; which one is used depends on the input and output formats:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Flags | Literal['read', 'write', 'overwrite', 'direct'] | Default
|
Set the frame mapping mode. Some combination of: @end table Defaults to read+write if not specified. |
Default('read+write')
|
derive_device
|
String
|
Derive a new device of this type |
Default(None)
|
reverse
|
Int
|
In a hardware to hardware mapping, map in reverse - create frames in the sink and map them back to the source. This may be necessary in some cases where a mapping in one direction is required but only the opposite direction is supported by the devices being used. This option is dangerous - it may break the preceding filter in undefined ways if there are any additional constraints on that filter's output. Do not use it without fully understanding the implications of its use. |
Default('0')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
hwupload
¶
hwupload(
*,
derive_device: String = Default(None),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Upload system memory frames to hardware surfaces.
The device to upload to must be supplied when the filter is initialised. If using ffmpeg, select the appropriate device with the -filter_hw_device option or with the derive_device option. The input and output devices must be of different types and compatible - the exact meaning of this is system-dependent, but typically it means that they must refer to the same underlying hardware context (for example, refer to the same graphics card).
The following additional parameters are accepted:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
derive_device
|
String
|
Derive a new device of this type |
Default(None)
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
hysteresis
¶
hysteresis(
_alt: VideoStream,
*,
planes: Int = Default("15"),
threshold: Int = Default("0"),
framesync_options: FFMpegFrameSyncOption | None = None,
eof_action: str | None = None,
shortest: bool | None = None,
repeatlast: bool | None = None,
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Grow first stream into second stream by connecting components. This makes it possible to build more robust edge masks.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planes
|
Int
|
Set which planes will be processed as bitmap, unprocessed planes will be copied from first stream. By default value 0xf, all planes will be processed. |
Default('15')
|
threshold
|
Int
|
Set threshold which is used in filtering. If pixel component value is higher than this value filter algorithm for connecting components is activated. By default value is 0. |
Default('0')
|
framesync_options
|
FFMpegFrameSyncOption | None
|
Framesync options |
None
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
identity
¶
identity(
_reference: VideoStream,
framesync_options: FFMpegFrameSyncOption | None = None,
eof_action: str | None = None,
shortest: bool | None = None,
repeatlast: bool | None = None,
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None,
) -> VideoStream
Obtain the identity score between two input videos.
This filter takes two input videos.
Both input videos must have the same resolution and pixel format for this filter to work correctly. Also it assumes that both inputs have the same number of frames, which are compared one by one.
The obtained per component, average, min and max identity score is printed through the logging system.
The filter stores the calculated identity scores of each frame in frame metadata.
In the below example the input file main.mpg being processed is compared with the reference file ref.mpg.
@example ffmpeg -i main.mpg -i ref.mpg -lavfi identity -f null - @end example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
framesync_options
|
FFMpegFrameSyncOption | None
|
Framesync options |
None
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
idet
¶
idet(
*,
intl_thres: Float = Default("1.04"),
prog_thres: Float = Default("1.5"),
rep_thres: Float = Default("3"),
half_life: Float = Default("0"),
analyze_interlaced_flag: Int = Default("0"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Detect video interlacing type.
This filter tries to detect if the input frames are interlaced, progressive, top or bottom field first. It will also try to detect fields that are repeated between adjacent frames (a sign of telecine).
Single frame detection considers only immediately adjacent frames when classifying each frame. Multiple frame detection incorporates the classification history of previous frames.
The filter will log these metadata values:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
intl_thres
|
Float
|
Set interlacing threshold. |
Default('1.04')
|
prog_thres
|
Float
|
Set progressive threshold. |
Default('1.5')
|
rep_thres
|
Float
|
Threshold for repeated field detection. |
Default('3')
|
half_life
|
Float
|
Number of frames after which a given frame's contribution to the statistics is halved (i.e., it contributes only 0.5 to its classification). The default of 0 means that all frames seen are given full weight of 1.0 forever. |
Default('0')
|
analyze_interlaced_flag
|
Int
|
When this is not 0 then idet will use the specified number of frames to determine if the interlaced flag is accurate, it will not count undetermined frames. If the flag is found to be accurate it will be used without any further computations, if it is found to be inaccurate it will be cleared without any further computations. This allows inserting the idet filter as a low computational method to clean up the interlaced flag |
Default('0')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
il
¶
il(
*,
luma_mode: (
Int
| Literal[
"none", "interleave", "i", "deinterleave", "d"
]
| Default
) = Default("none"),
chroma_mode: (
Int
| Literal[
"none", "interleave", "i", "deinterleave", "d"
]
| Default
) = Default("none"),
alpha_mode: (
Int
| Literal[
"none", "interleave", "i", "deinterleave", "d"
]
| Default
) = Default("none"),
luma_swap: Boolean = Default("false"),
chroma_swap: Boolean = Default("false"),
alpha_swap: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Deinterleave or interleave fields.
This filter allows one to process interlaced images fields without deinterlacing them. Deinterleaving splits the input frame into 2 fields (so called half pictures). Odd lines are moved to the top half of the output image, even lines to the bottom half. You can process (filter) them independently and then re-interleave them.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
luma_mode
|
Int | Literal['none', 'interleave', 'i', 'deinterleave', 'd'] | Default
|
select luma mode (from 0 to 2) (default none) |
Default('none')
|
chroma_mode
|
Int | Literal['none', 'interleave', 'i', 'deinterleave', 'd'] | Default
|
select chroma mode (from 0 to 2) (default none) |
Default('none')
|
alpha_mode
|
Int | Literal['none', 'interleave', 'i', 'deinterleave', 'd'] | Default
|
Available values for luma_mode, chroma_mode and alpha_mode are: @end table Default value is none. |
Default('none')
|
luma_swap
|
Boolean
|
swap luma fields (default false) |
Default('false')
|
chroma_swap
|
Boolean
|
swap chroma fields (default false) |
Default('false')
|
alpha_swap
|
Boolean
|
Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is 0. |
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
inflate
¶
inflate(
*,
threshold0: Int = Default("65535"),
threshold1: Int = Default("65535"),
threshold2: Int = Default("65535"),
threshold3: Int = Default("65535"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply inflate effect to the video.
This filter replaces the pixel by the local(3x3) average by taking into account only values higher than the pixel.
It accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold0
|
Int
|
set threshold for 1st plane (from 0 to 65535) (default 65535) |
Default('65535')
|
threshold1
|
Int
|
set threshold for 2nd plane (from 0 to 65535) (default 65535) |
Default('65535')
|
threshold2
|
Int
|
set threshold for 3rd plane (from 0 to 65535) (default 65535) |
Default('65535')
|
threshold3
|
Int
|
Limit the maximum change for each plane, default is 65535. If 0, plane will remain unchanged. |
Default('65535')
|
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
interlace
¶
interlace(
*,
scan: Int | Literal["tff", "bff"] | Default = Default(
"tff"
),
lowpass: (
Int | Literal["off", "linear", "complex"] | Default
) = Default("linear"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Simple interlacing filter from progressive contents. This interleaves upper (or lower) lines from odd frames with lower (or upper) lines from even frames, halving the frame rate and preserving image height.
@example Original Original New Frame Frame 'j' Frame 'j+1' (tff) ========== =========== ================== Line 0 --------------------> Frame 'j' Line 0 Line 1 Line 1 ----> Frame 'j+1' Line 1 Line 2 ---------------------> Frame 'j' Line 2 Line 3 Line 3 ----> Frame 'j+1' Line 3 ... ... ... New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on @end example
It accepts the following optional parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scan
|
Int | Literal['tff', 'bff'] | Default
|
This determines whether the interlaced frame is taken from the even (tff - default) or odd (bff) lines of the progressive frame. |
Default('tff')
|
lowpass
|
Int | Literal['off', 'linear', 'complex'] | Default
|
Vertical lowpass filter to avoid twitter interlacing and reduce moire patterns. @end table |
Default('linear')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
kerndeint
¶
kerndeint(
*,
thresh: Int = Default("10"),
map: Boolean = Default("false"),
order: Boolean = Default("false"),
sharp: Boolean = Default("false"),
twoway: Boolean = Default("false"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Deinterlace input video by applying Donald Graft's adaptive kernel deinterling. Work on interlaced parts of a video to produce progressive frames.
The description of the accepted parameters follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
thresh
|
Int
|
Set the threshold which affects the filter's tolerance when determining if a pixel line must be processed. It must be an integer in the range [0,255] and defaults to 10. A value of 0 will result in applying the process on every pixels. |
Default('10')
|
map
|
Boolean
|
Paint pixels exceeding the threshold value to white if set to 1. Default is 0. |
Default('false')
|
order
|
Boolean
|
Set the fields order. Swap fields if set to 1, leave fields alone if 0. Default is 0. |
Default('false')
|
sharp
|
Boolean
|
Enable additional sharpening if set to 1. Default is 0. |
Default('false')
|
twoway
|
Boolean
|
Enable twoway sharpening if set to 1. Default is 0. |
Default('false')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
kirsch
¶
kirsch(
*,
planes: Int = Default("15"),
scale: Float = Default("1"),
delta: Float = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply kirsch operator to input video stream.
The filter accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planes
|
Int
|
Set which planes will be processed, unprocessed planes will be copied. By default value 0xf, all planes will be processed. |
Default('15')
|
scale
|
Float
|
Set value which will be multiplied with filtered result. |
Default('1')
|
delta
|
Float
|
Set value which will be added to filtered result. |
Default('0')
|
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
lagfun
¶
lagfun(
*,
decay: Float = Default("0.95"),
planes: Flags = Default("F"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Slowly update darker pixels.
This filter makes short flashes of light appear longer. This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
decay
|
Float
|
Set factor for decaying. Default is .95. Allowed range is from 0 to 1. |
Default('0.95')
|
planes
|
Flags
|
Set which planes to filter. Default is all. Allowed range is from 0 to 15. |
Default('F')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
latency
¶
latency(
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None,
) -> VideoStream
Measure filtering latency.
Report previous filter filtering latency, delay in number of audio samples for audio filters or number of video frames for video filters.
On end of input stream, filter will report min and max measured latency for previous running filter in filtergraph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
lenscorrection
¶
lenscorrection(
*,
cx: Double = Default("0.5"),
cy: Double = Default("0.5"),
k1: Double = Default("0"),
k2: Double = Default("0"),
i: (
Int | Literal["nearest", "bilinear"] | Default
) = Default("nearest"),
fc: Color = Default("black@0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Correct radial lens distortion
This filter can be used to correct for radial distortion as can result from the use of wide angle lenses, and thereby re-rectify the image. To find the right parameters one can use tools available for example as part of opencv or simply trial-and-error. To use opencv use the calibration sample (under samples/cpp) from the opencv sources and extract the k1 and k2 coefficients from the resulting matrix.
Note that effectively the same filter is available in the open-source tools Krita and Digikam from the KDE project.
In contrast to the vignette filter, which can also be used to compensate lens errors, this filter corrects the distortion of the image, whereas vignette corrects the brightness distribution, so you may want to use both filters together in certain cases, though you will have to take care of ordering, i.e. whether vignetting should be applied before or after lens correction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cx
|
Double
|
Relative x-coordinate of the focal point of the image, and thereby the center of the distortion. This value has a range [0,1] and is expressed as fractions of the image width. Default is 0.5. |
Default('0.5')
|
cy
|
Double
|
Relative y-coordinate of the focal point of the image, and thereby the center of the distortion. This value has a range [0,1] and is expressed as fractions of the image height. Default is 0.5. |
Default('0.5')
|
k1
|
Double
|
Coefficient of the quadratic correction term. This value has a range [-1,1]. 0 means no correction. Default is 0. |
Default('0')
|
k2
|
Double
|
Coefficient of the double quadratic correction term. This value has a range [-1,1]. 0 means no correction. Default is 0. |
Default('0')
|
i
|
Int | Literal['nearest', 'bilinear'] | Default
|
Set interpolation type. Can be nearest or bilinear. Default is nearest. |
Default('nearest')
|
fc
|
Color
|
Specify the color of the unmapped pixels. For the syntax of this option, check the "Color" section in the ffmpeg-utils manual. Default color is black@0. |
Default('black@0')
|
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
libvmaf
¶
libvmaf(
_reference: VideoStream,
*,
model_path: String = Default(None),
log_path: String = Default(None),
log_fmt: String = Default("xml"),
enable_transform: Boolean = Default("false"),
psnr: Boolean = Default("false"),
ssim: Boolean = Default("false"),
ms_ssim: Boolean = Default("false"),
pool: String = Default(None),
n_threads: Int = Default("0"),
n_subsample: Int = Default("1"),
enable_conf_interval: Boolean = Default("false"),
model: String = Default("version=vmaf_v0.6.1"),
feature: String = Default(None),
framesync_options: FFMpegFrameSyncOption | None = None,
eof_action: str | None = None,
shortest: bool | None = None,
repeatlast: bool | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Calulate the VMAF (Video Multi-Method Assessment Fusion) score for a reference/distorted pair of input videos.
The first input is the distorted video, and the second input is the reference video.
The obtained VMAF score is printed through the logging system.
It requires Netflix's vmaf library (libvmaf) as a pre-requisite. After installing the library it can be enabled using: ./configure --enable-libvmaf.
The filter has following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_path
|
String
|
Deprecated, use model='path=...'. |
Default(None)
|
log_path
|
String
|
Set the file path to be used to store log files. |
Default(None)
|
log_fmt
|
String
|
Set the format of the log file (xml, json, csv, or sub). |
Default('xml')
|
enable_transform
|
Boolean
|
Deprecated, use model='enable_transform=true'. |
Default('false')
|
psnr
|
Boolean
|
Deprecated, use feature='name=psnr'. |
Default('false')
|
ssim
|
Boolean
|
Deprecated, use feature='name=ssim'. |
Default('false')
|
ms_ssim
|
Boolean
|
Deprecated, use feature='name=ms_ssim'. |
Default('false')
|
pool
|
String
|
Set the pool method to be used for computing vmaf. |
Default(None)
|
n_threads
|
Int
|
Set number of threads to be used when initializing libvmaf. Default value: 0, no threads. |
Default('0')
|
n_subsample
|
Int
|
Set frame subsampling interval to be used. |
Default('1')
|
enable_conf_interval
|
Boolean
|
Deprecated, use model='enable_conf_interval=true'. |
Default('false')
|
model
|
String
|
A |
Default('version=vmaf_v0.6.1')
|
feature
|
String
|
A |
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
limiter
¶
limiter(
*,
min: Int = Default("0"),
max: Int = Default("65535"),
planes: Int = Default("15"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Limits the pixel components values to the specified range [min, max].
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min
|
Int
|
Lower bound. Defaults to the lowest allowed value for the input. |
Default('0')
|
max
|
Int
|
Upper bound. Defaults to the highest allowed value for the input. |
Default('65535')
|
planes
|
Int
|
Specify which planes will be processed. Defaults to all available. |
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
loop
¶
loop(
*,
loop: Int = Default("0"),
size: Int64 = Default("0"),
start: Int64 = Default("0"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Loop video frames.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
loop
|
Int
|
Set the number of loops. Setting this value to -1 will result in infinite loops. Default is 0. |
Default('0')
|
size
|
Int64
|
Set maximal size in number of frames. Default is 0. |
Default('0')
|
start
|
Int64
|
Set first frame of loop. Default is 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
loudnorm
¶
loudnorm(
*,
I: Double = Default("-24"),
LRA: Double = Default("7"),
TP: Double = Default("-2"),
measured_I: Double = Default("0"),
measured_LRA: Double = Default("0"),
measured_TP: Double = Default("99"),
measured_thresh: Double = Default("-70"),
offset: Double = Default("0"),
linear: Boolean = Default("true"),
dual_mono: Boolean = Default("false"),
print_format: (
Int | Literal["none", "json", "summary"] | Default
) = Default("none"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
EBU R128 loudness normalization. Includes both dynamic and linear normalization modes. Support for both single pass (livestreams, files) and double pass (files) modes. This algorithm can target IL, LRA, and maximum true peak. In dynamic mode, to accurately detect true peaks, the audio stream will be upsampled to 192 kHz. Use the -ar option or aresample filter to explicitly set an output sample rate.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
I
|
Double
|
Set integrated loudness target. Range is -70.0 - -5.0. Default value is -24.0. |
Default('-24')
|
LRA
|
Double
|
Set loudness range target. Range is 1.0 - 50.0. Default value is 7.0. |
Default('7')
|
TP
|
Double
|
Set maximum true peak. Range is -9.0 - +0.0. Default value is -2.0. |
Default('-2')
|
measured_I
|
Double
|
Measured IL of input file. Range is -99.0 - +0.0. |
Default('0')
|
measured_LRA
|
Double
|
Measured LRA of input file. Range is 0.0 - 99.0. |
Default('0')
|
measured_TP
|
Double
|
Measured true peak of input file. Range is -99.0 - +99.0. |
Default('99')
|
measured_thresh
|
Double
|
Measured threshold of input file. Range is -99.0 - +0.0. |
Default('-70')
|
offset
|
Double
|
Set offset gain. Gain is applied before the true-peak limiter. Range is -99.0 - +99.0. Default is +0.0. |
Default('0')
|
linear
|
Boolean
|
Normalize by linearly scaling the source audio. measured_I, measured_LRA, measured_TP, and measured_thresh must all be specified. Target LRA shouldn't be lower than source LRA and the change in integrated loudness shouldn't result in a true peak which exceeds the target TP. If any of these conditions aren't met, normalization mode will revert to dynamic. Options are true or false. Default is true. |
Default('true')
|
dual_mono
|
Boolean
|
Treat mono input files as "dual-mono". If a mono file is intended for playback on a stereo system, its EBU R128 measurement will be perceptually incorrect. If set to true, this option will compensate for this effect. Multi-channel input files are not affected by this option. Options are true or false. Default is false. |
Default('false')
|
print_format
|
Int | Literal['none', 'json', 'summary'] | Default
|
Set print format for stats. Options are summary, json, or none. Default value is none. |
Default('none')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
lowpass
¶
lowpass(
*,
frequency: Double = Default("500"),
width_type: (
Int | Literal["h", "q", "o", "s", "k"] | Default
) = Default("q"),
width: Double = Default("0.707"),
poles: Int = Default("2"),
mix: Double = Default("1"),
channels: String = Default("all"),
normalize: Boolean = Default("false"),
transform: (
Int
| Literal[
"di", "dii", "tdi", "tdii", "latt", "svf", "zdf"
]
| Default
) = Default("di"),
precision: (
Int
| Literal["auto", "s16", "s32", "f32", "f64"]
| Default
) = Default("auto"),
blocksize: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply a low-pass filter with 3dB point frequency. The filter can be either single-pole or double-pole (the default). The filter roll off at 6dB per pole per octave (20dB per pole per decade).
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequency
|
Double
|
Change lowpass frequency. Syntax for the command is : "frequency" |
Default('500')
|
width_type
|
Int | Literal['h', 'q', 'o', 's', 'k'] | Default
|
Change lowpass width_type. Syntax for the command is : "width_type" |
Default('q')
|
width
|
Double
|
Change lowpass width. Syntax for the command is : "width" |
Default('0.707')
|
poles
|
Int
|
Set number of poles. Default is 2. |
Default('2')
|
mix
|
Double
|
Change lowpass mix. Syntax for the command is : "mix" |
Default('1')
|
channels
|
String
|
Specify which channels to filter, by default all available are filtered. |
Default('all')
|
normalize
|
Boolean
|
Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. |
Default('false')
|
transform
|
Int | Literal['di', 'dii', 'tdi', 'tdii', 'latt', 'svf', 'zdf'] | Default
|
Set transform type of IIR filter. @end table |
Default('di')
|
precision
|
Int | Literal['auto', 's16', 's32', 'f32', 'f64'] | Default
|
Set precison of filtering. @end table |
Default('auto')
|
blocksize
|
Int
|
set the block size (from 0 to 32768) (default 0) |
Default('0')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
lowshelf
¶
lowshelf(
*,
frequency: Double = Default("100"),
width_type: (
Int | Literal["h", "q", "o", "s", "k"] | Default
) = Default("q"),
width: Double = Default("0.5"),
gain: Double = Default("0"),
poles: Int = Default("2"),
mix: Double = Default("1"),
channels: String = Default("all"),
normalize: Boolean = Default("false"),
transform: (
Int
| Literal[
"di", "dii", "tdi", "tdii", "latt", "svf", "zdf"
]
| Default
) = Default("di"),
precision: (
Int
| Literal["auto", "s16", "s32", "f32", "f64"]
| Default
) = Default("auto"),
blocksize: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Boost or cut the bass (lower) frequencies of the audio using a two-pole shelving filter with a response similar to that of a standard hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequency
|
Double
|
Change bass frequency. Syntax for the command is : "frequency" |
Default('100')
|
width_type
|
Int | Literal['h', 'q', 'o', 's', 'k'] | Default
|
Change bass width_type. Syntax for the command is : "width_type" |
Default('q')
|
width
|
Double
|
Change bass width. Syntax for the command is : "width" |
Default('0.5')
|
gain
|
Double
|
Change bass gain. Syntax for the command is : "gain" |
Default('0')
|
poles
|
Int
|
Set number of poles. Default is 2. |
Default('2')
|
mix
|
Double
|
Change bass mix. Syntax for the command is : "mix" |
Default('1')
|
channels
|
String
|
Specify which channels to filter, by default all available are filtered. |
Default('all')
|
normalize
|
Boolean
|
Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. |
Default('false')
|
transform
|
Int | Literal['di', 'dii', 'tdi', 'tdii', 'latt', 'svf', 'zdf'] | Default
|
Set transform type of IIR filter. @end table |
Default('di')
|
precision
|
Int | Literal['auto', 's16', 's32', 'f32', 'f64'] | Default
|
Set precison of filtering. @end table |
Default('auto')
|
blocksize
|
Int
|
set the block size (from 0 to 32768) (default 0) |
Default('0')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
lumakey
¶
lumakey(
*,
threshold: Double = Default("0"),
tolerance: Double = Default("0.01"),
softness: Double = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Turn certain luma values into transparency.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
Double
|
Set the luma which will be used as base for transparency. Default value is 0. |
Default('0')
|
tolerance
|
Double
|
Set the range of luma values to be keyed out. Default value is 0.01. |
Default('0.01')
|
softness
|
Double
|
Set the range of softness. Default value is 0. Use this to control gradual transition from zero to full transparency. |
Default('0')
|
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
lut
¶
lut(
*,
c0: String = Default("clipval"),
c1: String = Default("clipval"),
c2: String = Default("clipval"),
c3: String = Default("clipval"),
y: String = Default("clipval"),
u: String = Default("clipval"),
v: String = Default("clipval"),
r: String = Default("clipval"),
g: String = Default("clipval"),
b: String = Default("clipval"),
a: String = Default("clipval"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Compute a look-up table for binding each pixel component input value to an output value, and apply it to the input video.
lutyuv applies a lookup table to a YUV input video, lutrgb to an RGB input video.
These filters accept the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
c0
|
String
|
set first pixel component expression |
Default('clipval')
|
c1
|
String
|
set second pixel component expression |
Default('clipval')
|
c2
|
String
|
set third pixel component expression |
Default('clipval')
|
c3
|
String
|
set fourth pixel component expression, corresponds to the alpha component |
Default('clipval')
|
y
|
String
|
set Y/luminance component expression |
Default('clipval')
|
u
|
String
|
set U/Cb component expression |
Default('clipval')
|
v
|
String
|
set V/Cr component expression |
Default('clipval')
|
r
|
String
|
set red component expression |
Default('clipval')
|
g
|
String
|
set green component expression |
Default('clipval')
|
b
|
String
|
set blue component expression |
Default('clipval')
|
a
|
String
|
alpha component expression |
Default('clipval')
|
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
lut1d
¶
lut1d(
*,
file: String = Default(None),
interp: (
Int
| Literal[
"nearest", "linear", "cosine", "cubic", "spline"
]
| Default
) = Default("linear"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply a 1D LUT to an input video.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
String
|
Set the 1D LUT file name. Currently supported formats: @end table |
Default(None)
|
interp
|
Int | Literal['nearest', 'linear', 'cosine', 'cubic', 'spline'] | Default
|
Select interpolation mode. Available values are: @end table |
Default('linear')
|
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
lut2
¶
lut2(
_srcy: VideoStream,
*,
c0: String = Default("x"),
c1: String = Default("x"),
c2: String = Default("x"),
c3: String = Default("x"),
d: Int = Default("0"),
framesync_options: FFMpegFrameSyncOption | None = None,
eof_action: str | None = None,
shortest: bool | None = None,
repeatlast: bool | None = None,
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
The lut2 filter takes two input streams and outputs one stream.
The tlut2 (time lut2) filter takes two consecutive frames from one single stream.
This filter accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
c0
|
String
|
set first pixel component expression |
Default('x')
|
c1
|
String
|
set second pixel component expression |
Default('x')
|
c2
|
String
|
set third pixel component expression |
Default('x')
|
c3
|
String
|
set fourth pixel component expression, corresponds to the alpha component |
Default('x')
|
d
|
Int
|
set output bit depth, only available for lut2 filter. By default is 0, which means bit depth is automatically picked from first input format. |
Default('0')
|
framesync_options
|
FFMpegFrameSyncOption | None
|
Framesync options |
None
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
lut3d
¶
lut3d(
*,
file: String = Default(None),
clut: Int | Literal["first", "all"] | Default = Default(
"all"
),
interp: (
Int
| Literal[
"nearest",
"trilinear",
"tetrahedral",
"pyramid",
"prism",
]
| Default
) = Default("tetrahedral"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply a 3D LUT to an input video.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
String
|
Set the 3D LUT file name. Currently supported formats: @end table |
Default(None)
|
clut
|
Int | Literal['first', 'all'] | Default
|
when to process CLUT (from 0 to 1) (default all) |
Default('all')
|
interp
|
Int | Literal['nearest', 'trilinear', 'tetrahedral', 'pyramid', 'prism'] | Default
|
Select interpolation mode. Available values are: @end table |
Default('tetrahedral')
|
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
lutrgb
¶
lutrgb(
*,
c0: String = Default("clipval"),
c1: String = Default("clipval"),
c2: String = Default("clipval"),
c3: String = Default("clipval"),
y: String = Default("clipval"),
u: String = Default("clipval"),
v: String = Default("clipval"),
r: String = Default("clipval"),
g: String = Default("clipval"),
b: String = Default("clipval"),
a: String = Default("clipval"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Compute a look-up table for binding each pixel component input value to an output value, and apply it to the input video.
lutyuv applies a lookup table to a YUV input video, lutrgb to an RGB input video.
These filters accept the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
c0
|
String
|
set first pixel component expression |
Default('clipval')
|
c1
|
String
|
set second pixel component expression |
Default('clipval')
|
c2
|
String
|
set third pixel component expression |
Default('clipval')
|
c3
|
String
|
set fourth pixel component expression, corresponds to the alpha component |
Default('clipval')
|
y
|
String
|
set Y/luminance component expression |
Default('clipval')
|
u
|
String
|
set U/Cb component expression |
Default('clipval')
|
v
|
String
|
set V/Cr component expression |
Default('clipval')
|
r
|
String
|
set red component expression |
Default('clipval')
|
g
|
String
|
set green component expression |
Default('clipval')
|
b
|
String
|
set blue component expression |
Default('clipval')
|
a
|
String
|
alpha component expression |
Default('clipval')
|
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
lutyuv
¶
lutyuv(
*,
c0: String = Default("clipval"),
c1: String = Default("clipval"),
c2: String = Default("clipval"),
c3: String = Default("clipval"),
y: String = Default("clipval"),
u: String = Default("clipval"),
v: String = Default("clipval"),
r: String = Default("clipval"),
g: String = Default("clipval"),
b: String = Default("clipval"),
a: String = Default("clipval"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Compute a look-up table for binding each pixel component input value to an output value, and apply it to the input video.
lutyuv applies a lookup table to a YUV input video, lutrgb to an RGB input video.
These filters accept the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
c0
|
String
|
set first pixel component expression |
Default('clipval')
|
c1
|
String
|
set second pixel component expression |
Default('clipval')
|
c2
|
String
|
set third pixel component expression |
Default('clipval')
|
c3
|
String
|
set fourth pixel component expression, corresponds to the alpha component |
Default('clipval')
|
y
|
String
|
set Y/luminance component expression |
Default('clipval')
|
u
|
String
|
set U/Cb component expression |
Default('clipval')
|
v
|
String
|
set V/Cr component expression |
Default('clipval')
|
r
|
String
|
set red component expression |
Default('clipval')
|
g
|
String
|
set green component expression |
Default('clipval')
|
b
|
String
|
set blue component expression |
Default('clipval')
|
a
|
String
|
alpha component expression |
Default('clipval')
|
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
maskedclamp
¶
maskedclamp(
_dark: VideoStream,
_bright: VideoStream,
*,
undershoot: Int = Default("0"),
overshoot: Int = Default("0"),
planes: Int = Default("15"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Clamp the first input stream with the second input and third input stream.
Returns the value of first stream to be between second input stream - undershoot and third input stream + overshoot.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
undershoot
|
Int
|
Default value is 0. |
Default('0')
|
overshoot
|
Int
|
Default value is 0. |
Default('0')
|
planes
|
Int
|
Set which planes will be processed as bitmap, unprocessed planes will be copied from first stream. By default value 0xf, all planes will be processed. |
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
maskedmax
¶
maskedmax(
_filter1: VideoStream,
_filter2: VideoStream,
*,
planes: Int = Default("15"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Merge the second and third input stream into output stream using absolute differences between second input stream and first input stream and absolute difference between third input stream and first input stream. The picked value will be from second input stream if second absolute difference is greater than first one or from third input stream otherwise.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planes
|
Int
|
Set which planes will be processed as bitmap, unprocessed planes will be copied from first stream. By default value 0xf, all planes will be processed. |
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
maskedmerge
¶
maskedmerge(
_overlay: VideoStream,
_mask: VideoStream,
*,
planes: Int = Default("15"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Merge the first input stream with the second input stream using per pixel weights in the third input stream.
A value of 0 in the third stream pixel component means that pixel component from first stream is returned unchanged, while maximum value (eg. 255 for 8-bit videos) means that pixel component from second stream is returned unchanged. Intermediate values define the amount of merging between both input stream's pixel components.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planes
|
Int
|
Set which planes will be processed as bitmap, unprocessed planes will be copied from first stream. By default value 0xf, all planes will be processed. |
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
maskedmin
¶
maskedmin(
_filter1: VideoStream,
_filter2: VideoStream,
*,
planes: Int = Default("15"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Merge the second and third input stream into output stream using absolute differences between second input stream and first input stream and absolute difference between third input stream and first input stream. The picked value will be from second input stream if second absolute difference is less than first one or from third input stream otherwise.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planes
|
Int
|
Set which planes will be processed as bitmap, unprocessed planes will be copied from first stream. By default value 0xf, all planes will be processed. |
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
maskedthreshold
¶
maskedthreshold(
_reference: VideoStream,
*,
threshold: Int = Default("1"),
planes: Int = Default("15"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Pick pixels comparing absolute difference of two video streams with fixed threshold.
If absolute difference between pixel component of first and second video stream is equal or lower than user supplied threshold than pixel component from first video stream is picked, otherwise pixel component from second video stream is picked.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
Int
|
Set threshold used when picking pixels from absolute difference from two input video streams. |
Default('1')
|
planes
|
Int
|
Set which planes will be processed as bitmap, unprocessed planes will be copied from second stream. By default value 0xf, all planes will be processed. |
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
maskfun
¶
maskfun(
*,
low: Int = Default("10"),
high: Int = Default("10"),
planes: Int = Default("15"),
fill: Int = Default("0"),
sum: Int = Default("10"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Create mask from input video.
For example it is useful to create motion masks after tblend filter.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
low
|
Int
|
Set low threshold. Any pixel component lower or exact than this value will be set to 0. |
Default('10')
|
high
|
Int
|
Set high threshold. Any pixel component higher than this value will be set to max value allowed for current pixel format. |
Default('10')
|
planes
|
Int
|
Set planes to filter, by default all available planes are filtered. |
Default('15')
|
fill
|
Int
|
Fill all frame pixels with this value. |
Default('0')
|
sum
|
Int
|
Set max average pixel value for frame. If sum of all pixel components is higher that this average, output frame will be completely filled with value set by fill option. Typically useful for scene changes when used in combination with tblend filter. |
Default('10')
|
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
mcompand
¶
mcompand(
*,
args: String = Default(
"0.005,0.1 6 -47/-40,-34/-34,-17/-33 100 | 0.003,0.05 6 -47/-40,-34/-34,-17/-33 400 | 0.000625,0.0125 6 -47/-40,-34/-34,-15/-33 1600 | 0.0001,0.025 6 -47/-40,-34/-34,-31/-31,-0/-30 6400 | 0,0.025 6 -38/-31,-28/-28,-0/-25 22000"
),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Multiband Compress or expand the audio's dynamic range.
The input audio is divided into bands using 4th order Linkwitz-Riley IIRs. This is akin to the crossover of a loudspeaker, and results in flat frequency response when absent compander action.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args
|
String
|
This option syntax is: attack,decay,[attack,decay..] soft-knee points crossover_frequency [delay [initial_volume [gain]]] | attack,decay ... For explanation of each item refer to compand filter documentation. |
Default('0.005,0.1 6 -47/-40,-34/-34,-17/-33 100 | 0.003,0.05 6 -47/-40,-34/-34,-17/-33 400 | 0.000625,0.0125 6 -47/-40,-34/-34,-15/-33 1600 | 0.0001,0.025 6 -47/-40,-34/-34,-31/-31,-0/-30 6400 | 0,0.025 6 -38/-31,-28/-28,-0/-25 22000')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
median
¶
median(
*,
radius: Int = Default("1"),
planes: Int = Default("15"),
radiusV: Int = Default("0"),
percentile: Float = Default("0.5"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Pick median pixel from certain rectangle defined by radius.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radius
|
Int
|
Set horizontal radius size. Default value is 1. Allowed range is integer from 1 to 127. |
Default('1')
|
planes
|
Int
|
Set which planes to process. Default is 15, which is all available planes. |
Default('15')
|
radiusV
|
Int
|
Set vertical radius size. Default value is 0. Allowed range is integer from 0 to 127. If it is 0, value will be picked from horizontal radius option. |
Default('0')
|
percentile
|
Float
|
Set median percentile. Default value is 0.5. Default value of 0.5 will pick always median values, while 0 will pick minimum values, and 1 maximum values. |
Default('0.5')
|
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
mestimate
¶
mestimate(
*,
method: (
Int
| Literal[
"esa",
"tss",
"tdls",
"ntss",
"fss",
"ds",
"hexbs",
"epzs",
"umh",
]
| Default
) = Default("esa"),
mb_size: Int = Default("16"),
search_param: Int = Default("7"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Estimate and export motion vectors using block matching algorithms. Motion vectors are stored in frame side data to be used by other filters.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method
|
Int | Literal['esa', 'tss', 'tdls', 'ntss', 'fss', 'ds', 'hexbs', 'epzs', 'umh'] | Default
|
Specify the motion estimation method. Accepts one of the following values: @end table Default value is esa. |
Default('esa')
|
mb_size
|
Int
|
Macroblock size. Default 16. |
Default('16')
|
search_param
|
Int
|
Search parameter. Default 7. |
Default('7')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
metadata
¶
metadata(
*,
mode: (
Int
| Literal[
"select", "add", "modify", "delete", "print"
]
| Default
) = Default("select"),
key: String = Default(None),
value: String = Default(None),
function: (
Int
| Literal[
"same_str",
"starts_with",
"less",
"equal",
"greater",
"expr",
"ends_with",
]
| Default
) = Default("same_str"),
expr: String = Default(None),
file: String = Default(None),
direct: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Manipulate frame metadata.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Int | Literal['select', 'add', 'modify', 'delete', 'print'] | Default
|
Set mode of operation of the filter. Can be one of the following: @end table |
Default('select')
|
key
|
String
|
Set key used with all modes. Must be set for all modes except print and delete. |
Default(None)
|
value
|
String
|
Set metadata value which will be used. This option is mandatory for modify and add mode. |
Default(None)
|
function
|
Int | Literal['same_str', 'starts_with', 'less', 'equal', 'greater', 'expr', 'ends_with'] | Default
|
Which function to use when comparing metadata value and value. Can be one of following: @end table |
Default('same_str')
|
expr
|
String
|
Set expression which is used when function is set to expr. The expression is evaluated through the eval API and can contain the following constants: @end table |
Default(None)
|
file
|
String
|
If specified in print mode, output is written to the named file. Instead of plain filename any writable url can be specified. Filename ``-'' is a shorthand for standard output. If file option is not set, output is written to the log with AV_LOG_INFO loglevel. |
Default(None)
|
direct
|
Boolean
|
Reduces buffering in print mode when output is written to a URL set using file. |
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
midequalizer
¶
midequalizer(
_in1: VideoStream,
*,
planes: Int = Default("15"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply Midway Image Equalization effect using two video streams.
Midway Image Equalization adjusts a pair of images to have the same histogram, while maintaining their dynamics as much as possible. It's useful for e.g. matching exposures from a pair of stereo cameras.
This filter has two inputs and one output, which must be of same pixel format, but may be of different sizes. The output of filter is first input adjusted with midway histogram of both inputs.
This filter accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planes
|
Int
|
Set which planes to process. Default is 15, which is all available planes. |
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
minterpolate
¶
minterpolate(
*,
fps: Video_rate = Default("60"),
mi_mode: (
Int | Literal["dup", "blend", "mci"] | Default
) = Default("mci"),
mc_mode: (
Int | Literal["obmc", "aobmc"] | Default
) = Default("obmc"),
me_mode: (
Int | Literal["bidir", "bilat"] | Default
) = Default("bilat"),
me: (
Int
| Literal[
"esa",
"tss",
"tdls",
"ntss",
"fss",
"ds",
"hexbs",
"epzs",
"umh",
]
| Default
) = Default("epzs"),
mb_size: Int = Default("16"),
search_param: Int = Default("32"),
vsbmc: Int = Default("0"),
scd: Int | Literal["none", "fdiff"] | Default = Default(
"fdiff"
),
scd_threshold: Double = Default("10"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert the video to specified frame rate using motion interpolation.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fps
|
Video_rate
|
Specify the output frame rate. This can be rational e.g. 60000/1001. Frames are dropped if fps is lower than source fps. Default 60. |
Default('60')
|
mi_mode
|
Int | Literal['dup', 'blend', 'mci'] | Default
|
Motion interpolation mode. Following values are accepted: @end table |
Default('mci')
|
mc_mode
|
Int | Literal['obmc', 'aobmc'] | Default
|
motion compensation mode (from 0 to 1) (default obmc) |
Default('obmc')
|
me_mode
|
Int | Literal['bidir', 'bilat'] | Default
|
motion estimation mode (from 0 to 1) (default bilat) |
Default('bilat')
|
me
|
Int | Literal['esa', 'tss', 'tdls', 'ntss', 'fss', 'ds', 'hexbs', 'epzs', 'umh'] | Default
|
motion estimation method (from 1 to 9) (default epzs) |
Default('epzs')
|
mb_size
|
Int
|
macroblock size (from 4 to 16) (default 16) |
Default('16')
|
search_param
|
Int
|
search parameter (from 4 to INT_MAX) (default 32) |
Default('32')
|
vsbmc
|
Int
|
variable-size block motion compensation (from 0 to 1) (default 0) |
Default('0')
|
scd
|
Int | Literal['none', 'fdiff'] | Default
|
Scene change detection method. Scene change leads motion vectors to be in random direction. Scene change detection replace interpolated frames by duplicate ones. May not be needed for other modes. Following values are accepted: @end table Default method is fdiff. |
Default('fdiff')
|
scd_threshold
|
Double
|
Scene change detection threshold. Default is 10.. |
Default('10')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
monochrome
¶
monochrome(
*,
cb: Float = Default("0"),
cr: Float = Default("0"),
size: Float = Default("1"),
high: Float = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert video to gray using custom color filter.
A description of the accepted options follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cb
|
Float
|
Set the chroma blue spot. Allowed range is from -1 to 1. Default value is 0. |
Default('0')
|
cr
|
Float
|
Set the chroma red spot. Allowed range is from -1 to 1. Default value is 0. |
Default('0')
|
size
|
Float
|
Set the color filter size. Allowed range is from .1 to 10. Default value is 1. |
Default('1')
|
high
|
Float
|
Set the highlights strength. Allowed range is from 0 to 1. Default value is 0. |
Default('0')
|
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
morpho
¶
morpho(
_structure: VideoStream,
*,
mode: (
Int
| Literal[
"erode",
"dilate",
"open",
"close",
"gradient",
"tophat",
"blackhat",
]
| Default
) = Default("erode"),
planes: Int = Default("7"),
structure: (
Int | Literal["first", "all"] | Default
) = Default("all"),
framesync_options: FFMpegFrameSyncOption | None = None,
eof_action: str | None = None,
shortest: bool | None = None,
repeatlast: bool | None = None,
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
This filter allows to apply main morphological grayscale transforms, erode and dilate with arbitrary structures set in second input stream.
Unlike naive implementation and much slower performance in erosion and dilation filters, when speed is critical morpho filter should be used instead.
A description of accepted options follows,
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Int | Literal['erode', 'dilate', 'open', 'close', 'gradient', 'tophat', 'blackhat'] | Default
|
Set morphological transform to apply, can be: @end table Default is erode. |
Default('erode')
|
planes
|
Int
|
Set planes to filter, by default all planes except alpha are filtered. |
Default('7')
|
structure
|
Int | Literal['first', 'all'] | Default
|
Set which structure video frames will be processed from second input stream, can be first or all. Default is all. |
Default('all')
|
framesync_options
|
FFMpegFrameSyncOption | None
|
Framesync options |
None
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
mpdecimate
¶
mpdecimate(
*,
max: Int = Default("0"),
hi: Int = Default("768"),
lo: Int = Default("320"),
frac: Float = Default("0.33"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Drop frames that do not differ greatly from the previous frame in order to reduce frame rate.
The main use of this filter is for very-low-bitrate encoding (e.g. streaming over dialup modem), but it could in theory be used for fixing movies that were inverse-telecined incorrectly.
A description of the accepted options follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max
|
Int
|
Set the maximum number of consecutive frames which can be dropped (if positive), or the minimum interval between dropped frames (if negative). If the value is 0, the frame is dropped disregarding the number of previous sequentially dropped frames. Default value is 0. |
Default('0')
|
hi
|
Int
|
set high dropping threshold (from INT_MIN to INT_MAX) (default 768) |
Default('768')
|
lo
|
Int
|
set low dropping threshold (from INT_MIN to INT_MAX) (default 320) |
Default('320')
|
frac
|
Float
|
Set the dropping threshold values. Values for hi and lo are for 8x8 pixel blocks and represent actual pixel value differences, so a threshold of 64 corresponds to 1 unit of difference for each pixel, or the same spread out differently over the block. A frame is a candidate for dropping if no 8x8 blocks differ by more than a threshold of hi, and if no more than frac blocks (1 meaning the whole image) differ by more than a threshold of lo. Default value for hi is 6412, default value for lo is 645, and default value for frac is 0.33. |
Default('0.33')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
msad
¶
msad(
_reference: VideoStream,
framesync_options: FFMpegFrameSyncOption | None = None,
eof_action: str | None = None,
shortest: bool | None = None,
repeatlast: bool | None = None,
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None,
) -> VideoStream
Obtain the MSAD (Mean Sum of Absolute Differences) between two input videos.
This filter takes two input videos.
Both input videos must have the same resolution and pixel format for this filter to work correctly. Also it assumes that both inputs have the same number of frames, which are compared one by one.
The obtained per component, average, min and max MSAD is printed through the logging system.
The filter stores the calculated MSAD of each frame in frame metadata.
In the below example the input file main.mpg being processed is compared with the reference file ref.mpg.
@example ffmpeg -i main.mpg -i ref.mpg -lavfi msad -f null - @end example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
framesync_options
|
FFMpegFrameSyncOption | None
|
Framesync options |
None
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
multiply
¶
multiply(
_factor: VideoStream,
*,
scale: Float = Default("1"),
offset: Float = Default("0.5"),
planes: Flags = Default("F"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Multiply first video stream pixels values with second video stream pixels values.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scale
|
Float
|
Set the scale applied to second video stream. By default is 1. Allowed range is from 0 to 9. |
Default('1')
|
offset
|
Float
|
Set the offset applied to second video stream. By default is 0.5. Allowed range is from -1 to 1. |
Default('0.5')
|
planes
|
Flags
|
Specify planes from input video stream that will be processed. By default all planes are processed. |
Default('F')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
negate
¶
negate(
*,
components: (
Flags
| Literal["y", "u", "v", "r", "g", "b", "a"]
| Default
) = Default("y+u+v+r+g+b"),
negate_alpha: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Negate (invert) the input video.
It accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
components
|
Flags | Literal['y', 'u', 'v', 'r', 'g', 'b', 'a'] | Default
|
Set components to negate. Available values for components are: @end table |
Default('y+u+v+r+g+b')
|
negate_alpha
|
Boolean
|
With value 1, it negates the alpha component, if present. Default value is 0. |
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
nlmeans
¶
nlmeans(
*,
s: Double = Default("1"),
p: Int = Default("7"),
pc: Int = Default("0"),
r: Int = Default("15"),
rc: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Denoise frames using Non-Local Means algorithm.
Each pixel is adjusted by looking for other pixels with similar contexts. This context similarity is defined by comparing their surrounding patches of size pxp. Patches are searched in an area of rxr around the pixel.
Note that the research area defines centers for patches, which means some patches will be made of pixels outside that research area.
The filter accepts the following options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
s
|
Double
|
Set denoising strength. Default is 1.0. Must be in range [1.0, 30.0]. |
Default('1')
|
p
|
Int
|
Set patch size. Default is 7. Must be odd number in range [0, 99]. |
Default('7')
|
pc
|
Int
|
Same as p but for chroma planes. The default value is 0 and means automatic. |
Default('0')
|
r
|
Int
|
Set research size. Default is 15. Must be odd number in range [0, 99]. |
Default('15')
|
rc
|
Int
|
Same as r but for chroma planes. The default value is 0 and means automatic. |
Default('0')
|
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
nnedi
¶
nnedi(
*,
weights: String = Default("nnedi3_weights.bin"),
deint: (
Int | Literal["all", "interlaced"] | Default
) = Default("all"),
field: (
Int
| Literal["af", "a", "t", "b", "tf", "bf"]
| Default
) = Default("a"),
planes: Int = Default("7"),
nsize: (
Int
| Literal[
"s8x6",
"s16x6",
"s32x6",
"s48x6",
"s8x4",
"s16x4",
"s32x4",
]
| Default
) = Default("s32x4"),
nns: (
Int
| Literal["n16", "n32", "n64", "n128", "n256"]
| Default
) = Default("n32"),
qual: Int | Literal["fast", "slow"] | Default = Default(
"fast"
),
etype: (
Int | Literal["a", "abs", "s", "mse"] | Default
) = Default("a"),
pscrn: (
Int
| Literal["none", "original", "new", "new2", "new3"]
| Default
) = Default("new"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Deinterlace video using neural network edge directed interpolation.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
weights
|
String
|
Mandatory option, without binary file filter can not work. Currently file can be found here: https://github.com/dubhater/vapoursynth-nnedi3/blob/master/src/nnedi3_weights.bin |
Default('nnedi3_weights.bin')
|
deint
|
Int | Literal['all', 'interlaced'] | Default
|
Set which frames to deinterlace, by default it is all. Can be all or interlaced. |
Default('all')
|
field
|
Int | Literal['af', 'a', 't', 'b', 'tf', 'bf'] | Default
|
Set mode of operation. Can be one of the following: @end table |
Default('a')
|
planes
|
Int
|
Set which planes to process, by default filter process all frames. |
Default('7')
|
nsize
|
Int | Literal['s8x6', 's16x6', 's32x6', 's48x6', 's8x4', 's16x4', 's32x4'] | Default
|
Set size of local neighborhood around each pixel, used by the predictor neural network. Can be one of the following: @end table |
Default('s32x4')
|
nns
|
Int | Literal['n16', 'n32', 'n64', 'n128', 'n256'] | Default
|
Set the number of neurons in predictor neural network. Can be one of the following: @end table |
Default('n32')
|
qual
|
Int | Literal['fast', 'slow'] | Default
|
Controls the number of different neural network predictions that are blended together to compute the final output value. Can be fast, default or slow. |
Default('fast')
|
etype
|
Int | Literal['a', 'abs', 's', 'mse'] | Default
|
Set which set of weights to use in the predictor. Can be one of the following: @end table |
Default('a')
|
pscrn
|
Int | Literal['none', 'original', 'new', 'new2', 'new3'] | Default
|
Controls whether or not the prescreener neural network is used to decide which pixels should be processed by the predictor neural network and which can be handled by simple cubic interpolation. The prescreener is trained to know whether cubic interpolation will be sufficient for a pixel or whether it should be predicted by the predictor nn. The computational complexity of the prescreener nn is much less than that of the predictor nn. Since most pixels can be handled by cubic interpolation, using the prescreener generally results in much faster processing. The prescreener is pretty accurate, so the difference between using it and not using it is almost always unnoticeable. Can be one of the following: @end table Default is new. |
Default('new')
|
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
noformat
¶
noformat(
*,
pix_fmts: String = Default(None),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Force libavfilter not to use any of the specified pixel formats for the input to the next filter.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pix_fmts
|
String
|
A '|'-separated list of pixel format names, such as pix_fmts=yuv420p|monow|rgb24". |
Default(None)
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
noise
¶
noise(
*,
all_seed: Int = Default("-1"),
all_strength: Int = Default("0"),
all_flags: (
Flags | Literal["a", "p", "t", "u"] | Default
) = Default("0"),
c0_seed: Int = Default("-1"),
c0_strength: Int = Default("0"),
c0_flags: (
Flags | Literal["a", "p", "t", "u"] | Default
) = Default("0"),
c1_seed: Int = Default("-1"),
c1_strength: Int = Default("0"),
c1_flags: (
Flags | Literal["a", "p", "t", "u"] | Default
) = Default("0"),
c2_seed: Int = Default("-1"),
c2_strength: Int = Default("0"),
c2_flags: (
Flags | Literal["a", "p", "t", "u"] | Default
) = Default("0"),
c3_seed: Int = Default("-1"),
c3_strength: Int = Default("0"),
c3_flags: (
Flags | Literal["a", "p", "t", "u"] | Default
) = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Add noise on video input frame.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
all_seed
|
Int
|
set component #0 noise seed (from -1 to INT_MAX) (default -1) |
Default('-1')
|
all_strength
|
Int
|
set component #0 strength (from 0 to 100) (default 0) |
Default('0')
|
all_flags
|
Flags | Literal['a', 'p', 't', 'u'] | Default
|
set component #0 flags (default 0) |
Default('0')
|
c0_seed
|
Int
|
set component #0 noise seed (from -1 to INT_MAX) (default -1) |
Default('-1')
|
c0_strength
|
Int
|
set component #0 strength (from 0 to 100) (default 0) |
Default('0')
|
c0_flags
|
Flags | Literal['a', 'p', 't', 'u'] | Default
|
set component #0 flags (default 0) |
Default('0')
|
c1_seed
|
Int
|
set component #1 noise seed (from -1 to INT_MAX) (default -1) |
Default('-1')
|
c1_strength
|
Int
|
set component #1 strength (from 0 to 100) (default 0) |
Default('0')
|
c1_flags
|
Flags | Literal['a', 'p', 't', 'u'] | Default
|
set component #1 flags (default 0) |
Default('0')
|
c2_seed
|
Int
|
set component #2 noise seed (from -1 to INT_MAX) (default -1) |
Default('-1')
|
c2_strength
|
Int
|
set component #2 strength (from 0 to 100) (default 0) |
Default('0')
|
c2_flags
|
Flags | Literal['a', 'p', 't', 'u'] | Default
|
set component #2 flags (default 0) |
Default('0')
|
c3_seed
|
Int
|
Set noise seed for specific pixel component or all pixel components in case of all_seed. Default value is 123457. |
Default('-1')
|
c3_strength
|
Int
|
Set noise strength for specific pixel component or all pixel components in case all_strength. Default value is 0. Allowed range is [0, 100]. |
Default('0')
|
c3_flags
|
Flags | Literal['a', 'p', 't', 'u'] | Default
|
Set pixel component flags or set flags for all components if all_flags. Available values for component flags are: @end table |
Default('0')
|
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
normalize
¶
normalize(
*,
blackpt: Color = Default("black"),
whitept: Color = Default("white"),
smoothing: Int = Default("0"),
independence: Float = Default("1"),
strength: Float = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Normalize RGB video (aka histogram stretching, contrast stretching). See: https://en.wikipedia.org/wiki/Normalization_(image_processing)
For each channel of each frame, the filter computes the input range and maps it linearly to the user-specified output range. The output range defaults to the full dynamic range from pure black to pure white.
Temporal smoothing can be used on the input range to reduce flickering (rapid changes in brightness) caused when small dark or bright objects enter or leave the scene. This is similar to the auto-exposure (automatic gain control) on a video camera, and, like a video camera, it may cause a period of over- or under-exposure of the video.
The R,G,B channels can be normalized independently, which may cause some color shifting, or linked together as a single channel, which prevents color shifting. Linked normalization preserves hue. Independent normalization does not, so it can be used to remove some color casts. Independent and linked normalization can be combined in any ratio.
The normalize filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
blackpt
|
Color
|
output color to which darkest input color is mapped (default "black") |
Default('black')
|
whitept
|
Color
|
Colors which define the output range. The minimum input value is mapped to the blackpt. The maximum input value is mapped to the whitept. The defaults are black and white respectively. Specifying white for blackpt and black for whitept will give color-inverted, normalized video. Shades of grey can be used to reduce the dynamic range (contrast). Specifying saturated colors here can create some interesting effects. |
Default('white')
|
smoothing
|
Int
|
The number of previous frames to use for temporal smoothing. The input range of each channel is smoothed using a rolling average over the current frame and the smoothing previous frames. The default is 0 (no temporal smoothing). |
Default('0')
|
independence
|
Float
|
Controls the ratio of independent (color shifting) channel normalization to linked (color preserving) normalization. 0.0 is fully linked, 1.0 is fully independent. Defaults to 1.0 (fully independent). |
Default('1')
|
strength
|
Float
|
Overall strength of the filter. 1.0 is full strength. 0.0 is a rather expensive no-op. Defaults to 1.0 (full strength). |
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
null
¶
null(
extra_options: dict[str, Any] | None = None,
) -> VideoStream
Pass the video source unchanged to the output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
oscilloscope
¶
oscilloscope(
*,
x: Float = Default("0.5"),
y: Float = Default("0.5"),
s: Float = Default("0.8"),
t: Float = Default("0.5"),
o: Float = Default("0.8"),
tx: Float = Default("0.5"),
ty: Float = Default("0.9"),
tw: Float = Default("0.8"),
th: Float = Default("0.3"),
c: Int = Default("7"),
g: Boolean = Default("true"),
st: Boolean = Default("true"),
sc: Boolean = Default("true"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
2D Video Oscilloscope.
Useful to measure spatial impulse, step responses, chroma delays, etc.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Float
|
Set scope center x position. |
Default('0.5')
|
y
|
Float
|
Set scope center y position. |
Default('0.5')
|
s
|
Float
|
Set scope size, relative to frame diagonal. |
Default('0.8')
|
t
|
Float
|
Set scope tilt/rotation. |
Default('0.5')
|
o
|
Float
|
Set trace opacity. |
Default('0.8')
|
tx
|
Float
|
Set trace center x position. |
Default('0.5')
|
ty
|
Float
|
Set trace center y position. |
Default('0.9')
|
tw
|
Float
|
Set trace width, relative to width of frame. |
Default('0.8')
|
th
|
Float
|
Set trace height, relative to height of frame. |
Default('0.3')
|
c
|
Int
|
Set which components to trace. By default it traces first three components. |
Default('7')
|
g
|
Boolean
|
Draw trace grid. By default is enabled. |
Default('true')
|
st
|
Boolean
|
Draw some statistics. By default is enabled. |
Default('true')
|
sc
|
Boolean
|
Draw scope. By default is enabled. |
Default('true')
|
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
overlay
¶
overlay(
_overlay: VideoStream,
*,
x: String = Default("0"),
y: String = Default("0"),
eof_action: (
Int | Literal["repeat", "endall", "pass"] | Default
) = Default("repeat"),
eval: (
Int | Literal["init", "frame"] | Default
) = Default("frame"),
shortest: Boolean = Default("false"),
format: (
Int
| Literal[
"yuv420",
"yuv420p10",
"yuv422",
"yuv422p10",
"yuv444",
"rgb",
"gbrp",
"auto",
]
| Default
) = Default("yuv420"),
repeatlast: Boolean = Default("true"),
alpha: (
Int | Literal["straight", "premultiplied"] | Default
) = Default("straight"),
framesync_options: FFMpegFrameSyncOption | None = None,
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Overlay one video on top of another.
It takes two inputs and has one output. The first input is the "main" video on which the second input is overlaid.
It accepts the following parameters:
A description of the accepted options follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
String
|
set the x expression (default "0") |
Default('0')
|
y
|
String
|
Modify the x and y of the overlay input. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. |
Default('0')
|
eof_action
|
Int | Literal['repeat', 'endall', 'pass'] | Default
|
See framesync. |
Default('repeat')
|
eval
|
Int | Literal['init', 'frame'] | Default
|
Set when the expressions for x, and y are evaluated. It accepts the following values: @end table Default value is frame. |
Default('frame')
|
shortest
|
Boolean
|
See framesync. |
Default('false')
|
format
|
Int | Literal['yuv420', 'yuv420p10', 'yuv422', 'yuv422p10', 'yuv444', 'rgb', 'gbrp', 'auto'] | Default
|
Set the format for the output video. It accepts the following values: @end table Default value is yuv420. |
Default('yuv420')
|
repeatlast
|
Boolean
|
See framesync. |
Default('true')
|
alpha
|
Int | Literal['straight', 'premultiplied'] | Default
|
Set format of alpha of the overlaid video, it can be straight or premultiplied. Default is straight. |
Default('straight')
|
framesync_options
|
FFMpegFrameSyncOption | None
|
Framesync options |
None
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
owdenoise
¶
owdenoise(
*,
depth: Int = Default("8"),
luma_strength: Double = Default("1"),
chroma_strength: Double = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply Overcomplete Wavelet denoiser.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
depth
|
Int
|
Set depth. Larger depth values will denoise lower frequency components more, but slow down filtering. Must be an int in the range 8-16, default is 8. |
Default('8')
|
luma_strength
|
Double
|
Set luma strength. Must be a double value in the range 0-1000, default is 1.0. |
Default('1')
|
chroma_strength
|
Double
|
Set chroma strength. Must be a double value in the range 0-1000, default is 1.0. |
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
pad
¶
pad(
*,
width: String = Default("iw"),
height: String = Default("ih"),
x: String = Default("0"),
y: String = Default("0"),
color: Color = Default("black"),
eval: (
Int | Literal["init", "frame"] | Default
) = Default("init"),
aspect: Rational = Default("0/1"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Add paddings to the input image, and place the original input at the provided x, y coordinates.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
String
|
set the pad area width expression (default "iw") |
Default('iw')
|
height
|
String
|
Specify an expression for the size of the output image with the paddings added. If the value for width or height is 0, the corresponding input size is used for the output. The width expression can reference the value set by the height expression, and vice versa. The default value of width and height is 0. |
Default('ih')
|
x
|
String
|
set the x offset expression for the input image position (default "0") |
Default('0')
|
y
|
String
|
The x and y offsets as specified by the x and y expressions, or NAN if not yet specified. |
Default('0')
|
color
|
Color
|
Specify the color of the padded area. For the syntax of this option, check the "Color" section in the ffmpeg-utils manual. The default value of color is "black". |
Default('black')
|
eval
|
Int | Literal['init', 'frame'] | Default
|
Specify when to evaluate width, height, x and y expression. It accepts the following values: @end table Default value is init. |
Default('init')
|
aspect
|
Rational
|
Pad to aspect instead to a resolution. |
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
palettegen
¶
palettegen(
*,
max_colors: Int = Default("256"),
reserve_transparent: Boolean = Default("true"),
transparency_color: Color = Default("lime"),
stats_mode: (
Int | Literal["full", "diff", "single"] | Default
) = Default("full"),
use_alpha: Boolean = Default("false"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Generate one palette for a whole video stream.
It accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_colors
|
Int
|
Set the maximum number of colors to quantize in the palette. Note: the palette will still contain 256 colors; the unused palette entries will be black. |
Default('256')
|
reserve_transparent
|
Boolean
|
Create a palette of 255 colors maximum and reserve the last one for transparency. Reserving the transparency color is useful for GIF optimization. If not set, the maximum of colors in the palette will be 256. You probably want to disable this option for a standalone image. Set by default. |
Default('true')
|
transparency_color
|
Color
|
Set the color that will be used as background for transparency. |
Default('lime')
|
stats_mode
|
Int | Literal['full', 'diff', 'single'] | Default
|
Set statistics mode. It accepts the following values: @end table Default value is full. |
Default('full')
|
use_alpha
|
Boolean
|
Create a palette of colors with alpha components. Setting this, will automatically disable 'reserve_transparent'. |
Default('false')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
paletteuse
¶
paletteuse(
_palette: VideoStream,
*,
dither: (
Int
| Literal[
"bayer",
"heckbert",
"floyd_steinberg",
"sierra2",
"sierra2_4a",
]
| Default
) = Default("sierra2_4a"),
bayer_scale: Int = Default("2"),
diff_mode: (
Int | Literal["rectangle"] | Default
) = Default("0"),
new: Boolean = Default("false"),
alpha_threshold: Int = Default("128"),
use_alpha: Boolean = Default("false"),
debug_kdtree: String = Default(None),
color_search: (
Int
| Literal[
"nns_iterative", "nns_recursive", "bruteforce"
]
| Default
) = Default("nns_iterative"),
mean_err: Boolean = Default("false"),
debug_accuracy: Boolean = Default("false"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Use a palette to downsample an input video stream.
The filter takes two inputs: one video stream and a palette. The palette must be a 256 pixels image.
It accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dither
|
Int | Literal['bayer', 'heckbert', 'floyd_steinberg', 'sierra2', 'sierra2_4a'] | Default
|
Select dithering mode. Available algorithms are: @end table Default is sierra2_4a. |
Default('sierra2_4a')
|
bayer_scale
|
Int
|
When bayer dithering is selected, this option defines the scale of the pattern (how much the crosshatch pattern is visible). A low value means more visible pattern for less banding, and higher value means less visible pattern at the cost of more banding. The option must be an integer value in the range [0,5]. Default is 2. |
Default('2')
|
diff_mode
|
Int | Literal['rectangle'] | Default
|
If set, define the zone to process @end table Default is none. |
Default('0')
|
new
|
Boolean
|
Take new palette for each output frame. |
Default('false')
|
alpha_threshold
|
Int
|
Sets the alpha threshold for transparency. Alpha values above this threshold will be treated as completely opaque, and values below this threshold will be treated as completely transparent. The option must be an integer value in the range [0,255]. Default is 128. |
Default('128')
|
use_alpha
|
Boolean
|
Apply the palette by taking alpha values into account. Only useful with palettes that are containing multiple colors with alpha components. Setting this will automatically disable 'alpha_treshold'. |
Default('false')
|
debug_kdtree
|
String
|
save Graphviz graph of the kdtree in specified file |
Default(None)
|
color_search
|
Int | Literal['nns_iterative', 'nns_recursive', 'bruteforce'] | Default
|
set reverse colormap color search method (from 0 to 2) (default nns_iterative) |
Default('nns_iterative')
|
mean_err
|
Boolean
|
compute and print mean error (default false) |
Default('false')
|
debug_accuracy
|
Boolean
|
test color search accuracy (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
pan
¶
pan(
*,
args: String = Default(None),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Mix channels with specific gain levels. The filter accepts the output channel layout followed by a set of channels definitions.
This filter is also designed to efficiently remap the channels of an audio stream.
The filter accepts parameters of the form: "l|outdef|outdef|..."
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args
|
String
|
|
Default(None)
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
perms
¶
perms(
*,
mode: (
Int
| Literal["none", "ro", "rw", "toggle", "random"]
| Default
) = Default("none"),
seed: Int64 = Default("-1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Set read/write permissions for the output frames.
These filters are mainly aimed at developers to test direct path in the following filter in the filtergraph.
The filters accept the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Int | Literal['none', 'ro', 'rw', 'toggle', 'random'] | Default
|
Select the permissions mode. It accepts the following values: @end table |
Default('none')
|
seed
|
Int64
|
Set the seed for the random mode, must be an integer included between 0 and UINT32_MAX. If not specified, or if explicitly set to -1, the filter will try to use a good random seed on a best effort basis. |
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
perspective
¶
perspective(
*,
x0: String = Default("0"),
y0: String = Default("0"),
x1: String = Default("W"),
y1: String = Default("0"),
x2: String = Default("0"),
y2: String = Default("H"),
x3: String = Default("W"),
y3: String = Default("H"),
interpolation: (
Int | Literal["linear", "cubic"] | Default
) = Default("linear"),
sense: (
Int | Literal["source", "destination"] | Default
) = Default("source"),
eval: (
Int | Literal["init", "frame"] | Default
) = Default("init"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Correct perspective of video not recorded perpendicular to the screen.
A description of the accepted parameters follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x0
|
String
|
set top left x coordinate (default "0") |
Default('0')
|
y0
|
String
|
set top left y coordinate (default "0") |
Default('0')
|
x1
|
String
|
set top right x coordinate (default "W") |
Default('W')
|
y1
|
String
|
set top right y coordinate (default "0") |
Default('0')
|
x2
|
String
|
set bottom left x coordinate (default "0") |
Default('0')
|
y2
|
String
|
set bottom left y coordinate (default "H") |
Default('H')
|
x3
|
String
|
set bottom right x coordinate (default "W") |
Default('W')
|
y3
|
String
|
Set coordinates expression for top left, top right, bottom left and bottom right corners. Default values are 0:0:W:0:0:H:W:H with which perspective will remain unchanged. If the sense option is set to source, then the specified points will be sent to the corners of the destination. If the sense option is set to destination, then the corners of the source will be sent to the specified coordinates. The expressions can use the following variables: @end table |
Default('H')
|
interpolation
|
Int | Literal['linear', 'cubic'] | Default
|
Set interpolation for perspective correction. It accepts the following values: @end table Default value is linear. |
Default('linear')
|
sense
|
Int | Literal['source', 'destination'] | Default
|
Set interpretation of coordinate options. It accepts the following values: @end table |
Default('source')
|
eval
|
Int | Literal['init', 'frame'] | Default
|
Set when the expressions for coordinates x0,y0,...x3,y3 are evaluated. It accepts the following values: @end table Default value is init. |
Default('init')
|
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
phase
¶
phase(
*,
mode: (
Int
| Literal[
"p", "t", "b", "T", "B", "u", "U", "a", "A"
]
| Default
) = Default("A"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Delay interlaced video by one field time so that the field order changes.
The intended use is to fix PAL movies that have been captured with the opposite field order to the film-to-video transfer.
A description of the accepted parameters follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Int | Literal['p', 't', 'b', 'T', 'B', 'u', 'U', 'a', 'A'] | Default
|
Set phase mode. It accepts the following values: @end table |
Default('A')
|
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
photosensitivity
¶
photosensitivity(
*,
frames: Int = Default("30"),
threshold: Float = Default("1"),
skip: Int = Default("1"),
bypass: Boolean = Default("false"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Reduce various flashes in video, so to help users with epilepsy.
It accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frames
|
Int
|
Set how many frames to use when filtering. Default is 30. |
Default('30')
|
threshold
|
Float
|
Set detection threshold factor. Default is 1. Lower is stricter. |
Default('1')
|
skip
|
Int
|
Set how many pixels to skip when sampling frames. Default is 1. Allowed range is from 1 to 1024. |
Default('1')
|
bypass
|
Boolean
|
Leave frames unchanged. Default is disabled. |
Default('false')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
pixdesctest
¶
pixdesctest(
extra_options: dict[str, Any] | None = None,
) -> VideoStream
Pixel format descriptor test filter, mainly useful for internal testing. The output video should be equal to the input video.
For example: @example format=monow, pixdesctest @end example
can be used to test the monowhite pixel format descriptor definition.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
pixelize
¶
pixelize(
*,
width: Int = Default("16"),
height: Int = Default("16"),
mode: (
Int | Literal["avg", "min", "max"] | Default
) = Default("avg"),
planes: Flags = Default("F"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply pixelization to video stream.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
Int
|
set block width (from 1 to 1024) (default 16) |
Default('16')
|
height
|
Int
|
Set block dimensions that will be used for pixelization. Default value is 16. |
Default('16')
|
mode
|
Int | Literal['avg', 'min', 'max'] | Default
|
Set the mode of pixelization used. Possible values are: @end table Default value is avg. |
Default('avg')
|
planes
|
Flags
|
Set what planes to filter. Default is to filter all planes. |
Default('F')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
pixscope
¶
pixscope(
*,
x: Float = Default("0.5"),
y: Float = Default("0.5"),
w: Int = Default("7"),
h: Int = Default("7"),
o: Float = Default("0.5"),
wx: Float = Default("-1"),
wy: Float = Default("-1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Display sample values of color channels. Mainly useful for checking color and levels. Minimum supported resolution is 640x480.
The filters accept the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Float
|
Set scope X position, relative offset on X axis. |
Default('0.5')
|
y
|
Float
|
Set scope Y position, relative offset on Y axis. |
Default('0.5')
|
w
|
Int
|
Set scope width. |
Default('7')
|
h
|
Int
|
Set scope height. |
Default('7')
|
o
|
Float
|
Set window opacity. This window also holds statistics about pixel area. |
Default('0.5')
|
wx
|
Float
|
Set window X position, relative offset on X axis. |
Default('-1')
|
wy
|
Float
|
Set window Y position, relative offset on Y axis. |
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
pp
¶
pp(
*,
subfilters: String = Default("de"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Enable the specified chain of postprocessing subfilters using libpostproc. This library should be automatically selected with a GPL build (--enable-gpl). Subfilters must be separated by '/' and can be disabled by prepending a '-'. Each subfilter and some options have a short and a long name that can be used interchangeably, i.e. dr/dering are the same.
The filters accept the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subfilters
|
String
|
Set postprocessing subfilters string. |
Default('de')
|
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
pp7
¶
pp7(
*,
qp: Int = Default("0"),
mode: (
Int | Literal["hard", "soft", "medium"] | Default
) = Default("medium"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply Postprocessing filter 7. It is variant of the spp filter, similar to spp = 6 with 7 point DCT, where only the center sample is used after IDCT.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qp
|
Int
|
Force a constant quantization parameter. It accepts an integer in range 0 to 63. If not set, the filter will use the QP from the video stream (if available). |
Default('0')
|
mode
|
Int | Literal['hard', 'soft', 'medium'] | Default
|
Set thresholding mode. Available modes are: @end table |
Default('medium')
|
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
prewitt
¶
prewitt(
*,
planes: Int = Default("15"),
scale: Float = Default("1"),
delta: Float = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply prewitt operator to input video stream.
The filter accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planes
|
Int
|
Set which planes will be processed, unprocessed planes will be copied. By default value 0xf, all planes will be processed. |
Default('15')
|
scale
|
Float
|
Set value which will be multiplied with filtered result. |
Default('1')
|
delta
|
Float
|
Set value which will be added to filtered result. |
Default('0')
|
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
pseudocolor
¶
pseudocolor(
*,
c0: String = Default("val"),
c1: String = Default("val"),
c2: String = Default("val"),
c3: String = Default("val"),
index: Int = Default("0"),
preset: (
Int
| Literal[
"none",
"magma",
"inferno",
"plasma",
"viridis",
"turbo",
"cividis",
"range1",
"range2",
"shadows",
"highlights",
"solar",
"nominal",
"preferred",
"total",
]
| Default
) = Default("none"),
opacity: Float = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Alter frame colors in video with pseudocolors.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
c0
|
String
|
set pixel first component expression |
Default('val')
|
c1
|
String
|
set pixel second component expression |
Default('val')
|
c2
|
String
|
set pixel third component expression |
Default('val')
|
c3
|
String
|
set pixel fourth component expression, corresponds to the alpha component |
Default('val')
|
index
|
Int
|
set component to use as base for altering colors |
Default('0')
|
preset
|
Int | Literal['none', 'magma', 'inferno', 'plasma', 'viridis', 'turbo', 'cividis', 'range1', 'range2', 'shadows', 'highlights', 'solar', 'nominal', 'preferred', 'total'] | Default
|
Pick one of built-in LUTs. By default is set to none. Available LUTs: @end table |
Default('none')
|
opacity
|
Float
|
Set opacity of output colors. Allowed range is from 0 to 1. Default value is set to 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
psnr
¶
psnr(
_reference: VideoStream,
*,
stats_file: String = Default(None),
stats_version: Int = Default("1"),
output_max: Boolean = Default("false"),
framesync_options: FFMpegFrameSyncOption | None = None,
eof_action: str | None = None,
shortest: bool | None = None,
repeatlast: bool | None = None,
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Obtain the average, maximum and minimum PSNR (Peak Signal to Noise Ratio) between two input videos.
This filter takes in input two input videos, the first input is considered the "main" source and is passed unchanged to the output. The second input is used as a "reference" video for computing the PSNR.
Both video inputs must have the same resolution and pixel format for this filter to work correctly. Also it assumes that both inputs have the same number of frames, which are compared one by one.
The obtained average PSNR is printed through the logging system.
The filter stores the accumulated MSE (mean squared error) of each frame, and at the end of the processing it is averaged across all frames equally, and the following formula is applied to obtain the PSNR:
@example PSNR = 10*log10(MAX^2/MSE) @end example
Where MAX is the average of the maximum values of each component of the image.
The description of the accepted parameters follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stats_file
|
String
|
If specified the filter will use the named file to save the PSNR of each individual frame. When filename equals "-" the data is sent to standard output. |
Default(None)
|
stats_version
|
Int
|
Specifies which version of the stats file format to use. Details of each format are written below. Default value is 1. |
Default('1')
|
output_max
|
Boolean
|
Add raw stats (max values) to the output log. (default false) |
Default('false')
|
framesync_options
|
FFMpegFrameSyncOption | None
|
Framesync options |
None
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
pullup
¶
pullup(
*,
jl: Int = Default("1"),
jr: Int = Default("1"),
jt: Int = Default("4"),
jb: Int = Default("4"),
sb: Boolean = Default("false"),
mp: Int | Literal["y", "u", "v"] | Default = Default(
"y"
),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Pulldown reversal (inverse telecine) filter, capable of handling mixed hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive content.
The pullup filter is designed to take advantage of future context in making its decisions. This filter is stateless in the sense that it does not lock onto a pattern to follow, but it instead looks forward to the following fields in order to identify matches and rebuild progressive frames.
To produce content with an even framerate, insert the fps filter after pullup, use fps=24000/1001 if the input frame rate is 29.97fps, fps=24 for 30fps and the (rare) telecined 25fps input.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jl
|
Int
|
set left junk size (from 0 to INT_MAX) (default 1) |
Default('1')
|
jr
|
Int
|
set right junk size (from 0 to INT_MAX) (default 1) |
Default('1')
|
jt
|
Int
|
set top junk size (from 1 to INT_MAX) (default 4) |
Default('4')
|
jb
|
Int
|
These options set the amount of "junk" to ignore at the left, right, top, and bottom of the image, respectively. Left and right are in units of 8 pixels, while top and bottom are in units of 2 lines. The default is 8 pixels on each side. |
Default('4')
|
sb
|
Boolean
|
Set the strict breaks. Setting this option to 1 will reduce the chances of filter generating an occasional mismatched frame, but it may also cause an excessive number of frames to be dropped during high motion sequences. Conversely, setting it to -1 will make filter match fields more easily. This may help processing of video where there is slight blurring between the fields, but may also cause there to be interlaced frames in the output. Default value is 0. |
Default('false')
|
mp
|
Int | Literal['y', 'u', 'v'] | Default
|
Set the metric plane to use. It accepts the following values: @end table This option may be set to use chroma plane instead of the default luma plane for doing filter's computations. This may improve accuracy on very clean source material, but more likely will decrease accuracy, especially if there is chroma noise (rainbow effect) or any grayscale video. The main purpose of setting mp to a chroma plane is to reduce CPU load and make pullup usable in realtime on slow machines. |
Default('y')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
qp
¶
qp(
*,
qp: String = Default(None),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Change video quantization parameters (QP).
The filter accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qp
|
String
|
Set expression for quantization parameter. |
Default(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
random
¶
random(
*,
frames: Int = Default("30"),
seed: Int64 = Default("-1"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Flush video frames from internal cache of frames into a random order. No frame is discarded. Inspired by frei0r nervous filter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frames
|
Int
|
Set size in number of frames of internal cache, in range from 2 to 512. Default is 30. |
Default('30')
|
seed
|
Int64
|
Set seed for random number generator, must be an integer included between 0 and UINT32_MAX. If not specified, or if explicitly set to less than 0, the filter will try to use a good random seed on a best effort basis. |
Default('-1')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
readeia608
¶
readeia608(
*,
scan_min: Int = Default("0"),
scan_max: Int = Default("29"),
spw: Float = Default("0.27"),
chp: Boolean = Default("false"),
lp: Boolean = Default("true"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Read closed captioning (EIA-608) information from the top lines of a video frame.
This filter adds frame metadata for lavfi.readeia608.X.cc and lavfi.readeia608.X.line, where X is the number of the identified line with EIA-608 data (starting from 0). A description of each metadata value follows:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scan_min
|
Int
|
Set the line to start scanning for EIA-608 data. Default is 0. |
Default('0')
|
scan_max
|
Int
|
Set the line to end scanning for EIA-608 data. Default is 29. |
Default('29')
|
spw
|
Float
|
Set the ratio of width reserved for sync code detection. Default is 0.27. Allowed range is [0.1 - 0.7]. |
Default('0.27')
|
chp
|
Boolean
|
Enable checking the parity bit. In the event of a parity error, the filter will output 0x00 for that character. Default is false. |
Default('false')
|
lp
|
Boolean
|
Lowpass lines prior to further processing. Default is enabled. |
Default('true')
|
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
readvitc
¶
readvitc(
*,
scan_max: Int = Default("45"),
thr_b: Double = Default("0.2"),
thr_w: Double = Default("0.6"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Read vertical interval timecode (VITC) information from the top lines of a video frame.
The filter adds frame metadata key lavfi.readvitc.tc_str with the timecode value, if a valid timecode has been detected. Further metadata key lavfi.readvitc.found is set to 0/1 depending on whether timecode data has been found or not.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scan_max
|
Int
|
Set the maximum number of lines to scan for VITC data. If the value is set to -1 the full video frame is scanned. Default is 45. |
Default('45')
|
thr_b
|
Double
|
Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0], default value is 0.2. The value must be equal or less than thr_w. |
Default('0.2')
|
thr_w
|
Double
|
Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0], default value is 0.6. The value must be equal or greater than thr_b. |
Default('0.6')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
realtime
¶
realtime(
*,
limit: Duration = Default("2"),
speed: Double = Default("1"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Slow down filtering to match real time approximately.
These filters will pause the filtering for a variable amount of time to match the output rate with the input timestamps. They are similar to the re option to ffmpeg.
They accept the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit
|
Duration
|
Time limit for the pauses. Any pause longer than that will be considered a timestamp discontinuity and reset the timer. Default is 2 seconds. |
Default('2')
|
speed
|
Double
|
Speed factor for processing. The value must be a float larger than zero. Values larger than 1.0 will result in faster than realtime processing, smaller will slow processing down. The limit is automatically adapted accordingly. Default is 1.0. A processing speed faster than what is possible without these filters cannot be achieved. |
Default('1')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
remap
¶
remap(
_xmap: VideoStream,
_ymap: VideoStream,
*,
format: (
Int | Literal["color", "gray"] | Default
) = Default("color"),
fill: Color = Default("black"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
Destination pixel at position (X, Y) will be picked from source (x, y) position where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero value for pixel will be used for destination pixel.
Xmap and Ymap input video streams must be of same dimensions. Output video stream will have Xmap/Ymap video stream dimensions. Xmap and Ymap input video streams are 16bit depth, single channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
format
|
Int | Literal['color', 'gray'] | Default
|
Specify pixel format of output from this filter. Can be color or gray. Default is color. |
Default('color')
|
fill
|
Color
|
Specify the color of the unmapped pixels. For the syntax of this option, check the "Color" section in the ffmpeg-utils manual. Default color is 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
removegrain
¶
removegrain(
*,
m0: Int = Default("0"),
m1: Int = Default("0"),
m2: Int = Default("0"),
m3: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
The removegrain filter is a spatial denoiser for progressive video.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m0
|
Int
|
Set mode for the first plane. |
Default('0')
|
m1
|
Int
|
Set mode for the second plane. |
Default('0')
|
m2
|
Int
|
Set mode for the third plane. |
Default('0')
|
m3
|
Int
|
Set mode for the fourth plane. |
Default('0')
|
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
removelogo
¶
removelogo(
*,
filename: String = Default(None),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Suppress a TV station logo, using an image file to determine which pixels comprise the logo. It works by filling in the pixels that comprise the logo with neighboring pixels.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
String
|
Set the filter bitmap file, which can be any image format supported by libavformat. The width and height of the image file must match those of the video stream being processed. |
Default(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
repeatfields
¶
repeatfields(
extra_options: dict[str, Any] | None = None,
) -> VideoStream
This filter uses the repeat_field flag from the Video ES headers and hard repeats fields based on its value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
replaygain
¶
replaygain(
extra_options: dict[str, Any] | None = None,
) -> AudioStream
ReplayGain scanner filter. This filter takes an audio stream as an input and outputs it unchanged. At end of filtering it displays track_gain and track_peak.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
reverse
¶
reverse(
extra_options: dict[str, Any] | None = None,
) -> VideoStream
Reverse a video clip.
Warning: This filter requires memory to buffer the entire clip, so trimming is suggested.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
rgbashift
¶
rgbashift(
*,
rh: Int = Default("0"),
rv: Int = Default("0"),
gh: Int = Default("0"),
gv: Int = Default("0"),
bh: Int = Default("0"),
bv: Int = Default("0"),
ah: Int = Default("0"),
av: Int = Default("0"),
edge: (
Int | Literal["smear", "wrap"] | Default
) = Default("smear"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Shift R/G/B/A pixels horizontally and/or vertically.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rh
|
Int
|
Set amount to shift red horizontally. |
Default('0')
|
rv
|
Int
|
Set amount to shift red vertically. |
Default('0')
|
gh
|
Int
|
Set amount to shift green horizontally. |
Default('0')
|
gv
|
Int
|
Set amount to shift green vertically. |
Default('0')
|
bh
|
Int
|
Set amount to shift blue horizontally. |
Default('0')
|
bv
|
Int
|
Set amount to shift blue vertically. |
Default('0')
|
ah
|
Int
|
Set amount to shift alpha horizontally. |
Default('0')
|
av
|
Int
|
Set amount to shift alpha vertically. |
Default('0')
|
edge
|
Int | Literal['smear', 'wrap'] | Default
|
Set edge mode, can be smear, default, or warp. |
Default('smear')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
roberts
¶
roberts(
*,
planes: Int = Default("15"),
scale: Float = Default("1"),
delta: Float = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply roberts cross operator to input video stream.
The filter accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planes
|
Int
|
Set which planes will be processed, unprocessed planes will be copied. By default value 0xf, all planes will be processed. |
Default('15')
|
scale
|
Float
|
Set value which will be multiplied with filtered result. |
Default('1')
|
delta
|
Float
|
Set value which will be added to filtered result. |
Default('0')
|
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
rotate
¶
rotate(
*,
angle: String = Default("0"),
out_w: String = Default("iw"),
out_h: String = Default("ih"),
fillcolor: String = Default("black"),
bilinear: Boolean = Default("true"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Rotate video by an arbitrary angle expressed in radians.
The filter accepts the following options:
A description of the optional parameters follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
angle
|
String
|
Set the angle expression. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. |
Default('0')
|
out_w
|
String
|
set output width expression (default "iw") |
Default('iw')
|
out_h
|
String
|
the output width and height, that is the size of the padded area as specified by the width and height expressions |
Default('ih')
|
fillcolor
|
String
|
Set the color used to fill the output area not covered by the rotated image. For the general syntax of this option, check the "Color" section in the ffmpeg-utils manual. If the special value "none" is selected then no background is printed (useful for example if the background is never shown). Default value is "black". |
Default('black')
|
bilinear
|
Boolean
|
Enable bilinear interpolation if set to 1, a value of 0 disables it. Default value is 1. |
Default('true')
|
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
sab
¶
sab(
*,
luma_radius: Float = Default("1"),
luma_pre_filter_radius: Float = Default("1"),
luma_strength: Float = Default("1"),
chroma_radius: Float = Default("-0.9"),
chroma_pre_filter_radius: Float = Default("-0.9"),
chroma_strength: Float = Default("-0.9"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply Shape Adaptive Blur.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
luma_radius
|
Float
|
Set luma blur filter strength, must be a value in range 0.1-4.0, default value is 1.0. A greater value will result in a more blurred image, and in slower processing. |
Default('1')
|
luma_pre_filter_radius
|
Float
|
Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default value is 1.0. |
Default('1')
|
luma_strength
|
Float
|
Set luma maximum difference between pixels to still be considered, must be a value in the 0.1-100.0 range, default value is 1.0. |
Default('1')
|
chroma_radius
|
Float
|
Set chroma blur filter strength, must be a value in range -0.9-4.0. A greater value will result in a more blurred image, and in slower processing. |
Default('-0.9')
|
chroma_pre_filter_radius
|
Float
|
Set chroma pre-filter radius, must be a value in the -0.9-2.0 range. |
Default('-0.9')
|
chroma_strength
|
Float
|
Set chroma maximum difference between pixels to still be considered, must be a value in the -0.9-100.0 range. |
Default('-0.9')
|
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
scale
¶
scale(
*,
w: String = Default(None),
h: String = Default(None),
flags: String = Default(""),
interl: Boolean = Default("false"),
in_color_matrix: (
String
| Literal[
"auto",
"bt601",
"bt470",
"smpte170m",
"bt709",
"fcc",
"smpte240m",
"bt2020",
]
| Default
) = Default("auto"),
out_color_matrix: (
String
| Literal[
"auto",
"bt601",
"bt470",
"smpte170m",
"bt709",
"fcc",
"smpte240m",
"bt2020",
]
| Default
) = Default(None),
in_range: (
Int
| Literal[
"auto",
"unknown",
"full",
"limited",
"jpeg",
"mpeg",
"tv",
"pc",
]
| Default
) = Default("auto"),
out_range: (
Int
| Literal[
"auto",
"unknown",
"full",
"limited",
"jpeg",
"mpeg",
"tv",
"pc",
]
| Default
) = Default("auto"),
in_v_chr_pos: Int = Default("-513"),
in_h_chr_pos: Int = Default("-513"),
out_v_chr_pos: Int = Default("-513"),
out_h_chr_pos: Int = Default("-513"),
force_original_aspect_ratio: (
Int
| Literal["disable", "decrease", "increase"]
| Default
) = Default("disable"),
force_divisible_by: Int = Default("1"),
param0: Double = Default("123456"),
param1: Double = Default("123456"),
eval: (
Int | Literal["init", "frame"] | Default
) = Default("init"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Scale (resize) the input video, using the libswscale library.
The scale filter forces the output display aspect ratio to be the same of the input, by changing the output sample aspect ratio.
If the input image format is different from the format requested by the next filter, the scale filter will convert the input to the requested format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
w
|
String
|
Output video width |
Default(None)
|
h
|
String
|
Set the output video dimension expression. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. |
Default(None)
|
flags
|
String
|
Set libswscale scaling flags. See the ffmpeg-scaler manual for the complete list of values. If not explicitly specified the filter applies the default flags. |
Default('')
|
interl
|
Boolean
|
Set the interlacing mode. It accepts the following values: @end table Default value is 0. |
Default('false')
|
in_color_matrix
|
String | Literal['auto', 'bt601', 'bt470', 'smpte170m', 'bt709', 'fcc', 'smpte240m', 'bt2020'] | Default
|
set input YCbCr type (default "auto") |
Default('auto')
|
out_color_matrix
|
String | Literal['auto', 'bt601', 'bt470', 'smpte170m', 'bt709', 'fcc', 'smpte240m', 'bt2020'] | Default
|
Set in/output YCbCr color space type. This allows the autodetected value to be overridden as well as allows forcing a specific value used for the output and encoder. If not specified, the color space type depends on the pixel format. Possible values: @end table |
Default(None)
|
in_range
|
Int | Literal['auto', 'unknown', 'full', 'limited', 'jpeg', 'mpeg', 'tv', 'pc'] | Default
|
set input color range (from 0 to 2) (default auto) |
Default('auto')
|
out_range
|
Int | Literal['auto', 'unknown', 'full', 'limited', 'jpeg', 'mpeg', 'tv', 'pc'] | Default
|
Set in/output YCbCr sample range. This allows the autodetected value to be overridden as well as allows forcing a specific value used for the output and encoder. If not specified, the range depends on the pixel format. Possible values: @end table |
Default('auto')
|
in_v_chr_pos
|
Int
|
input vertical chroma position in luma grid/256 (from -513 to 512) (default -513) |
Default('-513')
|
in_h_chr_pos
|
Int
|
input horizontal chroma position in luma grid/256 (from -513 to 512) (default -513) |
Default('-513')
|
out_v_chr_pos
|
Int
|
output vertical chroma position in luma grid/256 (from -513 to 512) (default -513) |
Default('-513')
|
out_h_chr_pos
|
Int
|
output horizontal chroma position in luma grid/256 (from -513 to 512) (default -513) |
Default('-513')
|
force_original_aspect_ratio
|
Int | Literal['disable', 'decrease', 'increase'] | Default
|
Enable decreasing or increasing output video width or height if necessary to keep the original aspect ratio. Possible values: @end table One useful instance of this option is that when you know a specific device's maximum allowed resolution, you can use this to limit the output video to that, while retaining the aspect ratio. For example, device A allows 1280x720 playback, and your video is 1920x800. Using this option (set it to decrease) and specifying 1280x720 to the command line makes the output 1280x533. Please note that this is a different thing than specifying -1 for w or h, you still need to specify the output resolution for this option to work. |
Default('disable')
|
force_divisible_by
|
Int
|
Ensures that both the output dimensions, width and height, are divisible by the given integer when used together with force_original_aspect_ratio. This works similar to using -n in the w and h options. This option respects the value set for force_original_aspect_ratio, increasing or decreasing the resolution accordingly. The video's aspect ratio may be slightly modified. This option can be handy if you need to have a video fit within or exceed a defined resolution using force_original_aspect_ratio but also have encoder restrictions on width or height divisibility. |
Default('1')
|
param0
|
Double
|
Set libswscale input parameters for scaling algorithms that need them. See the ffmpeg-scaler manual for the complete documentation. If not explicitly specified the filter applies empty parameters. |
Default('123456')
|
param1
|
Double
|
Set libswscale input parameters for scaling algorithms that need them. See the ffmpeg-scaler manual for the complete documentation. If not explicitly specified the filter applies empty parameters. |
Default('123456')
|
eval
|
Int | Literal['init', 'frame'] | Default
|
Specify when to evaluate width and height expression. It accepts the following values: @end table Default value is init. |
Default('init')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
scale2ref
¶
scale2ref(
_ref: VideoStream,
*,
w: String = Default(None),
h: String = Default(None),
flags: String = Default(""),
interl: Boolean = Default("false"),
in_color_matrix: (
String
| Literal[
"auto",
"bt601",
"bt470",
"smpte170m",
"bt709",
"fcc",
"smpte240m",
"bt2020",
]
| Default
) = Default("auto"),
out_color_matrix: (
String
| Literal[
"auto",
"bt601",
"bt470",
"smpte170m",
"bt709",
"fcc",
"smpte240m",
"bt2020",
]
| Default
) = Default(None),
in_range: (
Int
| Literal[
"auto",
"unknown",
"full",
"limited",
"jpeg",
"mpeg",
"tv",
"pc",
]
| Default
) = Default("auto"),
out_range: (
Int
| Literal[
"auto",
"unknown",
"full",
"limited",
"jpeg",
"mpeg",
"tv",
"pc",
]
| Default
) = Default("auto"),
in_v_chr_pos: Int = Default("-513"),
in_h_chr_pos: Int = Default("-513"),
out_v_chr_pos: Int = Default("-513"),
out_h_chr_pos: Int = Default("-513"),
force_original_aspect_ratio: (
Int
| Literal["disable", "decrease", "increase"]
| Default
) = Default("disable"),
force_divisible_by: Int = Default("1"),
param0: Double = Default("123456"),
param1: Double = Default("123456"),
eval: (
Int | Literal["init", "frame"] | Default
) = Default("init"),
extra_options: dict[str, Any] | None = None
) -> tuple[VideoStream, VideoStream]
Scale (resize) the input video, based on a reference video.
See the scale filter for available options, scale2ref supports the same but uses the reference video instead of the main input as basis. scale2ref also supports the following additional constants for the w and h options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
w
|
String
|
Output video width |
Default(None)
|
h
|
String
|
Set the output video dimension expression. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. |
Default(None)
|
flags
|
String
|
Flags to pass to libswscale (default "") |
Default('')
|
interl
|
Boolean
|
set interlacing (default false) |
Default('false')
|
in_color_matrix
|
String | Literal['auto', 'bt601', 'bt470', 'smpte170m', 'bt709', 'fcc', 'smpte240m', 'bt2020'] | Default
|
set input YCbCr type (default "auto") |
Default('auto')
|
out_color_matrix
|
String | Literal['auto', 'bt601', 'bt470', 'smpte170m', 'bt709', 'fcc', 'smpte240m', 'bt2020'] | Default
|
set output YCbCr type |
Default(None)
|
in_range
|
Int | Literal['auto', 'unknown', 'full', 'limited', 'jpeg', 'mpeg', 'tv', 'pc'] | Default
|
set input color range (from 0 to 2) (default auto) |
Default('auto')
|
out_range
|
Int | Literal['auto', 'unknown', 'full', 'limited', 'jpeg', 'mpeg', 'tv', 'pc'] | Default
|
set output color range (from 0 to 2) (default auto) |
Default('auto')
|
in_v_chr_pos
|
Int
|
input vertical chroma position in luma grid/256 (from -513 to 512) (default -513) |
Default('-513')
|
in_h_chr_pos
|
Int
|
input horizontal chroma position in luma grid/256 (from -513 to 512) (default -513) |
Default('-513')
|
out_v_chr_pos
|
Int
|
output vertical chroma position in luma grid/256 (from -513 to 512) (default -513) |
Default('-513')
|
out_h_chr_pos
|
Int
|
output horizontal chroma position in luma grid/256 (from -513 to 512) (default -513) |
Default('-513')
|
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')
|
param0
|
Double
|
Scaler param 0 (from INT_MIN to INT_MAX) (default 123456) |
Default('123456')
|
param1
|
Double
|
Scaler param 1 (from INT_MIN to INT_MAX) (default 123456) |
Default('123456')
|
eval
|
Int | Literal['init', 'frame'] | Default
|
specify when to evaluate expressions (from 0 to 1) (default init) |
Default('init')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
ref |
VideoStream
|
the video stream |
References
scdet
¶
scdet(
*,
threshold: Double = Default("10"),
sc_pass: Boolean = Default("false"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Detect video scene change.
This filter sets frame metadata with mafd between frame, the scene score, and forward the frame to the next filter, so they can use these metadata to detect scene change or others.
In addition, this filter logs a message and sets frame metadata when it detects a scene change by threshold.
lavfi.scd.mafd metadata keys are set with mafd for every frame.
lavfi.scd.score metadata keys are set with scene change score for every frame to detect scene change.
lavfi.scd.time metadata keys are set with current filtered frame time which detect scene change with threshold.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
Double
|
Set the scene change detection threshold as a percentage of maximum change. Good values are in the [8.0, 14.0] range. The range for threshold is [0., 100.]. Default value is 10.. |
Default('10')
|
sc_pass
|
Boolean
|
Set the flag to pass scene change frames to the next filter. Default value is 0 You can enable it if you want to get snapshot of scene change frames only. |
Default('false')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
scharr
¶
scharr(
*,
planes: Int = Default("15"),
scale: Float = Default("1"),
delta: Float = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply scharr operator to input video stream.
The filter accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planes
|
Int
|
Set which planes will be processed, unprocessed planes will be copied. By default value 0xf, all planes will be processed. |
Default('15')
|
scale
|
Float
|
Set value which will be multiplied with filtered result. |
Default('1')
|
delta
|
Float
|
Set value which will be added to filtered result. |
Default('0')
|
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
scroll
¶
scroll(
*,
horizontal: Float = Default("0"),
vertical: Float = Default("0"),
hpos: Float = Default("0"),
vpos: Float = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Scroll input video horizontally and/or vertically by constant speed.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
horizontal
|
Float
|
Set the horizontal scrolling speed. |
Default('0')
|
vertical
|
Float
|
Set the vertical scrolling speed. |
Default('0')
|
hpos
|
Float
|
Set the initial horizontal scrolling position. Default is 0. Allowed range is from 0 to 1. |
Default('0')
|
vpos
|
Float
|
Set the initial vertical scrolling position. Default is 0. Allowed range is from 0 to 1. |
Default('0')
|
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
segment
¶
segment(
*,
timestamps: String = Default(None),
frames: String = Default(None),
extra_options: dict[str, Any] | None = None
) -> FilterNode
Split single input stream into multiple streams.
This filter does opposite of concat filters.
segment works on video frames, asegment on audio samples.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timestamps
|
String
|
Timestamps of output segments separated by '|'. The first segment will run from the beginning of the input stream. The last segment will run until the end of the input stream |
Default(None)
|
frames
|
String
|
Exact frame/sample count to split the segments. |
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
select
¶
select(
*,
expr: String = Default("1"),
outputs: Int = Default("1"),
extra_options: dict[str, Any] | None = None
) -> FilterNode
Select frames to pass in output.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expr
|
String
|
Set expression, which is evaluated for each input frame. If the expression is evaluated to zero, the frame is discarded. If the evaluation result is negative or NaN, the frame is sent to the first output; otherwise it is sent to the output with index ceil(val)-1, assuming that the input index starts from 0. For example a value of 1.2 corresponds to the output with index ceil(1.2)-1 = 2-1 = 1, that is the second output. |
Default('1')
|
outputs
|
Int
|
Set the number of outputs. The output to which to send the selected frame is based on the result of the evaluation. Default value is 1. |
Default('1')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
filter_node |
FilterNode
|
the filter node |
References
selectivecolor
¶
selectivecolor(
*,
correction_method: (
Int | Literal["absolute", "relative"] | Default
) = Default("absolute"),
reds: String = Default(None),
yellows: String = Default(None),
greens: String = Default(None),
cyans: String = Default(None),
blues: String = Default(None),
magentas: String = Default(None),
whites: String = Default(None),
neutrals: String = Default(None),
blacks: String = Default(None),
psfile: String = Default(None),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Adjust cyan, magenta, yellow and black (CMYK) to certain ranges of colors (such as "reds", "yellows", "greens", "cyans", ...). The adjustment range is defined by the "purity" of the color (that is, how saturated it already is).
This filter is similar to the Adobe Photoshop Selective Color tool.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
correction_method
|
Int | Literal['absolute', 'relative'] | Default
|
Select color correction method. Available values are: @end table Default is absolute. |
Default('absolute')
|
reds
|
String
|
Adjustments for red pixels (pixels where the red component is the maximum) |
Default(None)
|
yellows
|
String
|
Adjustments for yellow pixels (pixels where the blue component is the minimum) |
Default(None)
|
greens
|
String
|
Adjustments for green pixels (pixels where the green component is the maximum) |
Default(None)
|
cyans
|
String
|
Adjustments for cyan pixels (pixels where the red component is the minimum) |
Default(None)
|
blues
|
String
|
Adjustments for blue pixels (pixels where the blue component is the maximum) |
Default(None)
|
magentas
|
String
|
Adjustments for magenta pixels (pixels where the green component is the minimum) |
Default(None)
|
whites
|
String
|
Adjustments for white pixels (pixels where all components are greater than 128) |
Default(None)
|
neutrals
|
String
|
Adjustments for all pixels except pure black and pure white |
Default(None)
|
blacks
|
String
|
Adjustments for black pixels (pixels where all components are lesser than 128) |
Default(None)
|
psfile
|
String
|
Specify a Photoshop selective color file (.asv) to import the settings from. |
Default(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
sendcmd
¶
sendcmd(
*,
commands: String = Default(None),
filename: String = Default(None),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Send commands to filters in the filtergraph.
These filters read commands to be sent to other filters in the filtergraph.
sendcmd must be inserted between two video filters, asendcmd must be inserted between two audio filters, but apart from that they act the same way.
The specification of commands can be provided in the filter arguments with the commands option, or in a file specified by the filename option.
These filters accept the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
commands
|
String
|
Set the commands to be read and sent to the other filters. |
Default(None)
|
filename
|
String
|
Set the filename of the commands to be read and sent to the other filters. |
Default(None)
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
separatefields
¶
separatefields(
extra_options: dict[str, Any] | None = None,
) -> VideoStream
The separatefields takes a frame-based video input and splits each frame into its components fields, producing a new half height clip with twice the frame rate and twice the frame count.
This filter use field-dominance information in frame to decide which of each pair of fields to place first in the output. If it gets it wrong use setfield filter before separatefields filter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
setdar
¶
setdar(
*,
dar: String = Default("0"),
max: Int = Default("100"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
The setdar filter sets the Display Aspect Ratio for the filter output video.
This is done by changing the specified Sample (aka Pixel) Aspect Ratio, according to the following equation: @example DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR @end example
Keep in mind that the setdar filter does not modify the pixel dimensions of the video frame. Also, the display aspect ratio set by this filter may be changed by later filters in the filterchain, e.g. in case of scaling or if another "setdar" or a "setsar" filter is applied.
The setsar filter sets the Sample (aka Pixel) Aspect Ratio for the filter output video.
Note that as a consequence of the application of this filter, the output display aspect ratio will change according to the equation above.
Keep in mind that the sample aspect ratio set by the setsar filter may be changed by later filters in the filterchain, e.g. if another "setsar" or a "setdar" filter is applied.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dar
|
String
|
The input display aspect ratio. It is the same as (w / h) * sar. |
Default('0')
|
max
|
Int
|
Set the maximum integer value to use for expressing numerator and denominator when reducing the expressed aspect ratio to a rational. Default value is 100. |
Default('100')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
setfield
¶
setfield(
*,
mode: (
Int
| Literal["auto", "bff", "tff", "prog"]
| Default
) = Default("auto"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Force field for the output video frame.
The setfield filter marks the interlace type field for the output frames. It does not change the input frame, but only sets the corresponding property, which affects how the frame is treated by following filters (e.g. fieldorder or yadif).
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Int | Literal['auto', 'bff', 'tff', 'prog'] | Default
|
Available values are: @end table |
Default('auto')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
setparams
¶
setparams(
*,
field_mode: (
Int
| Literal["auto", "bff", "tff", "prog"]
| 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",
"log100",
"log316",
"iec61966-2-4",
"bt1361e",
"iec61966-2-1",
"bt2020-10",
"bt2020-12",
"smpte2084",
"smpte428",
"arib-std-b67",
]
| Default
) = Default("auto"),
colorspace: (
Int
| Literal[
"auto",
"gbr",
"bt709",
"unknown",
"fcc",
"bt470bg",
"smpte170m",
"smpte240m",
"ycgco",
"bt2020nc",
"bt2020c",
"smpte2085",
"chroma-derived-nc",
"chroma-derived-c",
"ictcp",
]
| Default
) = Default("auto"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Force frame parameter for the output video frame.
The setparams filter marks interlace and color range for the output frames. It does not change the input frame, but only sets the corresponding property, which affects how the frame is treated by filters/encoders.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
field_mode
|
Int | Literal['auto', 'bff', 'tff', 'prog'] | Default
|
Available values are: @end table |
Default('auto')
|
range
|
Int | Literal['auto', 'unspecified', 'unknown', 'limited', 'tv', 'mpeg', 'full', 'pc', 'jpeg'] | Default
|
Available values are: @end table |
Default('auto')
|
color_primaries
|
Int | Literal['auto', 'bt709', 'unknown', 'bt470m', 'bt470bg', 'smpte170m', 'smpte240m', 'film', 'bt2020', 'smpte428', 'smpte431', 'smpte432', 'jedec-p22', 'ebu3213'] | Default
|
Set the color primaries. Available values are: @end table |
Default('auto')
|
color_trc
|
Int | Literal['auto', 'bt709', 'unknown', 'bt470m', 'bt470bg', 'smpte170m', 'smpte240m', 'linear', 'log100', 'log316', 'iec61966-2-4', 'bt1361e', 'iec61966-2-1', 'bt2020-10', 'bt2020-12', 'smpte2084', 'smpte428', 'arib-std-b67'] | Default
|
Set the color transfer. Available values are: @end table |
Default('auto')
|
colorspace
|
Int | Literal['auto', 'gbr', 'bt709', 'unknown', 'fcc', 'bt470bg', 'smpte170m', 'smpte240m', 'ycgco', 'bt2020nc', 'bt2020c', 'smpte2085', 'chroma-derived-nc', 'chroma-derived-c', 'ictcp'] | Default
|
Set the colorspace. Available values are: @end table |
Default('auto')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
setpts
¶
setpts(
*,
expr: String = Default("PTS"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Change the PTS (presentation timestamp) of the input frames.
setpts works on video frames, asetpts on audio frames.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expr
|
String
|
The expression which is evaluated for each frame to construct its timestamp. |
Default('PTS')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
setrange
¶
setrange(
*,
range: (
Int
| Literal[
"auto",
"unspecified",
"unknown",
"limited",
"tv",
"mpeg",
"full",
"pc",
"jpeg",
]
| Default
) = Default("auto"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Force color range for the output video frame.
The setrange filter marks the color range property for the output frames. It does not change the input frame, but only sets the corresponding property, which affects how the frame is treated by following filters.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
range
|
Int | Literal['auto', 'unspecified', 'unknown', 'limited', 'tv', 'mpeg', 'full', 'pc', 'jpeg'] | Default
|
Available values are: @end table |
Default('auto')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
setsar
¶
setsar(
*,
sar: String = Default("0"),
max: Int = Default("100"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
The setdar filter sets the Display Aspect Ratio for the filter output video.
This is done by changing the specified Sample (aka Pixel) Aspect Ratio, according to the following equation: @example DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR @end example
Keep in mind that the setdar filter does not modify the pixel dimensions of the video frame. Also, the display aspect ratio set by this filter may be changed by later filters in the filterchain, e.g. in case of scaling or if another "setdar" or a "setsar" filter is applied.
The setsar filter sets the Sample (aka Pixel) Aspect Ratio for the filter output video.
Note that as a consequence of the application of this filter, the output display aspect ratio will change according to the equation above.
Keep in mind that the sample aspect ratio set by the setsar filter may be changed by later filters in the filterchain, e.g. if another "setsar" or a "setdar" filter is applied.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sar
|
String
|
The input sample aspect ratio. |
Default('0')
|
max
|
Int
|
Set the maximum integer value to use for expressing numerator and denominator when reducing the expressed aspect ratio to a rational. Default value is 100. |
Default('100')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
settb
¶
settb(
*,
expr: String = Default("intb"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Set the timebase to use for the output frames timestamps. It is mainly useful for testing timebase configuration.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
expr
|
String
|
The expression which is evaluated into the output timebase. |
Default('intb')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
shear
¶
shear(
*,
shx: Float = Default("0"),
shy: Float = Default("0"),
fillcolor: String = Default("black"),
interp: (
Int | Literal["nearest", "bilinear"] | Default
) = Default("bilinear"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply shear transform to input video.
This filter supports the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shx
|
Float
|
Shear factor in X-direction. Default value is 0. Allowed range is from -2 to 2. |
Default('0')
|
shy
|
Float
|
Shear factor in Y-direction. Default value is 0. Allowed range is from -2 to 2. |
Default('0')
|
fillcolor
|
String
|
Set the color used to fill the output area not covered by the transformed video. For the general syntax of this option, check the "Color" section in the ffmpeg-utils manual. If the special value "none" is selected then no background is printed (useful for example if the background is never shown). Default value is "black". |
Default('black')
|
interp
|
Int | Literal['nearest', 'bilinear'] | Default
|
Set interpolation type. Can be bilinear or nearest. Default is bilinear. |
Default('bilinear')
|
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
showcqt
¶
showcqt(
*,
size: Image_size = Default("1920x1080"),
fps: Video_rate = Default("25"),
bar_h: Int = Default("-1"),
axis_h: Int = Default("-1"),
sono_h: Int = Default("-1"),
fullhd: Boolean = Default("true"),
sono_v: String = Default("16"),
bar_v: String = Default("sono_v"),
sono_g: Float = Default("3"),
bar_g: Float = Default("1"),
bar_t: Float = Default("1"),
timeclamp: Double = Default("0.17"),
attack: Double = Default("0"),
basefreq: Double = Default("20.0152"),
endfreq: Double = Default("20495.6"),
coeffclamp: Float = Default("1"),
tlength: String = Default("384*tc/(384+tc*f)"),
count: Int = Default("6"),
fcount: Int = Default("0"),
fontfile: String = Default(None),
font: String = Default(None),
fontcolor: String = Default(
"st(0, (midi(f)-59.5)/12);st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0));r(1-ld(1)) + b(ld(1))"
),
axisfile: String = Default(None),
axis: Boolean = Default("true"),
csp: (
Int
| Literal[
"unspecified",
"bt709",
"fcc",
"bt470bg",
"smpte170m",
"smpte240m",
"bt2020ncl",
]
| Default
) = Default("unspecified"),
cscheme: String = Default("1|0.5|0|0|0.5|1"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert input audio to a video output representing frequency spectrum logarithmically using Brown-Puckette constant Q transform algorithm with direct frequency domain coefficient calculation (but the transform itself is not really constant Q, instead the Q factor is actually variable/clamped), with musical tone scale, from E0 to D#10.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
Image_size
|
Specify the video size for the output. It must be even. For the syntax of this option, check the "Video size" section in the ffmpeg-utils manual. Default value is 1920x1080. |
Default('1920x1080')
|
fps
|
Video_rate
|
Set the output frame rate. Default value is 25. |
Default('25')
|
bar_h
|
Int
|
Set the bargraph height. It must be even. Default value is -1 which computes the bargraph height automatically. |
Default('-1')
|
axis_h
|
Int
|
Set the axis height. It must be even. Default value is -1 which computes the axis height automatically. |
Default('-1')
|
sono_h
|
Int
|
Set the sonogram height. It must be even. Default value is -1 which computes the sonogram height automatically. |
Default('-1')
|
fullhd
|
Boolean
|
Set the fullhd resolution. This option is deprecated, use size, s instead. Default value is 1. |
Default('true')
|
sono_v
|
String
|
Specify the sonogram volume expression. It can contain variables: @end table and functions: @end table Default value is 16. |
Default('16')
|
bar_v
|
String
|
Specify the bargraph volume expression. It can contain variables: @end table and functions: @end table Default value is sono_v. |
Default('sono_v')
|
sono_g
|
Float
|
Specify the sonogram gamma. Lower gamma makes the spectrum more contrast, higher gamma makes the spectrum having more range. Default value is 3. Acceptable range is [1, 7]. |
Default('3')
|
bar_g
|
Float
|
Specify the bargraph gamma. Default value is 1. Acceptable range is [1, 7]. |
Default('1')
|
bar_t
|
Float
|
Specify the bargraph transparency level. Lower value makes the bargraph sharper. Default value is 1. Acceptable range is [0, 1]. |
Default('1')
|
timeclamp
|
Double
|
Specify the transform timeclamp. At low frequency, there is trade-off between accuracy in time domain and frequency domain. If timeclamp is lower, event in time domain is represented more accurately (such as fast bass drum), otherwise event in frequency domain is represented more accurately (such as bass guitar). Acceptable range is [0.002, 1]. Default value is 0.17. |
Default('0.17')
|
attack
|
Double
|
Set attack time in seconds. The default is 0 (disabled). Otherwise, it limits future samples by applying asymmetric windowing in time domain, useful when low latency is required. Accepted range is [0, 1]. |
Default('0')
|
basefreq
|
Double
|
Specify the transform base frequency. Default value is 20.01523126408007475, which is frequency 50 cents below E0. Acceptable range is [10, 100000]. |
Default('20.0152')
|
endfreq
|
Double
|
Specify the transform end frequency. Default value is 20495.59681441799654, which is frequency 50 cents above D#10. Acceptable range is [10, 100000]. |
Default('20495.6')
|
coeffclamp
|
Float
|
This option is deprecated and ignored. |
Default('1')
|
tlength
|
String
|
Specify the transform length in time domain. Use this option to control accuracy trade-off between time domain and frequency domain at every frequency sample. It can contain variables: @end table Default value is 384tc/(384+tcf). |
Default('384*tc/(384+tc*f)')
|
count
|
Int
|
Specify the transform count for every video frame. Default value is 6. Acceptable range is [1, 30]. |
Default('6')
|
fcount
|
Int
|
Specify the transform count for every single pixel. Default value is 0, which makes it computed automatically. Acceptable range is [0, 10]. |
Default('0')
|
fontfile
|
String
|
Specify font file for use with freetype to draw the axis. If not specified, use embedded font. Note that drawing with font file or embedded font is not implemented with custom basefreq and endfreq, use axisfile option instead. |
Default(None)
|
font
|
String
|
Specify fontconfig pattern. This has lower priority than fontfile. The : in the pattern may be replaced by | to avoid unnecessary escaping. |
Default(None)
|
fontcolor
|
String
|
Specify font color expression. This is arithmetic expression that should return integer value 0xRRGGBB. It can contain variables: @end table and functions: @end table Default value is st(0, (midi(f)-59.5)/12); st(1, if(between(ld(0),0,1), 0.5-0.5cos(2PI*ld(0)), 0)); r(1-ld(1)) + b(ld(1)). |
Default('st(0, (midi(f)-59.5)/12);st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0));r(1-ld(1)) + b(ld(1))')
|
axisfile
|
String
|
Specify image file to draw the axis. This option override fontfile and fontcolor option. |
Default(None)
|
axis
|
Boolean
|
Enable/disable drawing text to the axis. If it is set to 0, drawing to the axis is disabled, ignoring fontfile and axisfile option. Default value is 1. |
Default('true')
|
csp
|
Int | Literal['unspecified', 'bt709', 'fcc', 'bt470bg', 'smpte170m', 'smpte240m', 'bt2020ncl'] | Default
|
Set colorspace. The accepted values are: @end table |
Default('unspecified')
|
cscheme
|
String
|
Set spectrogram color scheme. This is list of floating point values with format left_r|left_g|left_b|right_r|right_g|right_b. The default is 1|0.5|0|0|0.5|1. |
Default('1|0.5|0|0|0.5|1')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
showfreqs
¶
showfreqs(
*,
size: Image_size = Default("1024x512"),
rate: Video_rate = Default("25"),
mode: (
Int | Literal["line", "bar", "dot"] | Default
) = Default("bar"),
ascale: (
Int
| Literal["lin", "sqrt", "cbrt", "log"]
| Default
) = Default("log"),
fscale: (
Int | Literal["lin", "log", "rlog"] | Default
) = Default("lin"),
win_size: Int = Default("2048"),
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",
]
| Default
) = Default("hann"),
overlap: Float = Default("1"),
averaging: Int = Default("1"),
colors: String = Default(
"red|green|blue|yellow|orange|lime|pink|magenta|brown"
),
cmode: (
Int | Literal["combined", "separate"] | Default
) = Default("combined"),
minamp: Float = Default("1e-06"),
data: (
Int
| Literal["magnitude", "phase", "delay"]
| Default
) = Default("magnitude"),
channels: String = Default("all"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert input audio to video output representing the audio power spectrum. Audio amplitude is on Y-axis while frequency is on X-axis.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
Image_size
|
Specify size of video. For the syntax of this option, check the "Video size" section in the ffmpeg-utils manual. Default is 1024x512. |
Default('1024x512')
|
rate
|
Video_rate
|
Set video rate. Default is 25. |
Default('25')
|
mode
|
Int | Literal['line', 'bar', 'dot'] | Default
|
Set display mode. This set how each frequency bin will be represented. It accepts the following values: @end table Default is bar. |
Default('bar')
|
ascale
|
Int | Literal['lin', 'sqrt', 'cbrt', 'log'] | Default
|
Set amplitude scale. It accepts the following values: @end table Default is log. |
Default('log')
|
fscale
|
Int | Literal['lin', 'log', 'rlog'] | Default
|
Set frequency scale. It accepts the following values: @end table Default is lin. |
Default('lin')
|
win_size
|
Int
|
Set window size. Allowed range is from 16 to 65536. Default is 2048 |
Default('2048')
|
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'] | Default
|
Set windowing function. It accepts the following values: @end table Default is hanning. |
Default('hann')
|
overlap
|
Float
|
Set window overlap. In range [0, 1]. Default is 1, which means optimal overlap for selected window function will be picked. |
Default('1')
|
averaging
|
Int
|
Set time averaging. Setting this to 0 will display current maximal peaks. Default is 1, which means time averaging is disabled. |
Default('1')
|
colors
|
String
|
Specify list of colors separated by space or by '|' which will be used to draw channel frequencies. Unrecognized or missing colors will be replaced by white color. |
Default('red|green|blue|yellow|orange|lime|pink|magenta|brown')
|
cmode
|
Int | Literal['combined', 'separate'] | Default
|
Set channel display mode. It accepts the following values: @end table Default is combined. |
Default('combined')
|
minamp
|
Float
|
Set minimum amplitude used in log amplitude scaler. |
Default('1e-06')
|
data
|
Int | Literal['magnitude', 'phase', 'delay'] | Default
|
Set data display mode. It accepts the following values: @end table Default is magnitude. |
Default('magnitude')
|
channels
|
String
|
Set channels to use when processing audio. By default all are processed. |
Default('all')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
showinfo
¶
showinfo(
*,
checksum: Boolean = Default("true"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Show a line containing various information for each input video frame. The input video is not modified.
This filter supports the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
checksum
|
Boolean
|
The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame. |
Default('true')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
showpalette
¶
showpalette(
*,
s: Int = Default("30"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Displays the 256 colors palette of each frame. This filter is only relevant for pal8 pixel format frames.
It accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
s
|
Int
|
Set the size of the box used to represent one palette color entry. Default is 30 (for a 30x30 pixel box). |
Default('30')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
showspatial
¶
showspatial(
*,
size: Image_size = Default("512x512"),
win_size: Int = Default("4096"),
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",
]
| Default
) = Default("hann"),
overlap: Float = Default("0.5"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert stereo input audio to a video output, representing the spatial relationship between two channels.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
Image_size
|
Specify the video size for the output. For the syntax of this option, check the "Video size" section in the ffmpeg-utils manual. Default value is 512x512. |
Default('512x512')
|
win_size
|
Int
|
Set window size. Allowed range is from 1024 to 65536. Default size is 4096. |
Default('4096')
|
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'] | Default
|
Set window function. It accepts the following values: @end table Default value is hann. |
Default('hann')
|
overlap
|
Float
|
Set ratio of overlap window. Default value is 0.5. When value is 1 overlap is set to recommended size for specific window function currently used. |
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
showspectrum
¶
showspectrum(
*,
size: Image_size = Default("640x512"),
slide: (
Int
| Literal[
"replace",
"scroll",
"fullframe",
"rscroll",
"lreplace",
]
| Default
) = Default("replace"),
mode: (
Int | Literal["combined", "separate"] | Default
) = Default("combined"),
color: (
Int
| Literal[
"channel",
"intensity",
"rainbow",
"moreland",
"nebulae",
"fire",
"fiery",
"fruit",
"cool",
"magma",
"green",
"viridis",
"plasma",
"cividis",
"terrain",
]
| Default
) = Default("channel"),
scale: (
Int
| Literal[
"lin", "sqrt", "cbrt", "log", "4thrt", "5thrt"
]
| Default
) = Default("sqrt"),
fscale: Int | Literal["lin", "log"] | Default = Default(
"lin"
),
saturation: Float = Default("1"),
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",
]
| Default
) = Default("hann"),
orientation: (
Int | Literal["vertical", "horizontal"] | Default
) = Default("vertical"),
overlap: Float = Default("0"),
gain: Float = Default("1"),
data: (
Int
| Literal["magnitude", "phase", "uphase"]
| Default
) = Default("magnitude"),
rotation: Float = Default("0"),
start: Int = Default("0"),
stop: Int = Default("0"),
fps: String = Default("auto"),
legend: Boolean = Default("false"),
drange: Float = Default("120"),
limit: Float = Default("0"),
opacity: Float = Default("1"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert input audio to a video output, representing the audio frequency spectrum.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
Image_size
|
Specify the video size for the output. For the syntax of this option, check the "Video size" section in the ffmpeg-utils manual. Default value is 640x512. |
Default('640x512')
|
slide
|
Int | Literal['replace', 'scroll', 'fullframe', 'rscroll', 'lreplace'] | Default
|
Specify how the spectrum should slide along the window. It accepts the following values: @end table Default value is replace. |
Default('replace')
|
mode
|
Int | Literal['combined', 'separate'] | Default
|
Specify display mode. It accepts the following values: @end table Default value is combined. |
Default('combined')
|
color
|
Int | Literal['channel', 'intensity', 'rainbow', 'moreland', 'nebulae', 'fire', 'fiery', 'fruit', 'cool', 'magma', 'green', 'viridis', 'plasma', 'cividis', 'terrain'] | Default
|
Specify display color mode. It accepts the following values: @end table Default value is channel. |
Default('channel')
|
scale
|
Int | Literal['lin', 'sqrt', 'cbrt', 'log', '4thrt', '5thrt'] | Default
|
Specify scale used for calculating intensity color values. It accepts the following values: @end table Default value is sqrt. |
Default('sqrt')
|
fscale
|
Int | Literal['lin', 'log'] | Default
|
Specify frequency scale. It accepts the following values: @end table Default value is lin. |
Default('lin')
|
saturation
|
Float
|
Set saturation modifier for displayed colors. Negative values provide alternative color scheme. 0 is no saturation at all. Saturation must be in [-10.0, 10.0] range. Default value is 1. |
Default('1')
|
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'] | Default
|
Set window function. It accepts the following values: @end table Default value is hann. |
Default('hann')
|
orientation
|
Int | Literal['vertical', 'horizontal'] | Default
|
Set orientation of time vs frequency axis. Can be vertical or horizontal. Default is vertical. |
Default('vertical')
|
overlap
|
Float
|
Set ratio of overlap window. Default value is 0. When value is 1 overlap is set to recommended size for specific window function currently used. |
Default('0')
|
gain
|
Float
|
Set scale gain for calculating intensity color values. Default value is 1. |
Default('1')
|
data
|
Int | Literal['magnitude', 'phase', 'uphase'] | Default
|
Set which data to display. Can be magnitude, default or phase, or unwrapped phase: uphase. |
Default('magnitude')
|
rotation
|
Float
|
Set color rotation, must be in [-1.0, 1.0] range. Default value is 0. |
Default('0')
|
start
|
Int
|
Set start frequency from which to display spectrogram. Default is 0. |
Default('0')
|
stop
|
Int
|
Set stop frequency to which to display spectrogram. Default is 0. |
Default('0')
|
fps
|
String
|
Set upper frame rate limit. Default is auto, unlimited. |
Default('auto')
|
legend
|
Boolean
|
Draw time and frequency axes and legends. Default is disabled. |
Default('false')
|
drange
|
Float
|
Set dynamic range used to calculate intensity color values. Default is 120 dBFS. Allowed range is from 10 to 200. |
Default('120')
|
limit
|
Float
|
Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS. Allowed range is from -100 to 100. |
Default('0')
|
opacity
|
Float
|
Set opacity strength when using pixel format output with alpha component. |
Default('1')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
showspectrumpic
¶
showspectrumpic(
*,
size: Image_size = Default("4096x2048"),
mode: (
Int | Literal["combined", "separate"] | Default
) = Default("combined"),
color: (
Int
| Literal[
"channel",
"intensity",
"rainbow",
"moreland",
"nebulae",
"fire",
"fiery",
"fruit",
"cool",
"magma",
"green",
"viridis",
"plasma",
"cividis",
"terrain",
]
| Default
) = Default("intensity"),
scale: (
Int
| Literal[
"lin", "sqrt", "cbrt", "log", "4thrt", "5thrt"
]
| Default
) = Default("log"),
fscale: Int | Literal["lin", "log"] | Default = Default(
"lin"
),
saturation: Float = Default("1"),
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",
]
| Default
) = Default("hann"),
orientation: (
Int | Literal["vertical", "horizontal"] | Default
) = Default("vertical"),
gain: Float = Default("1"),
legend: Boolean = Default("true"),
rotation: Float = Default("0"),
start: Int = Default("0"),
stop: Int = Default("0"),
drange: Float = Default("120"),
limit: Float = Default("0"),
opacity: Float = Default("1"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert input audio to a single video frame, representing the audio frequency spectrum.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
Image_size
|
Specify the video size for the output. For the syntax of this option, check the "Video size" section in the ffmpeg-utils manual. Default value is 4096x2048. |
Default('4096x2048')
|
mode
|
Int | Literal['combined', 'separate'] | Default
|
Specify display mode. It accepts the following values: @end table Default value is combined. |
Default('combined')
|
color
|
Int | Literal['channel', 'intensity', 'rainbow', 'moreland', 'nebulae', 'fire', 'fiery', 'fruit', 'cool', 'magma', 'green', 'viridis', 'plasma', 'cividis', 'terrain'] | Default
|
Specify display color mode. It accepts the following values: @end table Default value is intensity. |
Default('intensity')
|
scale
|
Int | Literal['lin', 'sqrt', 'cbrt', 'log', '4thrt', '5thrt'] | Default
|
Specify scale used for calculating intensity color values. It accepts the following values: @end table Default value is log. |
Default('log')
|
fscale
|
Int | Literal['lin', 'log'] | Default
|
Specify frequency scale. It accepts the following values: @end table Default value is lin. |
Default('lin')
|
saturation
|
Float
|
Set saturation modifier for displayed colors. Negative values provide alternative color scheme. 0 is no saturation at all. Saturation must be in [-10.0, 10.0] range. Default value is 1. |
Default('1')
|
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'] | Default
|
Set window function. It accepts the following values: @end table Default value is hann. |
Default('hann')
|
orientation
|
Int | Literal['vertical', 'horizontal'] | Default
|
Set orientation of time vs frequency axis. Can be vertical or horizontal. Default is vertical. |
Default('vertical')
|
gain
|
Float
|
Set scale gain for calculating intensity color values. Default value is 1. |
Default('1')
|
legend
|
Boolean
|
Draw time and frequency axes and legends. Default is enabled. |
Default('true')
|
rotation
|
Float
|
Set color rotation, must be in [-1.0, 1.0] range. Default value is 0. |
Default('0')
|
start
|
Int
|
Set start frequency from which to display spectrogram. Default is 0. |
Default('0')
|
stop
|
Int
|
Set stop frequency to which to display spectrogram. Default is 0. |
Default('0')
|
drange
|
Float
|
Set dynamic range used to calculate intensity color values. Default is 120 dBFS. Allowed range is from 10 to 200. |
Default('120')
|
limit
|
Float
|
Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS. Allowed range is from -100 to 100. |
Default('0')
|
opacity
|
Float
|
Set opacity strength when using pixel format output with alpha component. |
Default('1')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
showvolume
¶
showvolume(
*,
rate: Video_rate = Default("25"),
b: Int = Default("1"),
w: Int = Default("400"),
h: Int = Default("20"),
f: Double = Default("0.95"),
c: String = Default(
"PEAK*255+floor((1-PEAK)*255)*256+0xff000000"
),
t: Boolean = Default("true"),
v: Boolean = Default("true"),
dm: Double = Default("0"),
dmc: Color = Default("orange"),
o: Int | Literal["h", "v"] | Default = Default("h"),
s: Int = Default("0"),
p: Float = Default("0"),
m: Int | Literal["p", "r"] | Default = Default("p"),
ds: Int | Literal["lin", "log"] | Default = Default(
"lin"
),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert input audio volume to a video output.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rate
|
Video_rate
|
Set video rate. |
Default('25')
|
b
|
Int
|
Set border width, allowed range is [0, 5]. Default is 1. |
Default('1')
|
w
|
Int
|
Set channel width, allowed range is [80, 8192]. Default is 400. |
Default('400')
|
h
|
Int
|
Set channel height, allowed range is [1, 900]. Default is 20. |
Default('20')
|
f
|
Double
|
Set fade, allowed range is [0, 1]. Default is 0.95. |
Default('0.95')
|
c
|
String
|
Set volume color expression. The expression can use the following variables: @end table |
Default('PEAK*255+floor((1-PEAK)*255)*256+0xff000000')
|
t
|
Boolean
|
If set, displays channel names. Default is enabled. |
Default('true')
|
v
|
Boolean
|
If set, displays volume values. Default is enabled. |
Default('true')
|
dm
|
Double
|
In second. If set to > 0., display a line for the max level in the previous seconds. default is disabled: 0. |
Default('0')
|
dmc
|
Color
|
The color of the max line. Use when dm option is set to > 0. default is: orange |
Default('orange')
|
o
|
Int | Literal['h', 'v'] | Default
|
Set orientation, can be horizontal: h or vertical: v, default is h. |
Default('h')
|
s
|
Int
|
Set step size, allowed range is [0, 5]. Default is 0, which means step is disabled. |
Default('0')
|
p
|
Float
|
Set background opacity, allowed range is [0, 1]. Default is 0. |
Default('0')
|
m
|
Int | Literal['p', 'r'] | Default
|
Set metering mode, can be peak: p or rms: r, default is p. |
Default('p')
|
ds
|
Int | Literal['lin', 'log'] | Default
|
Set display scale, can be linear: lin or log: log, default is lin. |
Default('lin')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
showwaves
¶
showwaves(
*,
size: Image_size = Default("600x240"),
mode: (
Int
| Literal["point", "line", "p2p", "cline"]
| Default
) = Default("point"),
n: Int = Default("0"),
rate: Video_rate = Default("25"),
split_channels: Boolean = Default("false"),
colors: String = Default(
"red|green|blue|yellow|orange|lime|pink|magenta|brown"
),
scale: (
Int
| Literal["lin", "log", "sqrt", "cbrt"]
| Default
) = Default("lin"),
draw: (
Int | Literal["scale", "full"] | Default
) = Default("scale"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert input audio to a video output, representing the samples waves.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
Image_size
|
Specify the video size for the output. For the syntax of this option, check the "Video size" section in the ffmpeg-utils manual. Default value is 600x240. |
Default('600x240')
|
mode
|
Int | Literal['point', 'line', 'p2p', 'cline'] | Default
|
Set display mode. Available values are: @end table Default value is point. |
Default('point')
|
n
|
Int
|
Set the number of samples which are printed on the same column. A larger value will decrease the frame rate. Must be a positive integer. This option can be set only if the value for rate is not explicitly specified. |
Default('0')
|
rate
|
Video_rate
|
Set the (approximate) output frame rate. This is done by setting the option n. Default value is "25". |
Default('25')
|
split_channels
|
Boolean
|
Set if channels should be drawn separately or overlap. Default value is 0. |
Default('false')
|
colors
|
String
|
Set colors separated by '|' which are going to be used for drawing of each channel. |
Default('red|green|blue|yellow|orange|lime|pink|magenta|brown')
|
scale
|
Int | Literal['lin', 'log', 'sqrt', 'cbrt'] | Default
|
Set amplitude scale. Available values are: @end table Default is linear. |
Default('lin')
|
draw
|
Int | Literal['scale', 'full'] | Default
|
Set the draw mode. This is mostly useful to set for high n. Available values are: @end table Default value is scale. |
Default('scale')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
showwavespic
¶
showwavespic(
*,
size: Image_size = Default("600x240"),
split_channels: Boolean = Default("false"),
colors: String = Default(
"red|green|blue|yellow|orange|lime|pink|magenta|brown"
),
scale: (
Int
| Literal["lin", "log", "sqrt", "cbrt"]
| Default
) = Default("lin"),
draw: (
Int | Literal["scale", "full"] | Default
) = Default("scale"),
filter: (
Int | Literal["average", "peak"] | Default
) = Default("average"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert input audio to a single video frame, representing the samples waves.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
Image_size
|
Specify the video size for the output. For the syntax of this option, check the "Video size" section in the ffmpeg-utils manual. Default value is 600x240. |
Default('600x240')
|
split_channels
|
Boolean
|
Set if channels should be drawn separately or overlap. Default value is 0. |
Default('false')
|
colors
|
String
|
Set colors separated by '|' which are going to be used for drawing of each channel. |
Default('red|green|blue|yellow|orange|lime|pink|magenta|brown')
|
scale
|
Int | Literal['lin', 'log', 'sqrt', 'cbrt'] | Default
|
Set amplitude scale. Available values are: @end table Default is linear. |
Default('lin')
|
draw
|
Int | Literal['scale', 'full'] | Default
|
Set the draw mode. Available values are: @end table Default value is scale. |
Default('scale')
|
filter
|
Int | Literal['average', 'peak'] | Default
|
Set the filter mode. Available values are: @end table Default value is average. |
Default('average')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
shuffleframes
¶
shuffleframes(
*,
mapping: String = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Reorder and/or duplicate and/or drop video frames.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mapping
|
String
|
Set the destination indexes of input frames. This is space or '|' separated list of indexes that maps input frames to output frames. Number of indexes also sets maximal value that each index may have. '-1' index have special meaning and that is to drop frame. |
Default('0')
|
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
shufflepixels
¶
shufflepixels(
*,
direction: (
Int | Literal["forward", "inverse"] | Default
) = Default("forward"),
mode: (
Int
| Literal["horizontal", "vertical", "block"]
| Default
) = Default("horizontal"),
width: Int = Default("10"),
height: Int = Default("10"),
seed: Int64 = Default("-1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Reorder pixels in video frames.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
direction
|
Int | Literal['forward', 'inverse'] | Default
|
Set shuffle direction. Can be forward or inverse direction. Default direction is forward. |
Default('forward')
|
mode
|
Int | Literal['horizontal', 'vertical', 'block'] | Default
|
Set shuffle mode. Can be horizontal, vertical or block mode. |
Default('horizontal')
|
width
|
Int
|
set block width (from 1 to 8000) (default 10) |
Default('10')
|
height
|
Int
|
Set shuffle block_size. In case of horizontal shuffle mode only width part of size is used, and in case of vertical shuffle mode only height part of size is used. |
Default('10')
|
seed
|
Int64
|
Set random seed used with shuffling pixels. Mainly useful to set to be able to reverse filtering process to get original input. For example, to reverse forward shuffle you need to use same parameters and exact same seed and to set direction to inverse. |
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
shuffleplanes
¶
shuffleplanes(
*,
map0: Int = Default("0"),
map1: Int = Default("1"),
map2: Int = Default("2"),
map3: Int = Default("3"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Reorder and/or duplicate video planes.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
map0
|
Int
|
The index of the input plane to be used as the first output plane. |
Default('0')
|
map1
|
Int
|
The index of the input plane to be used as the second output plane. |
Default('1')
|
map2
|
Int
|
The index of the input plane to be used as the third output plane. |
Default('2')
|
map3
|
Int
|
The index of the input plane to be used as the fourth output plane. |
Default('3')
|
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
sidechaincompress
¶
sidechaincompress(
_sidechain: AudioStream,
*,
level_in: Double = Default("1"),
mode: (
Int | Literal["downward", "upward"] | Default
) = Default("downward"),
threshold: Double = Default("0.125"),
ratio: Double = Default("2"),
attack: Double = Default("20"),
release: Double = Default("250"),
makeup: Double = Default("1"),
knee: Double = Default("2.82843"),
link: (
Int | Literal["average", "maximum"] | Default
) = Default("average"),
detection: (
Int | Literal["peak", "rms"] | Default
) = Default("rms"),
level_sc: Double = Default("1"),
mix: Double = Default("1"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
This filter acts like normal compressor but has the ability to compress detected signal using second input signal. It needs two input streams and returns one output stream. First input stream will be processed depending on second stream signal. The filtered signal then can be filtered with other filters in later stages of processing. See pan and amerge filter.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_in
|
Double
|
Set input gain. Default is 1. Range is between 0.015625 and 64. |
Default('1')
|
mode
|
Int | Literal['downward', 'upward'] | Default
|
Set mode of compressor operation. Can be upward or downward. Default is downward. |
Default('downward')
|
threshold
|
Double
|
If a signal of second stream raises above this level it will affect the gain reduction of first stream. By default is 0.125. Range is between 0.00097563 and 1. |
Default('0.125')
|
ratio
|
Double
|
Set a ratio about which the signal is reduced. 1:2 means that if the level raised 4dB above the threshold, it will be only 2dB above after the reduction. Default is 2. Range is between 1 and 20. |
Default('2')
|
attack
|
Double
|
Amount of milliseconds the signal has to rise above the threshold before gain reduction starts. Default is 20. Range is between 0.01 and 2000. |
Default('20')
|
release
|
Double
|
Amount of milliseconds the signal has to fall below the threshold before reduction is decreased again. Default is 250. Range is between 0.01 and 9000. |
Default('250')
|
makeup
|
Double
|
Set the amount by how much signal will be amplified after processing. Default is 1. Range is from 1 to 64. |
Default('1')
|
knee
|
Double
|
Curve the sharp knee around the threshold to enter gain reduction more softly. Default is 2.82843. Range is between 1 and 8. |
Default('2.82843')
|
link
|
Int | Literal['average', 'maximum'] | Default
|
Choose if the average level between all channels of side-chain stream or the louder(maximum) channel of side-chain stream affects the reduction. Default is average. |
Default('average')
|
detection
|
Int | Literal['peak', 'rms'] | Default
|
Should the exact signal be taken in case of peak or an RMS one in case of rms. Default is rms which is mainly smoother. |
Default('rms')
|
level_sc
|
Double
|
Set sidechain gain. Default is 1. Range is between 0.015625 and 64. |
Default('1')
|
mix
|
Double
|
How much to use compressed signal in output. Default is 1. Range is between 0 and 1. |
Default('1')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
sidechaingate
¶
sidechaingate(
_sidechain: AudioStream,
*,
level_in: Double = Default("1"),
mode: (
Int | Literal["downward", "upward"] | Default
) = Default("downward"),
range: Double = Default("0.06125"),
threshold: Double = Default("0.125"),
ratio: Double = Default("2"),
attack: Double = Default("20"),
release: Double = Default("250"),
makeup: Double = Default("1"),
knee: Double = Default("2.82843"),
detection: (
Int | Literal["peak", "rms"] | Default
) = Default("rms"),
link: (
Int | Literal["average", "maximum"] | Default
) = Default("average"),
level_sc: Double = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
A sidechain gate acts like a normal (wideband) gate but has the ability to filter the detected signal before sending it to the gain reduction stage. Normally a gate uses the full range signal to detect a level above the threshold. For example: If you cut all lower frequencies from your sidechain signal the gate will decrease the volume of your track only if not enough highs appear. With this technique you are able to reduce the resonation of a natural drum or remove "rumbling" of muted strokes from a heavily distorted guitar. It needs two input streams and returns one output stream. First input stream will be processed depending on second stream signal.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_in
|
Double
|
Set input level before filtering. Default is 1. Allowed range is from 0.015625 to 64. |
Default('1')
|
mode
|
Int | Literal['downward', 'upward'] | Default
|
Set the mode of operation. Can be upward or downward. Default is downward. If set to upward mode, higher parts of signal will be amplified, expanding dynamic range in upward direction. Otherwise, in case of downward lower parts of signal will be reduced. |
Default('downward')
|
range
|
Double
|
Set the level of gain reduction when the signal is below the threshold. Default is 0.06125. Allowed range is from 0 to 1. Setting this to 0 disables reduction and then filter behaves like expander. |
Default('0.06125')
|
threshold
|
Double
|
If a signal rises above this level the gain reduction is released. Default is 0.125. Allowed range is from 0 to 1. |
Default('0.125')
|
ratio
|
Double
|
Set a ratio about which the signal is reduced. Default is 2. Allowed range is from 1 to 9000. |
Default('2')
|
attack
|
Double
|
Amount of milliseconds the signal has to rise above the threshold before gain reduction stops. Default is 20 milliseconds. Allowed range is from 0.01 to 9000. |
Default('20')
|
release
|
Double
|
Amount of milliseconds the signal has to fall below the threshold before the reduction is increased again. Default is 250 milliseconds. Allowed range is from 0.01 to 9000. |
Default('250')
|
makeup
|
Double
|
Set amount of amplification of signal after processing. Default is 1. Allowed range is from 1 to 64. |
Default('1')
|
knee
|
Double
|
Curve the sharp knee around the threshold to enter gain reduction more softly. Default is 2.828427125. Allowed range is from 1 to 8. |
Default('2.82843')
|
detection
|
Int | Literal['peak', 'rms'] | Default
|
Choose if exact signal should be taken for detection or an RMS like one. Default is rms. Can be peak or rms. |
Default('rms')
|
link
|
Int | Literal['average', 'maximum'] | Default
|
Choose if the average level between all channels or the louder channel affects the reduction. Default is average. Can be average or maximum. |
Default('average')
|
level_sc
|
Double
|
Set sidechain gain. Default is 1. Range is from 0.015625 to 64. |
Default('1')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
sidedata
¶
sidedata(
*,
mode: (
Int | Literal["select", "delete"] | Default
) = Default("select"),
type: (
Int
| Literal[
"PANSCAN",
"A53_CC",
"STEREO3D",
"MATRIXENCODING",
"DOWNMIX_INFO",
"REPLAYGAIN",
"DISPLAYMATRIX",
"AFD",
"MOTION_VECTORS",
"SKIP_SAMPLES",
"AUDIO_SERVICE_TYPE",
"MASTERING_DISPLAY_METADATA",
"GOP_TIMECODE",
"SPHERICAL",
"CONTENT_LIGHT_LEVEL",
"ICC_PROFILE",
"S12M_TIMECOD",
"DYNAMIC_HDR_PLUS",
"REGIONS_OF_INTEREST",
"DETECTION_BOUNDING_BOXES",
"SEI_UNREGISTERED",
]
| Default
) = Default("-1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Delete frame side data, or select frames based on it.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Int | Literal['select', 'delete'] | Default
|
Set mode of operation of the filter. Can be one of the following: @end table |
Default('select')
|
type
|
Int | Literal['PANSCAN', 'A53_CC', 'STEREO3D', 'MATRIXENCODING', 'DOWNMIX_INFO', 'REPLAYGAIN', 'DISPLAYMATRIX', 'AFD', 'MOTION_VECTORS', 'SKIP_SAMPLES', 'AUDIO_SERVICE_TYPE', 'MASTERING_DISPLAY_METADATA', 'GOP_TIMECODE', 'SPHERICAL', 'CONTENT_LIGHT_LEVEL', 'ICC_PROFILE', 'S12M_TIMECOD', 'DYNAMIC_HDR_PLUS', 'REGIONS_OF_INTEREST', 'DETECTION_BOUNDING_BOXES', 'SEI_UNREGISTERED'] | Default
|
Set side data type used with all modes. Must be set for select mode. For the list of frame side data types, refer to the AVFrameSideDataType enum in libavutil/frame.h. For example, to choose AV_FRAME_DATA_PANSCAN side data, you must specify PANSCAN. |
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
signalstats
¶
signalstats(
*,
stat: (
Flags | Literal["tout", "vrep", "brng"] | Default
) = Default("0"),
out: (
Int | Literal["tout", "vrep", "brng"] | Default
) = Default("-1"),
c: Color = Default("yellow"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Evaluate various visual metrics that assist in determining issues associated with the digitization of analog video media.
By default the filter will log these metadata values:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stat
|
Flags | Literal['tout', 'vrep', 'brng'] | Default
|
set statistics filters (default 0) |
Default('0')
|
out
|
Int | Literal['tout', 'vrep', 'brng'] | Default
|
stat specify an additional form of image analysis. out output video with the specified type of pixel highlighted. Both options accept the following values: @end table |
Default('-1')
|
c
|
Color
|
Set the highlight color for the out option. The default color is yellow. |
Default('yellow')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
silencedetect
¶
silencedetect(
*,
n: Double = Default("0.001"),
d: Duration = Default("2"),
mono: Boolean = Default("false"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Detect silence in an audio stream.
This filter logs a message when it detects that the input audio volume is less or equal to a noise tolerance value for a duration greater or equal to the minimum detected noise duration.
The printed times and duration are expressed in seconds. The lavfi.silence_start or lavfi.silence_start.X metadata key is set on the first frame whose timestamp equals or exceeds the detection duration and it contains the timestamp of the first frame of the silence.
The lavfi.silence_duration or lavfi.silence_duration.X and lavfi.silence_end or lavfi.silence_end.X metadata keys are set on the first frame after the silence. If mono is enabled, and each channel is evaluated separately, the .X suffixed keys are used, and X corresponds to the channel number.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Double
|
Set noise tolerance. Can be specified in dB (in case "dB" is appended to the specified value) or amplitude ratio. Default is -60dB, or 0.001. |
Default('0.001')
|
d
|
Duration
|
Set silence duration until notification (default is 2 seconds). See the Time duration section in the ffmpeg-utils(1) manual for the accepted syntax. |
Default('2')
|
mono
|
Boolean
|
Process each channel separately, instead of combined. By default is disabled. |
Default('false')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
silenceremove
¶
silenceremove(
*,
start_periods: Int = Default("0"),
start_duration: Duration = Default("0"),
start_threshold: Double = Default("0"),
start_silence: Duration = Default("0"),
start_mode: (
Int | Literal["any", "all"] | Default
) = Default("any"),
stop_periods: Int = Default("0"),
stop_duration: Duration = Default("0"),
stop_threshold: Double = Default("0"),
stop_silence: Duration = Default("0"),
stop_mode: (
Int | Literal["any", "all"] | Default
) = Default("any"),
detection: (
Int | Literal["peak", "rms"] | Default
) = Default("rms"),
window: Duration = Default("0.02"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Remove silence from the beginning, middle or end of the audio.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_periods
|
Int
|
This value is used to indicate if audio should be trimmed at beginning of the audio. A value of zero indicates no silence should be trimmed from the beginning. When specifying a non-zero value, it trims audio up until it finds non-silence. Normally, when trimming silence from beginning of audio the start_periods will be 1 but it can be increased to higher values to trim all audio up to specific count of non-silence periods. Default value is 0. |
Default('0')
|
start_duration
|
Duration
|
Specify the amount of time that non-silence must be detected before it stops trimming audio. By increasing the duration, bursts of noises can be treated as silence and trimmed off. Default value is 0. |
Default('0')
|
start_threshold
|
Double
|
This indicates what sample value should be treated as silence. For digital audio, a value of 0 may be fine but for audio recorded from analog, you may wish to increase the value to account for background noise. Can be specified in dB (in case "dB" is appended to the specified value) or amplitude ratio. Default value is 0. |
Default('0')
|
start_silence
|
Duration
|
Specify max duration of silence at beginning that will be kept after trimming. Default is 0, which is equal to trimming all samples detected as silence. |
Default('0')
|
start_mode
|
Int | Literal['any', 'all'] | Default
|
Specify mode of detection of silence end in start of multi-channel audio. Can be any or all. Default is any. With any, any sample that is detected as non-silence will cause stopped trimming of silence. With all, only if all channels are detected as non-silence will cause stopped trimming of silence. |
Default('any')
|
stop_periods
|
Int
|
Set the count for trimming silence from the end of audio. To remove silence from the middle of a file, specify a stop_periods that is negative. This value is then treated as a positive value and is used to indicate the effect should restart processing as specified by start_periods, making it suitable for removing periods of silence in the middle of the audio. Default value is 0. |
Default('0')
|
stop_duration
|
Duration
|
Specify a duration of silence that must exist before audio is not copied any more. By specifying a higher duration, silence that is wanted can be left in the audio. Default value is 0. |
Default('0')
|
stop_threshold
|
Double
|
This is the same as start_threshold but for trimming silence from the end of audio. Can be specified in dB (in case "dB" is appended to the specified value) or amplitude ratio. Default value is 0. |
Default('0')
|
stop_silence
|
Duration
|
Specify max duration of silence at end that will be kept after trimming. Default is 0, which is equal to trimming all samples detected as silence. |
Default('0')
|
stop_mode
|
Int | Literal['any', 'all'] | Default
|
Specify mode of detection of silence start in end of multi-channel audio. Can be any or all. Default is any. With any, any sample that is detected as non-silence will cause stopped trimming of silence. With all, only if all channels are detected as non-silence will cause stopped trimming of silence. |
Default('any')
|
detection
|
Int | Literal['peak', 'rms'] | Default
|
Set how is silence detected. Can be rms or peak. Second is faster and works better with digital silence which is exactly 0. Default value is rms. |
Default('rms')
|
window
|
Duration
|
Set duration in number of seconds used to calculate size of window in number of samples for detecting silence. Default value is 0.02. Allowed range is from 0 to 10. |
Default('0.02')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
siti
¶
siti(
*,
print_summary: Boolean = Default("false"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Calculate Spatial Info (SI) and Temporal Info (TI) scores for a video, as defined in ITU-T P.910: Subjective video quality assessment methods for multimedia applications. Available PDF at https://www.itu.int/rec/T-REC-P.910-199909-S/en .
It accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
print_summary
|
Boolean
|
If set to 1, Summary statistics will be printed to the console. Default 0. |
Default('false')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
smartblur
¶
smartblur(
*,
luma_radius: Float = Default("1"),
luma_strength: Float = Default("1"),
luma_threshold: Int = Default("0"),
chroma_radius: Float = Default("-0.9"),
chroma_strength: Float = Default("-2"),
chroma_threshold: Int = Default("-31"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Blur the input video without impacting the outlines.
It accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
luma_radius
|
Float
|
Set the luma radius. The option value must be a float number in the range [0.1,5.0] that specifies the variance of the gaussian filter used to blur the image (slower if larger). Default value is 1.0. |
Default('1')
|
luma_strength
|
Float
|
Set the luma strength. The option value must be a float number in the range [-1.0,1.0] that configures the blurring. A value included in [0.0,1.0] will blur the image whereas a value included in [-1.0,0.0] will sharpen the image. Default value is 1.0. |
Default('1')
|
luma_threshold
|
Int
|
Set the luma threshold used as a coefficient to determine whether a pixel should be blurred or not. The option value must be an integer in the range [-30,30]. A value of 0 will filter all the image, a value included in [0,30] will filter flat areas and a value included in [-30,0] will filter edges. Default value is 0. |
Default('0')
|
chroma_radius
|
Float
|
Set the chroma radius. The option value must be a float number in the range [0.1,5.0] that specifies the variance of the gaussian filter used to blur the image (slower if larger). Default value is luma_radius. |
Default('-0.9')
|
chroma_strength
|
Float
|
Set the chroma strength. The option value must be a float number in the range [-1.0,1.0] that configures the blurring. A value included in [0.0,1.0] will blur the image whereas a value included in [-1.0,0.0] will sharpen the image. Default value is luma_strength. |
Default('-2')
|
chroma_threshold
|
Int
|
Set the chroma threshold used as a coefficient to determine whether a pixel should be blurred or not. The option value must be an integer in the range [-30,30]. A value of 0 will filter all the image, a value included in [0,30] will filter flat areas and a value included in [-30,0] will filter edges. Default value is luma_threshold. |
Default('-31')
|
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
sobel
¶
sobel(
*,
planes: Int = Default("15"),
scale: Float = Default("1"),
delta: Float = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply sobel operator to input video stream.
The filter accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planes
|
Int
|
Set which planes will be processed, unprocessed planes will be copied. By default value 0xf, all planes will be processed. |
Default('15')
|
scale
|
Float
|
Set value which will be multiplied with filtered result. |
Default('1')
|
delta
|
Float
|
Set value which will be added to filtered result. |
Default('0')
|
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
spectrumsynth
¶
spectrumsynth(
_phase: VideoStream,
*,
sample_rate: Int = Default("44100"),
channels: Int = Default("1"),
scale: Int | Literal["lin", "log"] | Default = Default(
"log"
),
slide: (
Int
| Literal[
"replace", "scroll", "fullframe", "rscroll"
]
| Default
) = Default("fullframe"),
win_func: (
Int
| Literal[
"rect",
"bartlett",
"hann",
"hanning",
"hamming",
"blackman",
"welch",
"flattop",
"bharris",
"bnuttall",
"bhann",
"sine",
"nuttall",
"lanczos",
"gauss",
"tukey",
"dolph",
"cauchy",
"parzen",
"poisson",
"bohman",
]
| Default
) = Default("rect"),
overlap: Float = Default("1"),
orientation: (
Int | Literal["vertical", "horizontal"] | Default
) = Default("vertical"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Synthesize audio from 2 input video spectrums, first input stream represents magnitude across time and second represents phase across time. The filter will transform from frequency domain as displayed in videos back to time domain as presented in audio output.
This filter is primarily created for reversing processed showspectrum filter outputs, but can synthesize sound from other spectrograms too. But in such case results are going to be poor if the phase data is not available, because in such cases phase data need to be recreated, usually it's just recreated from random noise. For best results use gray only output (channel color mode in showspectrum filter) and log scale for magnitude video and lin scale for phase video. To produce phase, for 2nd video, use data option. Inputs videos should generally use fullframe slide mode as that saves resources needed for decoding video.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample_rate
|
Int
|
Specify sample rate of output audio, the sample rate of audio from which spectrum was generated may differ. |
Default('44100')
|
channels
|
Int
|
Set number of channels represented in input video spectrums. |
Default('1')
|
scale
|
Int | Literal['lin', 'log'] | Default
|
Set scale which was used when generating magnitude input spectrum. Can be lin or log. Default is log. |
Default('log')
|
slide
|
Int | Literal['replace', 'scroll', 'fullframe', 'rscroll'] | Default
|
Set slide which was used when generating inputs spectrums. Can be replace, scroll, fullframe or rscroll. Default is fullframe. |
Default('fullframe')
|
win_func
|
Int | Literal['rect', 'bartlett', 'hann', 'hanning', 'hamming', 'blackman', 'welch', 'flattop', 'bharris', 'bnuttall', 'bhann', 'sine', 'nuttall', 'lanczos', 'gauss', 'tukey', 'dolph', 'cauchy', 'parzen', 'poisson', 'bohman'] | Default
|
Set window function used for resynthesis. |
Default('rect')
|
overlap
|
Float
|
Set window overlap. In range [0, 1]. Default is 1, which means optimal overlap for selected window function will be picked. |
Default('1')
|
orientation
|
Int | Literal['vertical', 'horizontal'] | Default
|
Set orientation of input videos. Can be vertical or horizontal. Default is vertical. |
Default('vertical')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
speechnorm
¶
speechnorm(
*,
peak: Double = Default("0.95"),
expansion: Double = Default("2"),
compression: Double = Default("2"),
threshold: Double = Default("0"),
_raise: Double = Default("0.001"),
fall: Double = Default("0.001"),
channels: String = Default("all"),
invert: Boolean = Default("false"),
link: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Speech Normalizer.
This filter expands or compresses each half-cycle of audio samples (local set of samples all above or all below zero and between two nearest zero crossings) depending on threshold value, so audio reaches target peak value under conditions controlled by below options.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
peak
|
Double
|
Set the expansion target peak value. This specifies the highest allowed absolute amplitude level for the normalized audio input. Default value is 0.95. Allowed range is from 0.0 to 1.0. |
Default('0.95')
|
expansion
|
Double
|
Set the maximum expansion factor. Allowed range is from 1.0 to 50.0. Default value is 2.0. This option controls maximum local half-cycle of samples expansion. The maximum expansion would be such that local peak value reaches target peak value but never to surpass it and that ratio between new and previous peak value does not surpass this option value. |
Default('2')
|
compression
|
Double
|
Set the maximum compression factor. Allowed range is from 1.0 to 50.0. Default value is 2.0. This option controls maximum local half-cycle of samples compression. This option is used only if threshold option is set to value greater than 0.0, then in such cases when local peak is lower or same as value set by threshold all samples belonging to that peak's half-cycle will be compressed by current compression factor. |
Default('2')
|
threshold
|
Double
|
Set the threshold value. Default value is 0.0. Allowed range is from 0.0 to 1.0. This option specifies which half-cycles of samples will be compressed and which will be expanded. Any half-cycle samples with their local peak value below or same as this option value will be compressed by current compression factor, otherwise, if greater than threshold value they will be expanded with expansion factor so that it could reach peak target value but never surpass it. |
Default('0')
|
_raise
|
Double
|
Set the expansion raising amount per each half-cycle of samples. Default value is 0.001. Allowed range is from 0.0 to 1.0. This controls how fast expansion factor is raised per each new half-cycle until it reaches expansion value. Setting this options too high may lead to distortions. |
Default('0.001')
|
fall
|
Double
|
Set the compression raising amount per each half-cycle of samples. Default value is 0.001. Allowed range is from 0.0 to 1.0. This controls how fast compression factor is raised per each new half-cycle until it reaches compression value. |
Default('0.001')
|
channels
|
String
|
Specify which channels to filter, by default all available channels are filtered. |
Default('all')
|
invert
|
Boolean
|
Enable inverted filtering, by default is disabled. This inverts interpretation of threshold option. When enabled any half-cycle of samples with their local peak value below or same as threshold option will be expanded otherwise it will be compressed. |
Default('false')
|
link
|
Boolean
|
Link channels when calculating gain applied to each filtered channel sample, by default is disabled. When disabled each filtered channel gain calculation is independent, otherwise when this option is enabled the minimum of all possible gains for each filtered channel is used. |
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 |
AudioStream
|
the audio stream |
References
split
¶
split(
*,
outputs: Int = Default("2"),
extra_options: dict[str, Any] | None = None
) -> FilterNode
Split input into several identical outputs.
asplit works with audio input, split with video.
The filter accepts a single parameter which specifies the number of outputs. If unspecified, it defaults to 2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
outputs
|
Int
|
set number of outputs (from 1 to INT_MAX) (default 2) |
Default('2')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
filter_node |
FilterNode
|
the filter node |
References
spp
¶
spp(
*,
quality: Int = Default("3"),
qp: Int = Default("0"),
mode: Int | Literal["hard", "soft"] | Default = Default(
"hard"
),
use_bframe_qp: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply a simple postprocessing filter that compresses and decompresses the image at several (or - in the case of quality level 6 - all) shifts and average the results.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quality
|
Int
|
Set quality level. The value max can be used to set the maximum level, currently 6. |
Default('3')
|
qp
|
Int
|
Force a constant quantization parameter. If not set, the filter will use the QP from the video stream (if available). |
Default('0')
|
mode
|
Int | Literal['hard', 'soft'] | Default
|
Set thresholding mode. Available modes are: @end table |
Default('hard')
|
use_bframe_qp
|
Boolean
|
Enable the use of the QP from the B-Frames if set to 1. Using this option may cause flicker since the B-Frames have often larger QP. Default is 0 (not enabled). |
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
sr
¶
sr(
*,
dnn_backend: (
Int | Literal["native"] | Default
) = Default("native"),
scale_factor: Int = Default("2"),
model: String = Default(None),
input: String = Default("x"),
output: String = Default("y"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Scale the input by applying one of the super-resolution methods based on convolutional neural networks. Supported models:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dnn_backend
|
Int | Literal['native'] | Default
|
Specify which DNN backend to use for model loading and execution. This option accepts the following values: @end table Default value is native. |
Default('native')
|
scale_factor
|
Int
|
Set scale factor for SRCNN model. Allowed values are 2, 3 and 4. Default value is 2. Scale factor is necessary for SRCNN model, because it accepts input upscaled using bicubic upscaling with proper scale factor. |
Default('2')
|
model
|
String
|
Set path to model file specifying network architecture and its parameters. Note that different backends use different file formats. TensorFlow backend can load files for both formats, while native backend can load files for only its format. |
Default(None)
|
input
|
String
|
input name of the model (default "x") |
Default('x')
|
output
|
String
|
output name of the model (default "y") |
Default('y')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
ssim
¶
ssim(
_reference: VideoStream,
*,
stats_file: String = Default(None),
framesync_options: FFMpegFrameSyncOption | None = None,
eof_action: str | None = None,
shortest: bool | None = None,
repeatlast: bool | None = None,
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Obtain the SSIM (Structural SImilarity Metric) between two input videos.
This filter takes in input two input videos, the first input is considered the "main" source and is passed unchanged to the output. The second input is used as a "reference" video for computing the SSIM.
Both video inputs must have the same resolution and pixel format for this filter to work correctly. Also it assumes that both inputs have the same number of frames, which are compared one by one.
The filter stores the calculated SSIM of each frame.
The description of the accepted parameters follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stats_file
|
String
|
If specified the filter will use the named file to save the SSIM of each individual frame. When filename equals "-" the data is sent to standard output. |
Default(None)
|
framesync_options
|
FFMpegFrameSyncOption | None
|
Framesync options |
None
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
stereo3d
¶
stereo3d(
*,
_in: (
Int
| Literal[
"ab2l",
"tb2l",
"ab2r",
"tb2r",
"abl",
"tbl",
"abr",
"tbr",
"al",
"ar",
"sbs2l",
"sbs2r",
"sbsl",
"sbsr",
"irl",
"irr",
"icl",
"icr",
]
| Default
) = Default("sbsl"),
out: (
Int
| Literal[
"ab2l",
"tb2l",
"ab2r",
"tb2r",
"abl",
"tbl",
"abr",
"tbr",
"agmc",
"agmd",
"agmg",
"agmh",
"al",
"ar",
"arbg",
"arcc",
"arcd",
"arcg",
"arch",
"argg",
"aybc",
"aybd",
"aybg",
"aybh",
"irl",
"irr",
"ml",
"mr",
"sbs2l",
"sbs2r",
"sbsl",
"sbsr",
"chl",
"chr",
"icl",
"icr",
"hdmi",
]
| Default
) = Default("arcd"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert between different stereoscopic image formats.
The filters accept the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
_in
|
Int | Literal['ab2l', 'tb2l', 'ab2r', 'tb2r', 'abl', 'tbl', 'abr', 'tbr', 'al', 'ar', 'sbs2l', 'sbs2r', 'sbsl', 'sbsr', 'irl', 'irr', 'icl', 'icr'] | Default
|
Set stereoscopic image format of input. Available values for input image formats are: @end table |
Default('sbsl')
|
out
|
Int | Literal['ab2l', 'tb2l', 'ab2r', 'tb2r', 'abl', 'tbl', 'abr', 'tbr', 'agmc', 'agmd', 'agmg', 'agmh', 'al', 'ar', 'arbg', 'arcc', 'arcd', 'arcg', 'arch', 'argg', 'aybc', 'aybd', 'aybg', 'aybh', 'irl', 'irr', 'ml', 'mr', 'sbs2l', 'sbs2r', 'sbsl', 'sbsr', 'chl', 'chr', 'icl', 'icr', 'hdmi'] | Default
|
Set stereoscopic image format of output. @end table Default value is arcd. |
Default('arcd')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
stereotools
¶
stereotools(
*,
level_in: Double = Default("1"),
level_out: Double = Default("1"),
balance_in: Double = Default("0"),
balance_out: Double = Default("0"),
softclip: Boolean = Default("false"),
mutel: Boolean = Default("false"),
muter: Boolean = Default("false"),
phasel: Boolean = Default("false"),
phaser: Boolean = Default("false"),
mode: (
Int
| Literal[
"lr>lr",
"lr>ms",
"ms>lr",
"lr>ll",
"lr>rr",
"lr>l+r",
"lr>rl",
"ms>ll",
"ms>rr",
"ms>rl",
"lr>l-r",
]
| Default
) = Default("lr>lr"),
slev: Double = Default("1"),
sbal: Double = Default("0"),
mlev: Double = Default("1"),
mpan: Double = Default("0"),
base: Double = Default("0"),
delay: Double = Default("0"),
sclevel: Double = Default("1"),
phase: Double = Default("0"),
bmode_in: (
Int
| Literal["balance", "amplitude", "power"]
| Default
) = Default("balance"),
bmode_out: (
Int
| Literal["balance", "amplitude", "power"]
| Default
) = Default("balance"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
This filter has some handy utilities to manage stereo signals, for converting M/S stereo recordings to L/R signal while having control over the parameters or spreading the stereo image of master track.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_in
|
Double
|
Set input level before filtering for both channels. Defaults is 1. Allowed range is from 0.015625 to 64. |
Default('1')
|
level_out
|
Double
|
Set output level after filtering for both channels. Defaults is 1. Allowed range is from 0.015625 to 64. |
Default('1')
|
balance_in
|
Double
|
Set input balance between both channels. Default is 0. Allowed range is from -1 to 1. |
Default('0')
|
balance_out
|
Double
|
Set output balance between both channels. Default is 0. Allowed range is from -1 to 1. |
Default('0')
|
softclip
|
Boolean
|
Enable softclipping. Results in analog distortion instead of harsh digital 0dB clipping. Disabled by default. |
Default('false')
|
mutel
|
Boolean
|
Mute the left channel. Disabled by default. |
Default('false')
|
muter
|
Boolean
|
Mute the right channel. Disabled by default. |
Default('false')
|
phasel
|
Boolean
|
Change the phase of the left channel. Disabled by default. |
Default('false')
|
phaser
|
Boolean
|
Change the phase of the right channel. Disabled by default. |
Default('false')
|
mode
|
Int | Literal['lr>lr', 'lr>ms', 'ms>lr', 'lr>ll', 'lr>rr', 'lr>l+r', 'lr>rl', 'ms>ll', 'ms>rr', 'ms>rl', 'lr>l-r'] | Default
|
Set stereo mode. Available values are: @end table |
Default('lr>lr')
|
slev
|
Double
|
Set level of side signal. Default is 1. Allowed range is from 0.015625 to 64. |
Default('1')
|
sbal
|
Double
|
Set balance of side signal. Default is 0. Allowed range is from -1 to 1. |
Default('0')
|
mlev
|
Double
|
Set level of the middle signal. Default is 1. Allowed range is from 0.015625 to 64. |
Default('1')
|
mpan
|
Double
|
Set middle signal pan. Default is 0. Allowed range is from -1 to 1. |
Default('0')
|
base
|
Double
|
Set stereo base between mono and inversed channels. Default is 0. Allowed range is from -1 to 1. |
Default('0')
|
delay
|
Double
|
Set delay in milliseconds how much to delay left from right channel and vice versa. Default is 0. Allowed range is from -20 to 20. |
Default('0')
|
sclevel
|
Double
|
Set S/C level. Default is 1. Allowed range is from 1 to 100. |
Default('1')
|
phase
|
Double
|
Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360. |
Default('0')
|
bmode_in
|
Int | Literal['balance', 'amplitude', 'power'] | Default
|
Set balance mode for balance_in/balance_out option. Can be one of the following: @end table |
Default('balance')
|
bmode_out
|
Int | Literal['balance', 'amplitude', 'power'] | Default
|
Set balance mode for balance_in/balance_out option. Can be one of the following: @end table |
Default('balance')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
stereowiden
¶
stereowiden(
*,
delay: Float = Default("20"),
feedback: Float = Default("0.3"),
crossfeed: Float = Default("0.3"),
drymix: Float = Default("0.8"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
This filter enhance the stereo effect by suppressing signal common to both channels and by delaying the signal of left into right and vice versa, thereby widening the stereo effect.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delay
|
Float
|
Time in milliseconds of the delay of left signal into right and vice versa. Default is 20 milliseconds. |
Default('20')
|
feedback
|
Float
|
Amount of gain in delayed signal into right and vice versa. Gives a delay effect of left signal in right output and vice versa which gives widening effect. Default is 0.3. |
Default('0.3')
|
crossfeed
|
Float
|
Cross feed of left into right with inverted phase. This helps in suppressing the mono. If the value is 1 it will cancel all the signal common to both channels. Default is 0.3. |
Default('0.3')
|
drymix
|
Float
|
Set level of input signal of original channel. Default is 0.8. |
Default('0.8')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
subtitle_stream
¶
subtitle_stream(
index: int | None = None, optional: bool = False
) -> SubtitleStream
Get the subtitle stream from the input node with a specified index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int | None
|
The index of the subtitle stream. |
None
|
optional
|
bool
|
Whether the subtitle stream is optional. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
SubtitleStream |
SubtitleStream
|
The subtitle stream from the input node. |
subtitles
¶
subtitles(
*,
filename: String = Default(None),
original_size: Image_size = Default(None),
fontsdir: String = Default(None),
alpha: Boolean = Default("false"),
charenc: String = Default(None),
stream_index: Int = Default("-1"),
force_style: String = Default(None),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Draw subtitles on top of input video using the libass library.
To enable compilation of this filter you need to configure FFmpeg with --enable-libass. This filter also requires a build with libavcodec and libavformat to convert the passed subtitles file to ASS (Advanced Substation Alpha) subtitles format.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
String
|
Set the filename of the subtitle file to read. It must be specified. |
Default(None)
|
original_size
|
Image_size
|
Specify the size of the original video, the video for which the ASS file was composed. For the syntax of this option, check the "Video size" section in the ffmpeg-utils manual. Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to correctly scale the fonts if the aspect ratio has been changed. |
Default(None)
|
fontsdir
|
String
|
Set a directory path containing fonts that can be used by the filter. These fonts will be used in addition to whatever the font provider uses. |
Default(None)
|
alpha
|
Boolean
|
Process alpha channel, by default alpha channel is untouched. |
Default('false')
|
charenc
|
String
|
Set subtitles input character encoding. subtitles filter only. Only useful if not UTF-8. |
Default(None)
|
stream_index
|
Int
|
Set subtitles stream index. subtitles filter only. |
Default('-1')
|
force_style
|
String
|
Override default style or script info parameters of the subtitles. It accepts a string containing ASS style format KEY=VALUE couples separated by ",". |
Default(None)
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
super2xsai
¶
super2xsai(
extra_options: dict[str, Any] | None = None,
) -> VideoStream
Scale the input by 2x and smooth using the Super2xSaI (Scale and Interpolate) pixel art scaling algorithm.
Useful for enlarging pixel art images without reducing sharpness.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
superequalizer
¶
superequalizer(
*,
_1b: Float = Default("1"),
_2b: Float = Default("1"),
_3b: Float = Default("1"),
_4b: Float = Default("1"),
_5b: Float = Default("1"),
_6b: Float = Default("1"),
_7b: Float = Default("1"),
_8b: Float = Default("1"),
_9b: Float = Default("1"),
_10b: Float = Default("1"),
_11b: Float = Default("1"),
_12b: Float = Default("1"),
_13b: Float = Default("1"),
_14b: Float = Default("1"),
_15b: Float = Default("1"),
_16b: Float = Default("1"),
_17b: Float = Default("1"),
_18b: Float = Default("1"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply 18 band equalizer.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
_1b
|
Float
|
Set 65Hz band gain. |
Default('1')
|
_2b
|
Float
|
Set 92Hz band gain. |
Default('1')
|
_3b
|
Float
|
Set 131Hz band gain. |
Default('1')
|
_4b
|
Float
|
Set 185Hz band gain. |
Default('1')
|
_5b
|
Float
|
Set 262Hz band gain. |
Default('1')
|
_6b
|
Float
|
Set 370Hz band gain. |
Default('1')
|
_7b
|
Float
|
Set 523Hz band gain. |
Default('1')
|
_8b
|
Float
|
Set 740Hz band gain. |
Default('1')
|
_9b
|
Float
|
Set 1047Hz band gain. |
Default('1')
|
_10b
|
Float
|
Set 1480Hz band gain. |
Default('1')
|
_11b
|
Float
|
Set 2093Hz band gain. |
Default('1')
|
_12b
|
Float
|
Set 2960Hz band gain. |
Default('1')
|
_13b
|
Float
|
Set 4186Hz band gain. |
Default('1')
|
_14b
|
Float
|
Set 5920Hz band gain. |
Default('1')
|
_15b
|
Float
|
Set 8372Hz band gain. |
Default('1')
|
_16b
|
Float
|
Set 11840Hz band gain. |
Default('1')
|
_17b
|
Float
|
Set 16744Hz band gain. |
Default('1')
|
_18b
|
Float
|
Set 20000Hz band gain. |
Default('1')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
surround
¶
surround(
*,
chl_out: String = Default("5.1"),
chl_in: String = Default("stereo"),
level_in: Float = Default("1"),
level_out: Float = Default("1"),
lfe: Boolean = Default("true"),
lfe_low: Int = Default("128"),
lfe_high: Int = Default("256"),
lfe_mode: (
Int | Literal["add", "sub"] | Default
) = Default("add"),
angle: Float = Default("90"),
fc_in: Float = Default("1"),
fc_out: Float = Default("1"),
fl_in: Float = Default("1"),
fl_out: Float = Default("1"),
fr_in: Float = Default("1"),
fr_out: Float = Default("1"),
sl_in: Float = Default("1"),
sl_out: Float = Default("1"),
sr_in: Float = Default("1"),
sr_out: Float = Default("1"),
bl_in: Float = Default("1"),
bl_out: Float = Default("1"),
br_in: Float = Default("1"),
br_out: Float = Default("1"),
bc_in: Float = Default("1"),
bc_out: Float = Default("1"),
lfe_in: Float = Default("1"),
lfe_out: Float = Default("1"),
allx: Float = Default("-1"),
ally: Float = Default("-1"),
fcx: Float = Default("0.5"),
flx: Float = Default("0.5"),
frx: Float = Default("0.5"),
blx: Float = Default("0.5"),
brx: Float = Default("0.5"),
slx: Float = Default("0.5"),
srx: Float = Default("0.5"),
bcx: Float = Default("0.5"),
fcy: Float = Default("0.5"),
fly: Float = Default("0.5"),
fry: Float = Default("0.5"),
bly: Float = Default("0.5"),
bry: Float = Default("0.5"),
sly: Float = Default("0.5"),
sry: Float = Default("0.5"),
bcy: Float = Default("0.5"),
win_size: Int = Default("4096"),
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",
]
| Default
) = Default("hann"),
overlap: Float = Default("0.5"),
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply audio surround upmix filter.
This filter allows to produce multichannel output from audio stream.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chl_out
|
String
|
Set output channel layout. By default, this is 5.1. See the Channel Layout section in the ffmpeg-utils(1) manual for the required syntax. |
Default('5.1')
|
chl_in
|
String
|
Set input channel layout. By default, this is stereo. See the Channel Layout section in the ffmpeg-utils(1) manual for the required syntax. |
Default('stereo')
|
level_in
|
Float
|
Set input volume level. By default, this is 1. |
Default('1')
|
level_out
|
Float
|
Set output volume level. By default, this is 1. |
Default('1')
|
lfe
|
Boolean
|
Enable LFE channel output if output channel layout has it. By default, this is enabled. |
Default('true')
|
lfe_low
|
Int
|
Set LFE low cut off frequency. By default, this is 128 Hz. |
Default('128')
|
lfe_high
|
Int
|
Set LFE high cut off frequency. By default, this is 256 Hz. |
Default('256')
|
lfe_mode
|
Int | Literal['add', 'sub'] | Default
|
Set LFE mode, can be add or sub. Default is add. In add mode, LFE channel is created from input audio and added to output. In sub mode, LFE channel is created from input audio and added to output but also all non-LFE output channels are subtracted with output LFE channel. |
Default('add')
|
angle
|
Float
|
Set angle of stereo surround transform, Allowed range is from 0 to 360. Default is 90. |
Default('90')
|
fc_in
|
Float
|
Set front center input volume. By default, this is 1. |
Default('1')
|
fc_out
|
Float
|
Set front center output volume. By default, this is 1. |
Default('1')
|
fl_in
|
Float
|
Set front left input volume. By default, this is 1. |
Default('1')
|
fl_out
|
Float
|
Set front left output volume. By default, this is 1. |
Default('1')
|
fr_in
|
Float
|
Set front right input volume. By default, this is 1. |
Default('1')
|
fr_out
|
Float
|
Set front right output volume. By default, this is 1. |
Default('1')
|
sl_in
|
Float
|
Set side left input volume. By default, this is 1. |
Default('1')
|
sl_out
|
Float
|
Set side left output volume. By default, this is 1. |
Default('1')
|
sr_in
|
Float
|
Set side right input volume. By default, this is 1. |
Default('1')
|
sr_out
|
Float
|
Set side right output volume. By default, this is 1. |
Default('1')
|
bl_in
|
Float
|
Set back left input volume. By default, this is 1. |
Default('1')
|
bl_out
|
Float
|
Set back left output volume. By default, this is 1. |
Default('1')
|
br_in
|
Float
|
Set back right input volume. By default, this is 1. |
Default('1')
|
br_out
|
Float
|
Set back right output volume. By default, this is 1. |
Default('1')
|
bc_in
|
Float
|
Set back center input volume. By default, this is 1. |
Default('1')
|
bc_out
|
Float
|
Set back center output volume. By default, this is 1. |
Default('1')
|
lfe_in
|
Float
|
Set LFE input volume. By default, this is 1. |
Default('1')
|
lfe_out
|
Float
|
Set LFE output volume. By default, this is 1. |
Default('1')
|
allx
|
Float
|
Set spread usage of stereo image across X axis for all channels. Allowed range is from -1 to 15. By default this value is negative -1, and thus unused. |
Default('-1')
|
ally
|
Float
|
Set spread usage of stereo image across Y axis for all channels. Allowed range is from -1 to 15. By default this value is negative -1, and thus unused. |
Default('-1')
|
fcx
|
Float
|
Set spread usage of stereo image across X axis for each channel. Allowed range is from 0.06 to 15. By default this value is 0.5. |
Default('0.5')
|
flx
|
Float
|
Set spread usage of stereo image across X axis for each channel. Allowed range is from 0.06 to 15. By default this value is 0.5. |
Default('0.5')
|
frx
|
Float
|
Set spread usage of stereo image across X axis for each channel. Allowed range is from 0.06 to 15. By default this value is 0.5. |
Default('0.5')
|
blx
|
Float
|
Set spread usage of stereo image across X axis for each channel. Allowed range is from 0.06 to 15. By default this value is 0.5. |
Default('0.5')
|
brx
|
Float
|
Set spread usage of stereo image across X axis for each channel. Allowed range is from 0.06 to 15. By default this value is 0.5. |
Default('0.5')
|
slx
|
Float
|
Set spread usage of stereo image across X axis for each channel. Allowed range is from 0.06 to 15. By default this value is 0.5. |
Default('0.5')
|
srx
|
Float
|
Set spread usage of stereo image across X axis for each channel. Allowed range is from 0.06 to 15. By default this value is 0.5. |
Default('0.5')
|
bcx
|
Float
|
Set spread usage of stereo image across X axis for each channel. Allowed range is from 0.06 to 15. By default this value is 0.5. |
Default('0.5')
|
fcy
|
Float
|
Set spread usage of stereo image across Y axis for each channel. Allowed range is from 0.06 to 15. By default this value is 0.5. |
Default('0.5')
|
fly
|
Float
|
Set spread usage of stereo image across Y axis for each channel. Allowed range is from 0.06 to 15. By default this value is 0.5. |
Default('0.5')
|
fry
|
Float
|
Set spread usage of stereo image across Y axis for each channel. Allowed range is from 0.06 to 15. By default this value is 0.5. |
Default('0.5')
|
bly
|
Float
|
Set spread usage of stereo image across Y axis for each channel. Allowed range is from 0.06 to 15. By default this value is 0.5. |
Default('0.5')
|
bry
|
Float
|
Set spread usage of stereo image across Y axis for each channel. Allowed range is from 0.06 to 15. By default this value is 0.5. |
Default('0.5')
|
sly
|
Float
|
Set spread usage of stereo image across Y axis for each channel. Allowed range is from 0.06 to 15. By default this value is 0.5. |
Default('0.5')
|
sry
|
Float
|
Set spread usage of stereo image across Y axis for each channel. Allowed range is from 0.06 to 15. By default this value is 0.5. |
Default('0.5')
|
bcy
|
Float
|
Set spread usage of stereo image across Y axis for each channel. Allowed range is from 0.06 to 15. By default this value is 0.5. |
Default('0.5')
|
win_size
|
Int
|
Set window size. Allowed range is from 1024 to 65536. Default size is 4096. |
Default('4096')
|
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'] | Default
|
Set window function. It accepts the following values: @end table Default is hann. |
Default('hann')
|
overlap
|
Float
|
Set window overlap. If set to 1, the recommended overlap for selected window function will be picked. Default is 0.5. |
Default('0.5')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
swaprect
¶
swaprect(
*,
w: String = Default("w/2"),
h: String = Default("h/2"),
x1: String = Default("w/2"),
y1: String = Default("h/2"),
x2: String = Default("0"),
y2: String = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Swap two rectangular objects in video.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
w
|
String
|
set rect width (default "w/2") |
Default('w/2')
|
h
|
String
|
The input width and height. |
Default('h/2')
|
x1
|
String
|
Set 1st rect x coordinate. |
Default('w/2')
|
y1
|
String
|
Set 1st rect y coordinate. |
Default('h/2')
|
x2
|
String
|
Set 2nd rect x coordinate. |
Default('0')
|
y2
|
String
|
Set 2nd rect y coordinate. All expressions are evaluated once for each frame. |
Default('0')
|
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
swapuv
¶
swapuv(
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None,
) -> VideoStream
Swap U & V plane.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
tblend
¶
tblend(
*,
c0_mode: (
Int
| Literal[
"addition",
"addition128",
"grainmerge",
"and",
"average",
"burn",
"darken",
"difference",
"difference128",
"grainextract",
"divide",
"dodge",
"exclusion",
"extremity",
"freeze",
"glow",
"hardlight",
"hardmix",
"heat",
"lighten",
"linearlight",
"multiply",
"multiply128",
"negation",
"normal",
"or",
"overlay",
"phoenix",
"pinlight",
"reflect",
"screen",
"softlight",
"subtract",
"vividlight",
"xor",
"softdifference",
"geometric",
"harmonic",
"bleach",
"stain",
"interpolate",
"hardoverlay",
]
| Default
) = Default("normal"),
c1_mode: (
Int
| Literal[
"addition",
"addition128",
"grainmerge",
"and",
"average",
"burn",
"darken",
"difference",
"difference128",
"grainextract",
"divide",
"dodge",
"exclusion",
"extremity",
"freeze",
"glow",
"hardlight",
"hardmix",
"heat",
"lighten",
"linearlight",
"multiply",
"multiply128",
"negation",
"normal",
"or",
"overlay",
"phoenix",
"pinlight",
"reflect",
"screen",
"softlight",
"subtract",
"vividlight",
"xor",
"softdifference",
"geometric",
"harmonic",
"bleach",
"stain",
"interpolate",
"hardoverlay",
]
| Default
) = Default("normal"),
c2_mode: (
Int
| Literal[
"addition",
"addition128",
"grainmerge",
"and",
"average",
"burn",
"darken",
"difference",
"difference128",
"grainextract",
"divide",
"dodge",
"exclusion",
"extremity",
"freeze",
"glow",
"hardlight",
"hardmix",
"heat",
"lighten",
"linearlight",
"multiply",
"multiply128",
"negation",
"normal",
"or",
"overlay",
"phoenix",
"pinlight",
"reflect",
"screen",
"softlight",
"subtract",
"vividlight",
"xor",
"softdifference",
"geometric",
"harmonic",
"bleach",
"stain",
"interpolate",
"hardoverlay",
]
| Default
) = Default("normal"),
c3_mode: (
Int
| Literal[
"addition",
"addition128",
"grainmerge",
"and",
"average",
"burn",
"darken",
"difference",
"difference128",
"grainextract",
"divide",
"dodge",
"exclusion",
"extremity",
"freeze",
"glow",
"hardlight",
"hardmix",
"heat",
"lighten",
"linearlight",
"multiply",
"multiply128",
"negation",
"normal",
"or",
"overlay",
"phoenix",
"pinlight",
"reflect",
"screen",
"softlight",
"subtract",
"vividlight",
"xor",
"softdifference",
"geometric",
"harmonic",
"bleach",
"stain",
"interpolate",
"hardoverlay",
]
| Default
) = Default("normal"),
all_mode: (
Int
| Literal[
"addition",
"addition128",
"grainmerge",
"and",
"average",
"burn",
"darken",
"difference",
"difference128",
"grainextract",
"divide",
"dodge",
"exclusion",
"extremity",
"freeze",
"glow",
"hardlight",
"hardmix",
"heat",
"lighten",
"linearlight",
"multiply",
"multiply128",
"negation",
"normal",
"or",
"overlay",
"phoenix",
"pinlight",
"reflect",
"screen",
"softlight",
"subtract",
"vividlight",
"xor",
"softdifference",
"geometric",
"harmonic",
"bleach",
"stain",
"interpolate",
"hardoverlay",
]
| Default
) = Default("-1"),
c0_expr: String = Default(None),
c1_expr: String = Default(None),
c2_expr: String = Default(None),
c3_expr: String = Default(None),
all_expr: String = Default(None),
c0_opacity: Double = Default("1"),
c1_opacity: Double = Default("1"),
c2_opacity: Double = Default("1"),
c3_opacity: Double = Default("1"),
all_opacity: Double = Default("1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Blend successive video frames.
See blend
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
c0_mode
|
Int | Literal['addition', 'addition128', 'grainmerge', 'and', 'average', 'burn', 'darken', 'difference', 'difference128', 'grainextract', 'divide', 'dodge', 'exclusion', 'extremity', 'freeze', 'glow', 'hardlight', 'hardmix', 'heat', 'lighten', 'linearlight', 'multiply', 'multiply128', 'negation', 'normal', 'or', 'overlay', 'phoenix', 'pinlight', 'reflect', 'screen', 'softlight', 'subtract', 'vividlight', 'xor', 'softdifference', 'geometric', 'harmonic', 'bleach', 'stain', 'interpolate', 'hardoverlay'] | Default
|
set component #0 blend mode (from 0 to 39) (default normal) |
Default('normal')
|
c1_mode
|
Int | Literal['addition', 'addition128', 'grainmerge', 'and', 'average', 'burn', 'darken', 'difference', 'difference128', 'grainextract', 'divide', 'dodge', 'exclusion', 'extremity', 'freeze', 'glow', 'hardlight', 'hardmix', 'heat', 'lighten', 'linearlight', 'multiply', 'multiply128', 'negation', 'normal', 'or', 'overlay', 'phoenix', 'pinlight', 'reflect', 'screen', 'softlight', 'subtract', 'vividlight', 'xor', 'softdifference', 'geometric', 'harmonic', 'bleach', 'stain', 'interpolate', 'hardoverlay'] | Default
|
set component #1 blend mode (from 0 to 39) (default normal) |
Default('normal')
|
c2_mode
|
Int | Literal['addition', 'addition128', 'grainmerge', 'and', 'average', 'burn', 'darken', 'difference', 'difference128', 'grainextract', 'divide', 'dodge', 'exclusion', 'extremity', 'freeze', 'glow', 'hardlight', 'hardmix', 'heat', 'lighten', 'linearlight', 'multiply', 'multiply128', 'negation', 'normal', 'or', 'overlay', 'phoenix', 'pinlight', 'reflect', 'screen', 'softlight', 'subtract', 'vividlight', 'xor', 'softdifference', 'geometric', 'harmonic', 'bleach', 'stain', 'interpolate', 'hardoverlay'] | Default
|
set component #2 blend mode (from 0 to 39) (default normal) |
Default('normal')
|
c3_mode
|
Int | Literal['addition', 'addition128', 'grainmerge', 'and', 'average', 'burn', 'darken', 'difference', 'difference128', 'grainextract', 'divide', 'dodge', 'exclusion', 'extremity', 'freeze', 'glow', 'hardlight', 'hardmix', 'heat', 'lighten', 'linearlight', 'multiply', 'multiply128', 'negation', 'normal', 'or', 'overlay', 'phoenix', 'pinlight', 'reflect', 'screen', 'softlight', 'subtract', 'vividlight', 'xor', 'softdifference', 'geometric', 'harmonic', 'bleach', 'stain', 'interpolate', 'hardoverlay'] | Default
|
set component #3 blend mode (from 0 to 39) (default normal) |
Default('normal')
|
all_mode
|
Int | Literal['addition', 'addition128', 'grainmerge', 'and', 'average', 'burn', 'darken', 'difference', 'difference128', 'grainextract', 'divide', 'dodge', 'exclusion', 'extremity', 'freeze', 'glow', 'hardlight', 'hardmix', 'heat', 'lighten', 'linearlight', 'multiply', 'multiply128', 'negation', 'normal', 'or', 'overlay', 'phoenix', 'pinlight', 'reflect', 'screen', 'softlight', 'subtract', 'vividlight', 'xor', 'softdifference', 'geometric', 'harmonic', 'bleach', 'stain', 'interpolate', 'hardoverlay'] | Default
|
set blend mode for all components (from -1 to 39) (default -1) |
Default('-1')
|
c0_expr
|
String
|
set color component #0 expression |
Default(None)
|
c1_expr
|
String
|
set color component #1 expression |
Default(None)
|
c2_expr
|
String
|
set color component #2 expression |
Default(None)
|
c3_expr
|
String
|
set color component #3 expression |
Default(None)
|
all_expr
|
String
|
set expression for all color components |
Default(None)
|
c0_opacity
|
Double
|
set color component #0 opacity (from 0 to 1) (default 1) |
Default('1')
|
c1_opacity
|
Double
|
set color component #1 opacity (from 0 to 1) (default 1) |
Default('1')
|
c2_opacity
|
Double
|
set color component #2 opacity (from 0 to 1) (default 1) |
Default('1')
|
c3_opacity
|
Double
|
set color component #3 opacity (from 0 to 1) (default 1) |
Default('1')
|
all_opacity
|
Double
|
set opacity for all color components (from 0 to 1) (default 1) |
Default('1')
|
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
telecine
¶
telecine(
*,
first_field: (
Int | Literal["top", "t", "bottom", "b"] | Default
) = Default("top"),
pattern: String = Default("23"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply telecine process to the video.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
first_field
|
Int | Literal['top', 't', 'bottom', 'b'] | Default
|
@end table |
Default('top')
|
pattern
|
String
|
A string of numbers representing the pulldown pattern you wish to apply. The default value is 23. |
Default('23')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
thistogram
¶
thistogram(
*,
width: Int = Default("0"),
display_mode: (
Int
| Literal["overlay", "parade", "stack"]
| Default
) = Default("stack"),
levels_mode: (
Int | Literal["linear", "logarithmic"] | Default
) = Default("linear"),
components: Int = Default("7"),
bgopacity: Float = Default("0.9"),
envelope: Boolean = Default("false"),
ecolor: Color = Default("gold"),
slide: (
Int
| Literal[
"frame",
"replace",
"scroll",
"rscroll",
"picture",
]
| Default
) = Default("replace"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Compute and draw a color distribution histogram for the input video across time.
Unlike histogram video filter which only shows histogram of single input frame at certain time, this filter shows also past histograms of number of frames defined by width option.
The computed histogram is a representation of the color component distribution in an image.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
Int
|
Set width of single color component output. Default value is 0. Value of 0 means width will be picked from input video. This also set number of passed histograms to keep. Allowed range is [0, 8192]. |
Default('0')
|
display_mode
|
Int | Literal['overlay', 'parade', 'stack'] | Default
|
Set display mode. It accepts the following values: @end table Default is stack. |
Default('stack')
|
levels_mode
|
Int | Literal['linear', 'logarithmic'] | Default
|
Set mode. Can be either linear, or logarithmic. Default is linear. |
Default('linear')
|
components
|
Int
|
Set what color components to display. Default is 7. |
Default('7')
|
bgopacity
|
Float
|
Set background opacity. Default is 0.9. |
Default('0.9')
|
envelope
|
Boolean
|
Show envelope. Default is disabled. |
Default('false')
|
ecolor
|
Color
|
Set envelope color. Default is gold. |
Default('gold')
|
slide
|
Int | Literal['frame', 'replace', 'scroll', 'rscroll', 'picture'] | Default
|
Set slide mode. Available values for slide is: @end table Default is replace. |
Default('replace')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
threshold
¶
threshold(
_threshold: VideoStream,
_min: VideoStream,
_max: VideoStream,
*,
planes: Int = Default("15"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply threshold effect to video stream.
This filter needs four video streams to perform thresholding. First stream is stream we are filtering. Second stream is holding threshold values, third stream is holding min values, and last, fourth stream is holding max values.
The filter accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planes
|
Int
|
Set which planes will be processed, unprocessed planes will be copied. By default value 0xf, all planes will be processed. |
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
thumbnail
¶
thumbnail(
*,
n: Int = Default("100"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Select the most representative frame in a given sequence of consecutive frames.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Int
|
Set the frames batch size to analyze; in a set of n frames, the filter will pick one of them, and then handle the next batch of n frames until the end. Default is 100. |
Default('100')
|
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
tile
¶
tile(
*,
layout: Image_size = Default("6x5"),
nb_frames: Int = Default("0"),
margin: Int = Default("0"),
padding: Int = Default("0"),
color: Color = Default("black"),
overlap: Int = Default("0"),
init_padding: Int = Default("0"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Tile several successive frames together.
The untile filter can do the reverse.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layout
|
Image_size
|
Set the grid size in the form COLUMNSxROWS. Range is upto UINT_MAX cells. Default is 6x5. |
Default('6x5')
|
nb_frames
|
Int
|
Set the maximum number of frames to render in the given area. It must be less than or equal to wxh. The default value is 0, meaning all the area will be used. |
Default('0')
|
margin
|
Int
|
Set the outer border margin in pixels. Range is 0 to 1024. Default is 0. |
Default('0')
|
padding
|
Int
|
Set the inner border thickness (i.e. the number of pixels between frames). For more advanced padding options (such as having different values for the edges), refer to the pad video filter. Range is 0 to 1024. Default is 0. |
Default('0')
|
color
|
Color
|
Specify the color of the unused area. For the syntax of this option, check the "Color" section in the ffmpeg-utils manual. The default value of color is "black". |
Default('black')
|
overlap
|
Int
|
Set the number of frames to overlap when tiling several successive frames together. The value must be between 0 and nb_frames - 1. Default is 0. |
Default('0')
|
init_padding
|
Int
|
Set the number of frames to initially be empty before displaying first output frame. This controls how soon will one get first output frame. The value must be between 0 and nb_frames - 1. Default is 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
tiltshelf
¶
tiltshelf(
*,
frequency: Double = Default("3000"),
width_type: (
Int | Literal["h", "q", "o", "s", "k"] | Default
) = Default("q"),
width: Double = Default("0.5"),
gain: Double = Default("0"),
poles: Int = Default("2"),
mix: Double = Default("1"),
channels: String = Default("all"),
normalize: Boolean = Default("false"),
transform: (
Int
| Literal[
"di", "dii", "tdi", "tdii", "latt", "svf", "zdf"
]
| Default
) = Default("di"),
precision: (
Int
| Literal["auto", "s16", "s32", "f32", "f64"]
| Default
) = Default("auto"),
blocksize: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Boost or cut the lower frequencies and cut or boost higher frequencies of the audio using a two-pole shelving filter with a response similar to that of a standard hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequency
|
Double
|
Set the filter's central frequency and so can be used to extend or reduce the frequency range to be boosted or cut. The default value is 3000 Hz. |
Default('3000')
|
width_type
|
Int | Literal['h', 'q', 'o', 's', 'k'] | Default
|
Set method to specify band-width of filter. @end table |
Default('q')
|
width
|
Double
|
Determine how steep is the filter's shelf transition. |
Default('0.5')
|
gain
|
Double
|
Give the gain at 0 Hz. Its useful range is about -20 (for a large cut) to +20 (for a large boost). Beware of clipping when using a positive gain. |
Default('0')
|
poles
|
Int
|
Set number of poles. Default is 2. |
Default('2')
|
mix
|
Double
|
How much to use filtered signal in output. Default is 1. Range is between 0 and 1. |
Default('1')
|
channels
|
String
|
Specify which channels to filter, by default all available are filtered. |
Default('all')
|
normalize
|
Boolean
|
Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. |
Default('false')
|
transform
|
Int | Literal['di', 'dii', 'tdi', 'tdii', 'latt', 'svf', 'zdf'] | Default
|
Set transform type of IIR filter. @end table |
Default('di')
|
precision
|
Int | Literal['auto', 's16', 's32', 'f32', 'f64'] | Default
|
Set precison of filtering. @end table |
Default('auto')
|
blocksize
|
Int
|
set the block size (from 0 to 32768) (default 0) |
Default('0')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
tinterlace
¶
tinterlace(
*,
mode: (
Int
| Literal[
"merge",
"drop_even",
"drop_odd",
"pad",
"interleave_top",
"interleave_bottom",
"interlacex2",
"mergex2",
]
| Default
) = Default("merge"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Perform various types of temporal field interlacing.
Frames are counted starting from 1, so the first input frame is considered odd.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Int | Literal['merge', 'drop_even', 'drop_odd', 'pad', 'interleave_top', 'interleave_bottom', 'interlacex2', 'mergex2'] | Default
|
Specify the mode of the interlacing. This option can also be specified as a value alone. See below for a list of values for this option. Available values are: @end table Numeric values are deprecated but are accepted for backward compatibility reasons. Default mode is merge. |
Default('merge')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
tlut2
¶
tlut2(
*,
c0: String = Default("x"),
c1: String = Default("x"),
c2: String = Default("x"),
c3: String = Default("x"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
The lut2 filter takes two input streams and outputs one stream.
The tlut2 (time lut2) filter takes two consecutive frames from one single stream.
This filter accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
c0
|
String
|
set first pixel component expression |
Default('x')
|
c1
|
String
|
set second pixel component expression |
Default('x')
|
c2
|
String
|
set third pixel component expression |
Default('x')
|
c3
|
String
|
set fourth pixel component expression, corresponds to the alpha component |
Default('x')
|
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
tmedian
¶
tmedian(
*,
radius: Int = Default("1"),
planes: Int = Default("15"),
percentile: Float = Default("0.5"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Pick median pixels from several successive input video frames.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radius
|
Int
|
Set radius of median filter. Default is 1. Allowed range is from 1 to 127. |
Default('1')
|
planes
|
Int
|
Set which planes to filter. Default value is 15, by which all planes are processed. |
Default('15')
|
percentile
|
Float
|
Set median percentile. Default value is 0.5. Default value of 0.5 will pick always median values, while 0 will pick minimum values, and 1 maximum values. |
Default('0.5')
|
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
tmidequalizer
¶
tmidequalizer(
*,
radius: Int = Default("5"),
sigma: Float = Default("0.5"),
planes: Int = Default("15"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply Temporal Midway Video Equalization effect.
Midway Video Equalization adjusts a sequence of video frames to have the same histograms, while maintaining their dynamics as much as possible. It's useful for e.g. matching exposures from a video frames sequence.
This filter accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radius
|
Int
|
Set filtering radius. Default is 5. Allowed range is from 1 to 127. |
Default('5')
|
sigma
|
Float
|
Set filtering sigma. Default is 0.5. This controls strength of filtering. Setting this option to 0 effectively does nothing. |
Default('0.5')
|
planes
|
Int
|
Set which planes to process. Default is 15, which is all available planes. |
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
tmix
¶
tmix(
*,
frames: Int = Default("3"),
weights: String = Default("1 1 1"),
scale: Float = Default("0"),
planes: Flags = Default("F"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Mix successive video frames.
A description of the accepted options follows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frames
|
Int
|
The number of successive frames to mix. If unspecified, it defaults to 3. |
Default('3')
|
weights
|
String
|
set weight for each frame (default "1 1 1") |
Default('1 1 1')
|
scale
|
Float
|
set scale (from 0 to 32767) (default 0) |
Default('0')
|
planes
|
Flags
|
Syntax is same as option with same name. |
Default('F')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
tonemap
¶
tonemap(
*,
tonemap: (
Int
| Literal[
"none",
"linear",
"gamma",
"clip",
"reinhard",
"hable",
"mobius",
]
| Default
) = Default("none"),
param: Double = Default("nan"),
desat: Double = Default("2"),
peak: Double = Default("0"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Tone map colors from different dynamic ranges.
This filter expects data in single precision floating point, as it needs to operate on (and can output) out-of-range values. Another filter, such as zscale, is needed to convert the resulting frame to a usable format.
The tonemapping algorithms implemented only work on linear light, so input data should be linearized beforehand (and possibly correctly tagged).
@example ffmpeg -i INPUT -vf zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p OUTPUT @end example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tonemap
|
Int | Literal['none', 'linear', 'gamma', 'clip', 'reinhard', 'hable', 'mobius'] | Default
|
Set the tone map algorithm to use. Possible values are: @end table Default is none. |
Default('none')
|
param
|
Double
|
Tune the tone mapping algorithm. This affects the following algorithms: @end table |
Default('nan')
|
desat
|
Double
|
Apply desaturation for highlights that exceed this level of brightness. The higher the parameter, the more color information will be preserved. This setting helps prevent unnaturally blown-out colors for super-highlights, by (smoothly) turning into white instead. This makes images feel more natural, at the cost of reducing information about out-of-range colors. The default of 2.0 is somewhat conservative and will mostly just apply to skies or directly sunlit surfaces. A setting of 0.0 disables this option. This option works only if the input frame has a supported color tag. |
Default('2')
|
peak
|
Double
|
Override signal/nominal/reference peak with this value. Useful when the embedded peak information in display metadata is not reliable or when tone mapping from a lower range to a higher range. |
Default('0')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
tpad
¶
tpad(
*,
start: Int = Default("0"),
stop: Int = Default("0"),
start_mode: (
Int | Literal["add", "clone"] | Default
) = Default("add"),
stop_mode: (
Int | Literal["add", "clone"] | Default
) = Default("add"),
start_duration: Duration = Default("0"),
stop_duration: Duration = Default("0"),
color: Color = Default("black"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Temporarily pad video frames.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start
|
Int
|
Specify number of delay frames before input video stream. Default is 0. |
Default('0')
|
stop
|
Int
|
Specify number of padding frames after input video stream. Set to -1 to pad indefinitely. Default is 0. |
Default('0')
|
start_mode
|
Int | Literal['add', 'clone'] | Default
|
Set kind of frames added to beginning of stream. Can be either add or clone. With add frames of solid-color are added. With clone frames are clones of first frame. Default is add. |
Default('add')
|
stop_mode
|
Int | Literal['add', 'clone'] | Default
|
Set kind of frames added to end of stream. Can be either add or clone. With add frames of solid-color are added. With clone frames are clones of last frame. Default is add. |
Default('add')
|
start_duration
|
Duration
|
Specify the duration of the start/stop delay. See the Time duration section in the ffmpeg-utils(1) manual for the accepted syntax. These options override start and stop. Default is 0. |
Default('0')
|
stop_duration
|
Duration
|
Specify the duration of the start/stop delay. See the Time duration section in the ffmpeg-utils(1) manual for the accepted syntax. These options override start and stop. Default is 0. |
Default('0')
|
color
|
Color
|
Specify the color of the padded area. For the syntax of this option, check the "Color" section in the ffmpeg-utils manual. The default value of color is "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
transpose
¶
transpose(
*,
dir: (
Int
| Literal[
"cclock_flip", "clock", "cclock", "clock_flip"
]
| Default
) = Default("cclock_flip"),
passthrough: (
Int
| Literal["none", "portrait", "landscape"]
| Default
) = Default("none"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Transpose rows with columns in the input video and optionally flip it.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dir
|
Int | Literal['cclock_flip', 'clock', 'cclock', 'clock_flip'] | Default
|
Specify the transposition direction. Can assume the following values: @end table For values between 4-7, the transposition is only done if the input video geometry is portrait and not landscape. These values are deprecated, the passthrough option should be used instead. Numerical values are deprecated, and should be dropped in favor of symbolic constants. |
Default('cclock_flip')
|
passthrough
|
Int | Literal['none', 'portrait', 'landscape'] | Default
|
Do not apply the transposition if the input geometry matches the one specified by the specified value. It accepts the following values: @end table Default value is 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
treble
¶
treble(
*,
frequency: Double = Default("3000"),
width_type: (
Int | Literal["h", "q", "o", "s", "k"] | Default
) = Default("q"),
width: Double = Default("0.5"),
gain: Double = Default("0"),
poles: Int = Default("2"),
mix: Double = Default("1"),
channels: String = Default("all"),
normalize: Boolean = Default("false"),
transform: (
Int
| Literal[
"di", "dii", "tdi", "tdii", "latt", "svf", "zdf"
]
| Default
) = Default("di"),
precision: (
Int
| Literal["auto", "s16", "s32", "f32", "f64"]
| Default
) = Default("auto"),
blocksize: Int = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Boost or cut treble (upper) frequencies of the audio using a two-pole shelving filter with a response similar to that of a standard hi-fi's tone-controls. This is also known as shelving equalisation (EQ).
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequency
|
Double
|
Change treble frequency. Syntax for the command is : "frequency" |
Default('3000')
|
width_type
|
Int | Literal['h', 'q', 'o', 's', 'k'] | Default
|
Change treble width_type. Syntax for the command is : "width_type" |
Default('q')
|
width
|
Double
|
Change treble width. Syntax for the command is : "width" |
Default('0.5')
|
gain
|
Double
|
Change treble gain. Syntax for the command is : "gain" |
Default('0')
|
poles
|
Int
|
Set number of poles. Default is 2. |
Default('2')
|
mix
|
Double
|
Change treble mix. Syntax for the command is : "mix" |
Default('1')
|
channels
|
String
|
Specify which channels to filter, by default all available are filtered. |
Default('all')
|
normalize
|
Boolean
|
Normalize biquad coefficients, by default is disabled. Enabling it will normalize magnitude response at DC to 0dB. |
Default('false')
|
transform
|
Int | Literal['di', 'dii', 'tdi', 'tdii', 'latt', 'svf', 'zdf'] | Default
|
Set transform type of IIR filter. @end table |
Default('di')
|
precision
|
Int | Literal['auto', 's16', 's32', 'f32', 'f64'] | Default
|
Set precison of filtering. @end table |
Default('auto')
|
blocksize
|
Int
|
set the block size (from 0 to 32768) (default 0) |
Default('0')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
tremolo
¶
tremolo(
*,
f: Double = Default("5"),
d: Double = Default("0.5"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Sinusoidal amplitude modulation.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f
|
Double
|
Modulation frequency in Hertz. Modulation frequencies in the subharmonic range (20 Hz or lower) will result in a tremolo effect. This filter may also be used as a ring modulator by specifying a modulation frequency higher than 20 Hz. Range is 0.1 - 20000.0. Default value is 5.0 Hz. |
Default('5')
|
d
|
Double
|
Depth of modulation as a percentage. Range is 0.0 - 1.0. Default value is 0.5. |
Default('0.5')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
trim
¶
trim(
*,
start: Duration = Default("INT64_MAX"),
end: Duration = Default("INT64_MAX"),
start_pts: Int64 = Default("I64_MIN"),
end_pts: Int64 = Default("I64_MIN"),
duration: Duration = Default("0"),
start_frame: Int64 = Default("-1"),
end_frame: Int64 = Default("I64_MAX"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Trim the input so that the output contains one continuous subpart of the input.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start
|
Duration
|
Specify the time of the start of the kept section, i.e. the frame with the timestamp start will be the first frame in the output. |
Default('INT64_MAX')
|
end
|
Duration
|
Specify the time of the first frame that will be dropped, i.e. the frame immediately preceding the one with the timestamp end will be the last frame in the output. |
Default('INT64_MAX')
|
start_pts
|
Int64
|
This is the same as start, except this option sets the start timestamp in timebase units instead of seconds. |
Default('I64_MIN')
|
end_pts
|
Int64
|
This is the same as end, except this option sets the end timestamp in timebase units instead of seconds. |
Default('I64_MIN')
|
duration
|
Duration
|
The maximum duration of the output in seconds. |
Default('0')
|
start_frame
|
Int64
|
The number of the first frame that should be passed to the output. |
Default('-1')
|
end_frame
|
Int64
|
The number of the first frame that should be dropped. |
Default('I64_MAX')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
unsharp
¶
unsharp(
*,
luma_msize_x: Int = Default("5"),
luma_msize_y: Int = Default("5"),
luma_amount: Float = Default("1"),
chroma_msize_x: Int = Default("5"),
chroma_msize_y: Int = Default("5"),
chroma_amount: Float = Default("0"),
alpha_msize_x: Int = Default("5"),
alpha_msize_y: Int = Default("5"),
alpha_amount: Float = Default("0"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Sharpen or blur the input video.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
luma_msize_x
|
Int
|
Set the luma matrix horizontal size. It must be an odd integer between 3 and 23. The default value is 5. |
Default('5')
|
luma_msize_y
|
Int
|
Set the luma matrix vertical size. It must be an odd integer between 3 and 23. The default value is 5. |
Default('5')
|
luma_amount
|
Float
|
Set the luma effect strength. It must be a floating point number, reasonable values lay between -1.5 and 1.5. Negative values will blur the input video, while positive values will sharpen it, a value of zero will disable the effect. Default value is 1.0. |
Default('1')
|
chroma_msize_x
|
Int
|
Set the chroma matrix horizontal size. It must be an odd integer between 3 and 23. The default value is 5. |
Default('5')
|
chroma_msize_y
|
Int
|
Set the chroma matrix vertical size. It must be an odd integer between 3 and 23. The default value is 5. |
Default('5')
|
chroma_amount
|
Float
|
Set the chroma effect strength. It must be a floating point number, reasonable values lay between -1.5 and 1.5. Negative values will blur the input video, while positive values will sharpen it, a value of zero will disable the effect. Default value is 0.0. |
Default('0')
|
alpha_msize_x
|
Int
|
Set the alpha matrix horizontal size. It must be an odd integer between 3 and 23. The default value is 5. |
Default('5')
|
alpha_msize_y
|
Int
|
Set the alpha matrix vertical size. It must be an odd integer between 3 and 23. The default value is 5. |
Default('5')
|
alpha_amount
|
Float
|
Set the alpha effect strength. It must be a floating point number, reasonable values lay between -1.5 and 1.5. Negative values will blur the input video, while positive values will sharpen it, a value of zero will disable the effect. Default value is 0.0. |
Default('0')
|
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
untile
¶
untile(
*,
layout: Image_size = Default("6x5"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Decompose a video made of tiled images into the individual images.
The frame rate of the output video is the frame rate of the input video multiplied by the number of tiles.
This filter does the reverse of tile.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layout
|
Image_size
|
Set the grid size (i.e. the number of lines and columns). For the syntax of this option, check the "Video size" section in the ffmpeg-utils manual. |
Default('6x5')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
v360
¶
v360(
*,
input: (
Int
| Literal[
"e",
"equirect",
"c3x2",
"c6x1",
"eac",
"dfisheye",
"flat",
"rectilinear",
"gnomonic",
"barrel",
"fb",
"c1x6",
"sg",
"mercator",
"ball",
"hammer",
"sinusoidal",
"fisheye",
"pannini",
"cylindrical",
"tetrahedron",
"barrelsplit",
"tsp",
"hequirect",
"he",
"equisolid",
"og",
"octahedron",
"cylindricalea",
]
| Default
) = Default("e"),
output: (
Int
| Literal[
"e",
"equirect",
"c3x2",
"c6x1",
"eac",
"dfisheye",
"flat",
"rectilinear",
"gnomonic",
"barrel",
"fb",
"c1x6",
"sg",
"mercator",
"ball",
"hammer",
"sinusoidal",
"fisheye",
"pannini",
"cylindrical",
"perspective",
"tetrahedron",
"barrelsplit",
"tsp",
"hequirect",
"he",
"equisolid",
"og",
"octahedron",
"cylindricalea",
]
| Default
) = Default("c3x2"),
interp: (
Int
| Literal[
"near",
"nearest",
"line",
"linear",
"lagrange9",
"cube",
"cubic",
"lanc",
"lanczos",
"sp16",
"spline16",
"gauss",
"gaussian",
"mitchell",
]
| Default
) = Default("line"),
w: Int = Default("0"),
h: Int = Default("0"),
in_stereo: (
Int | Literal["2d", "sbs", "tb"] | Default
) = Default("2d"),
out_stereo: (
Int | Literal["2d", "sbs", "tb"] | Default
) = Default("2d"),
in_forder: String = Default("rludfb"),
out_forder: String = Default("rludfb"),
in_frot: String = Default("000000"),
out_frot: String = Default("000000"),
in_pad: Float = Default("0"),
out_pad: Float = Default("0"),
fin_pad: Int = Default("0"),
fout_pad: Int = Default("0"),
yaw: Float = Default("0"),
pitch: Float = Default("0"),
roll: Float = Default("0"),
rorder: String = Default("ypr"),
h_fov: Float = Default("0"),
v_fov: Float = Default("0"),
d_fov: Float = Default("0"),
h_flip: Boolean = Default("false"),
v_flip: Boolean = Default("false"),
d_flip: Boolean = Default("false"),
ih_flip: Boolean = Default("false"),
iv_flip: Boolean = Default("false"),
in_trans: Boolean = Default("false"),
out_trans: Boolean = Default("false"),
ih_fov: Float = Default("0"),
iv_fov: Float = Default("0"),
id_fov: Float = Default("0"),
h_offset: Float = Default("0"),
v_offset: Float = Default("0"),
alpha_mask: Boolean = Default("false"),
reset_rot: Boolean = Default("false"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Convert 360 videos between various formats.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
Int | Literal['e', 'equirect', 'c3x2', 'c6x1', 'eac', 'dfisheye', 'flat', 'rectilinear', 'gnomonic', 'barrel', 'fb', 'c1x6', 'sg', 'mercator', 'ball', 'hammer', 'sinusoidal', 'fisheye', 'pannini', 'cylindrical', 'tetrahedron', 'barrelsplit', 'tsp', 'hequirect', 'he', 'equisolid', 'og', 'octahedron', 'cylindricalea'] | Default
|
set input projection (from 0 to 24) (default e) |
Default('e')
|
output
|
Int | Literal['e', 'equirect', 'c3x2', 'c6x1', 'eac', 'dfisheye', 'flat', 'rectilinear', 'gnomonic', 'barrel', 'fb', 'c1x6', 'sg', 'mercator', 'ball', 'hammer', 'sinusoidal', 'fisheye', 'pannini', 'cylindrical', 'perspective', 'tetrahedron', 'barrelsplit', 'tsp', 'hequirect', 'he', 'equisolid', 'og', 'octahedron', 'cylindricalea'] | Default
|
Set format of the input/output video. Available formats: @end table |
Default('c3x2')
|
interp
|
Int | Literal['near', 'nearest', 'line', 'linear', 'lagrange9', 'cube', 'cubic', 'lanc', 'lanczos', 'sp16', 'spline16', 'gauss', 'gaussian', 'mitchell'] | Default
|
Set interpolation method.@* Note: more complex interpolation methods require much more memory to run. Available methods: @end table Default value is line. |
Default('line')
|
w
|
Int
|
output width (from 0 to 32767) (default 0) |
Default('0')
|
h
|
Int
|
Set the output video resolution. Default resolution depends on formats. |
Default('0')
|
in_stereo
|
Int | Literal['2d', 'sbs', 'tb'] | Default
|
input stereo format (from 0 to 2) (default 2d) |
Default('2d')
|
out_stereo
|
Int | Literal['2d', 'sbs', 'tb'] | Default
|
Set the input/output stereo format. @end table Default value is 2d for input and output format. |
Default('2d')
|
in_forder
|
String
|
input cubemap face order (default "rludfb") |
Default('rludfb')
|
out_forder
|
String
|
output cubemap face order (default "rludfb") |
Default('rludfb')
|
in_frot
|
String
|
input cubemap face rotation (default "000000") |
Default('000000')
|
out_frot
|
String
|
output cubemap face rotation (default "000000") |
Default('000000')
|
in_pad
|
Float
|
percent input cubemap pads (from 0 to 0.1) (default 0) |
Default('0')
|
out_pad
|
Float
|
percent output cubemap pads (from 0 to 0.1) (default 0) |
Default('0')
|
fin_pad
|
Int
|
fixed input cubemap pads (from 0 to 100) (default 0) |
Default('0')
|
fout_pad
|
Int
|
fixed output cubemap pads (from 0 to 100) (default 0) |
Default('0')
|
yaw
|
Float
|
yaw rotation (from -180 to 180) (default 0) |
Default('0')
|
pitch
|
Float
|
pitch rotation (from -180 to 180) (default 0) |
Default('0')
|
roll
|
Float
|
Set rotation for the output video. Values in degrees. |
Default('0')
|
rorder
|
String
|
Set rotation order for the output video. Choose one item for each position. @end table Default value is ypr. |
Default('ypr')
|
h_fov
|
Float
|
output horizontal field of view (from 0 to 360) (default 0) |
Default('0')
|
v_fov
|
Float
|
output vertical field of view (from 0 to 360) (default 0) |
Default('0')
|
d_fov
|
Float
|
output diagonal field of view (from 0 to 360) (default 0) |
Default('0')
|
h_flip
|
Boolean
|
flip out video horizontally (default false) |
Default('false')
|
v_flip
|
Boolean
|
flip out video vertically (default false) |
Default('false')
|
d_flip
|
Boolean
|
Flip the output video horizontally(swaps left-right)/vertically(swaps up-down)/in-depth(swaps back-forward). Boolean values. |
Default('false')
|
ih_flip
|
Boolean
|
flip in video horizontally (default false) |
Default('false')
|
iv_flip
|
Boolean
|
Set if input video is flipped horizontally/vertically. Boolean values. |
Default('false')
|
in_trans
|
Boolean
|
Set if input video is transposed. Boolean value, by default disabled. |
Default('false')
|
out_trans
|
Boolean
|
Set if output video needs to be transposed. Boolean value, by default disabled. |
Default('false')
|
ih_fov
|
Float
|
input horizontal field of view (from 0 to 360) (default 0) |
Default('0')
|
iv_fov
|
Float
|
input vertical field of view (from 0 to 360) (default 0) |
Default('0')
|
id_fov
|
Float
|
input diagonal field of view (from 0 to 360) (default 0) |
Default('0')
|
h_offset
|
Float
|
output horizontal off-axis offset (from -1 to 1) (default 0) |
Default('0')
|
v_offset
|
Float
|
Set output horizontal/vertical off-axis offset. Default is set to 0. Allowed range is from -1 to 1. |
Default('0')
|
alpha_mask
|
Boolean
|
Build mask in alpha plane for all unmapped pixels by marking them fully transparent. Boolean value, by default disabled. |
Default('false')
|
reset_rot
|
Boolean
|
Reset rotation of output video. Boolean value, by default disabled. |
Default('false')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
vaguedenoiser
¶
vaguedenoiser(
*,
threshold: Float = Default("2"),
method: (
Int | Literal["hard", "soft", "garrote"] | Default
) = Default("garrote"),
nsteps: Int = Default("6"),
percent: Float = Default("85"),
planes: Int = Default("15"),
type: (
Int | Literal["universal", "bayes"] | Default
) = Default("universal"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply a wavelet based denoiser.
It transforms each frame from the video input into the wavelet domain, using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to the obtained coefficients. It does an inverse wavelet transform after. Due to wavelet properties, it should give a nice smoothed result, and reduced noise, without blurring picture features.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
Float
|
The filtering strength. The higher, the more filtered the video will be. Hard thresholding can use a higher threshold than soft thresholding before the video looks overfiltered. Default value is 2. |
Default('2')
|
method
|
Int | Literal['hard', 'soft', 'garrote'] | Default
|
The filtering method the filter will use. It accepts the following values: @end table Default is garrote. |
Default('garrote')
|
nsteps
|
Int
|
Number of times, the wavelet will decompose the picture. Picture can't be decomposed beyond a particular point (typically, 8 for a 640x480 frame - as 2^9 = 512 > 480). Valid values are integers between 1 and 32. Default value is 6. |
Default('6')
|
percent
|
Float
|
Partial of full denoising (limited coefficients shrinking), from 0 to 100. Default value is 85. |
Default('85')
|
planes
|
Int
|
A list of the planes to process. By default all planes are processed. |
Default('15')
|
type
|
Int | Literal['universal', 'bayes'] | Default
|
The threshold type the filter will use. It accepts the following values: @end table Default is universal. |
Default('universal')
|
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
varblur
¶
varblur(
_radius: VideoStream,
*,
min_r: Int = Default("0"),
max_r: Int = Default("8"),
planes: Int = Default("15"),
framesync_options: FFMpegFrameSyncOption | None = None,
eof_action: str | None = None,
shortest: bool | None = None,
repeatlast: bool | None = None,
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply variable blur filter by using 2nd video stream to set blur radius. The 2nd stream must have the same dimensions.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_r
|
Int
|
Set min allowed radius. Allowed range is from 0 to 254. Default is 0. |
Default('0')
|
max_r
|
Int
|
Set max allowed radius. Allowed range is from 1 to 255. Default is 8. |
Default('8')
|
planes
|
Int
|
Set which planes to process. By default, all are used. |
Default('15')
|
framesync_options
|
FFMpegFrameSyncOption | None
|
Framesync options |
None
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
vectorscope
¶
vectorscope(
*,
mode: (
Int
| Literal[
"gray",
"tint",
"color",
"color2",
"color3",
"color4",
"color5",
]
| Default
) = Default("gray"),
x: Int = Default("1"),
y: Int = Default("2"),
intensity: Float = Default("0.004"),
envelope: (
Int
| Literal["none", "instant", "peak", "peak+instant"]
| Default
) = Default("none"),
graticule: (
Int
| Literal["none", "green", "color", "invert"]
| Default
) = Default("none"),
opacity: Float = Default("0.75"),
flags: (
Flags | Literal["white", "black", "name"] | Default
) = Default("name"),
bgopacity: Float = Default("0.3"),
lthreshold: Float = Default("0"),
hthreshold: Float = Default("1"),
colorspace: (
Int | Literal["auto", "601", "709"] | Default
) = Default("auto"),
tint0: Float = Default("0"),
tint1: Float = Default("0"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Display 2 color component values in the two dimensional graph (which is called a vectorscope).
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Int | Literal['gray', 'tint', 'color', 'color2', 'color3', 'color4', 'color5'] | Default
|
Set vectorscope mode. It accepts the following values: @end table |
Default('gray')
|
x
|
Int
|
Set which color component will be represented on X-axis. Default is 1. |
Default('1')
|
y
|
Int
|
Set which color component will be represented on Y-axis. Default is 2. |
Default('2')
|
intensity
|
Float
|
Set intensity, used by modes: gray, color, color3 and color5 for increasing brightness of color component which represents frequency of (X, Y) location in graph. |
Default('0.004')
|
envelope
|
Int | Literal['none', 'instant', 'peak', 'peak+instant'] | Default
|
@end table |
Default('none')
|
graticule
|
Int | Literal['none', 'green', 'color', 'invert'] | Default
|
Set what kind of graticule to draw. @end table |
Default('none')
|
opacity
|
Float
|
Set graticule opacity. |
Default('0.75')
|
flags
|
Flags | Literal['white', 'black', 'name'] | Default
|
Set graticule flags. @end table |
Default('name')
|
bgopacity
|
Float
|
Set background opacity. |
Default('0.3')
|
lthreshold
|
Float
|
Set low threshold for color component not represented on X or Y axis. Values lower than this value will be ignored. Default is 0. Note this value is multiplied with actual max possible value one pixel component can have. So for 8-bit input and low threshold value of 0.1 actual threshold is 0.1 * 255 = 25. |
Default('0')
|
hthreshold
|
Float
|
Set high threshold for color component not represented on X or Y axis. Values higher than this value will be ignored. Default is 1. Note this value is multiplied with actual max possible value one pixel component can have. So for 8-bit input and high threshold value of 0.9 actual threshold is 0.9 * 255 = 230. |
Default('1')
|
colorspace
|
Int | Literal['auto', '601', '709'] | Default
|
Set what kind of colorspace to use when drawing graticule. @end table Default is auto. |
Default('auto')
|
tint0
|
Float
|
set 1st tint (from -1 to 1) (default 0) |
Default('0')
|
tint1
|
Float
|
Set color tint for gray/tint vectorscope mode. By default both options are zero. This means no tint, and output will remain gray. |
Default('0')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
vflip
¶
vflip(
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None,
) -> VideoStream
Flip the input video vertically.
For example, to vertically flip a video with ffmpeg: @example ffmpeg -i in.avi -vf "vflip" out.avi @end example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
vfrdet
¶
vfrdet(
extra_options: dict[str, Any] | None = None,
) -> VideoStream
Detect variable frame rate video.
This filter tries to detect if the input is variable or constant frame rate.
At end it will output number of frames detected as having variable delta pts, and ones with constant delta pts. If there was frames with variable delta, than it will also show min, max and average delta encountered.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
vibrance
¶
vibrance(
*,
intensity: Float = Default("0"),
rbal: Float = Default("1"),
gbal: Float = Default("1"),
bbal: Float = Default("1"),
rlum: Float = Default("0.072186"),
glum: Float = Default("0.715158"),
blum: Float = Default("0.212656"),
alternate: Boolean = Default("false"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Boost or alter saturation.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
intensity
|
Float
|
Set strength of boost if positive value or strength of alter if negative value. Default is 0. Allowed range is from -2 to 2. |
Default('0')
|
rbal
|
Float
|
Set the red balance. Default is 1. Allowed range is from -10 to 10. |
Default('1')
|
gbal
|
Float
|
Set the green balance. Default is 1. Allowed range is from -10 to 10. |
Default('1')
|
bbal
|
Float
|
Set the blue balance. Default is 1. Allowed range is from -10 to 10. |
Default('1')
|
rlum
|
Float
|
Set the red luma coefficient. |
Default('0.072186')
|
glum
|
Float
|
Set the green luma coefficient. |
Default('0.715158')
|
blum
|
Float
|
Set the blue luma coefficient. |
Default('0.212656')
|
alternate
|
Boolean
|
If intensity is negative and this is set to 1, colors will change, otherwise colors will be less saturated, more towards gray. |
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
vibrato
¶
vibrato(
*,
f: Double = Default("5"),
d: Double = Default("0.5"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Sinusoidal phase modulation.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f
|
Double
|
Modulation frequency in Hertz. Range is 0.1 - 20000.0. Default value is 5.0 Hz. |
Default('5')
|
d
|
Double
|
Depth of modulation as a percentage. Range is 0.0 - 1.0. Default value is 0.5. |
Default('0.5')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
video_stream
¶
video_stream(
index: int | None = None, optional: bool = False
) -> VideoStream
Get the video stream from the input node with a specified index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int | None
|
The index of the video stream. |
None
|
optional
|
bool
|
Whether the video stream is optional. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
VideoStream |
VideoStream
|
The video stream from the input node. |
vidstabdetect
¶
vidstabdetect(
*,
result: String = Default("transforms.trf"),
shakiness: Int = Default("5"),
accuracy: Int = Default("15"),
stepsize: Int = Default("6"),
mincontrast: Double = Default("0.25"),
show: Int = Default("0"),
tripod: Int = Default("0"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Analyze video stabilization/deshaking. Perform pass 1 of 2, see vidstabtransform for pass 2.
This filter generates a file with relative translation and rotation transform information about subsequent frames, which is then used by the vidstabtransform filter.
To enable compilation of this filter you need to configure FFmpeg with --enable-libvidstab.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
String
|
Set the path to the file used to write the transforms information. Default value is transforms.trf. |
Default('transforms.trf')
|
shakiness
|
Int
|
Set how shaky the video is and how quick the camera is. It accepts an integer in the range 1-10, a value of 1 means little shakiness, a value of 10 means strong shakiness. Default value is 5. |
Default('5')
|
accuracy
|
Int
|
Set the accuracy of the detection process. It must be a value in the range 1-15. A value of 1 means low accuracy, a value of 15 means high accuracy. Default value is 15. |
Default('15')
|
stepsize
|
Int
|
Set stepsize of the search process. The region around minimum is scanned with 1 pixel resolution. Default value is 6. |
Default('6')
|
mincontrast
|
Double
|
Set minimum contrast. Below this value a local measurement field is discarded. Must be a floating point value in the range 0-1. Default value is 0.3. |
Default('0.25')
|
show
|
Int
|
Show fields and transforms in the resulting frames. It accepts an integer in the range 0-2. Default value is 0, which disables any visualization. |
Default('0')
|
tripod
|
Int
|
Set reference frame number for tripod mode. If enabled, the motion of the frames is compared to a reference frame in the filtered stream, identified by the specified number. The idea is to compensate all movements in a more-or-less static scene and keep the camera view absolutely still. If set to 0, it is disabled. The frames are counted starting from 1. |
Default('0')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
vidstabtransform
¶
vidstabtransform(
*,
input: String = Default("transforms.trf"),
smoothing: Int = Default("15"),
optalgo: (
Int | Literal["opt", "gauss", "avg"] | Default
) = Default("opt"),
maxshift: Int = Default("-1"),
maxangle: Double = Default("-1"),
crop: (
Int | Literal["keep", "black"] | Default
) = Default("keep"),
invert: Int = Default("0"),
relative: Int = Default("1"),
zoom: Double = Default("0"),
optzoom: Int = Default("1"),
zoomspeed: Double = Default("0.25"),
interpol: (
Int
| Literal["no", "linear", "bilinear", "bicubic"]
| Default
) = Default("bilinear"),
tripod: Boolean = Default("false"),
debug: Boolean = Default("false"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Video stabilization/deshaking: pass 2 of 2, see vidstabdetect for pass 1.
Read a file with transform information for each frame and apply/compensate them. Together with the vidstabdetect filter this can be used to deshake videos. See also http://public.hronopik.de/vid.stab. It is important to also use the unsharp filter, see below.
To enable compilation of this filter you need to configure FFmpeg with --enable-libvidstab.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
String
|
Set path to the file used to read the transforms. Default value is transforms.trf. |
Default('transforms.trf')
|
smoothing
|
Int
|
Set the number of frames (value*2 + 1) used for lowpass filtering the camera movements. Default value is 10. For example a number of 10 means that 21 frames are used (10 in the past and 10 in the future) to smoothen the motion in the video. A larger value leads to a smoother video, but limits the acceleration of the camera (pan/tilt movements). 0 is a special case where a static camera is simulated. |
Default('15')
|
optalgo
|
Int | Literal['opt', 'gauss', 'avg'] | Default
|
Set the camera path optimization algorithm. Accepted values are: @end table |
Default('opt')
|
maxshift
|
Int
|
Set maximal number of pixels to translate frames. Default value is -1, meaning no limit. |
Default('-1')
|
maxangle
|
Double
|
Set maximal angle in radians (degree*PI/180) to rotate frames. Default value is -1, meaning no limit. |
Default('-1')
|
crop
|
Int | Literal['keep', 'black'] | Default
|
Specify how to deal with borders that may be visible due to movement compensation. Available values are: @end table |
Default('keep')
|
invert
|
Int
|
Invert transforms if set to 1. Default value is 0. |
Default('0')
|
relative
|
Int
|
Consider transforms as relative to previous frame if set to 1, absolute if set to 0. Default value is 0. |
Default('1')
|
zoom
|
Double
|
Set percentage to zoom. A positive value will result in a zoom-in effect, a negative value in a zoom-out effect. Default value is 0 (no zoom). |
Default('0')
|
optzoom
|
Int
|
Set optimal zooming to avoid borders. Accepted values are: @end table Note that the value given at zoom is added to the one calculated here. |
Default('1')
|
zoomspeed
|
Double
|
Set percent to zoom maximally each frame (enabled when optzoom is set to 2). Range is from 0 to 5, default value is 0.25. |
Default('0.25')
|
interpol
|
Int | Literal['no', 'linear', 'bilinear', 'bicubic'] | Default
|
Specify type of interpolation. Available values are: @end table |
Default('bilinear')
|
tripod
|
Boolean
|
Enable virtual tripod mode if set to 1, which is equivalent to relative=0:smoothing=0. Default value is 0. Use also tripod option of vidstabdetect. |
Default('false')
|
debug
|
Boolean
|
Increase log verbosity if set to 1. Also the detected global motions are written to the temporary file global_motions.trf. Default value is 0. |
Default('false')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
vif
¶
vif(
_reference: VideoStream,
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None,
) -> VideoStream
Obtain the average VIF (Visual Information Fidelity) between two input videos.
This filter takes two input videos.
Both input videos must have the same resolution and pixel format for this filter to work correctly. Also it assumes that both inputs have the same number of frames, which are compared one by one.
The obtained average VIF score is printed through the logging system.
The filter stores the calculated VIF score of each frame.
In the below example the input file main.mpg being processed is compared with the reference file ref.mpg.
@example ffmpeg -i main.mpg -i ref.mpg -lavfi vif -f null - @end example
@anchor{vignette}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
vignette
¶
vignette(
*,
angle: String = Default("PI/5"),
x0: String = Default("w/2"),
y0: String = Default("h/2"),
mode: (
Int | Literal["forward", "backward"] | Default
) = Default("forward"),
eval: (
Int | Literal["init", "frame"] | Default
) = Default("init"),
dither: Boolean = Default("true"),
aspect: Rational = Default("1/1"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Make or reverse a natural vignetting effect.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
angle
|
String
|
Set lens angle expression as a number of radians. The value is clipped in the [0,PI/2] range. Default value: "PI/5" |
Default('PI/5')
|
x0
|
String
|
set circle center position on x-axis (default "w/2") |
Default('w/2')
|
y0
|
String
|
Set center coordinates expressions. Respectively "w/2" and "h/2" by default. |
Default('h/2')
|
mode
|
Int | Literal['forward', 'backward'] | Default
|
Set forward/backward mode. Available modes are: @end table Default value is forward. |
Default('forward')
|
eval
|
Int | Literal['init', 'frame'] | Default
|
Set evaluation mode for the expressions (angle, x0, y0). It accepts the following values: @end table Default value is init. |
Default('init')
|
dither
|
Boolean
|
Set dithering to reduce the circular banding effects. Default is 1 (enabled). |
Default('true')
|
aspect
|
Rational
|
Set vignette aspect. This setting allows one to adjust the shape of the vignette. Setting this value to the SAR of the input will make a rectangular vignetting following the dimensions of the video. Default is 1/1. |
Default('1/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
virtualbass
¶
virtualbass(
*,
cutoff: Double = Default("250"),
strength: Double = Default("3"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Apply audio Virtual Bass filter.
This filter accepts stereo input and produce stereo with LFE (2.1) channels output. The newly produced LFE channel have enhanced virtual bass originally obtained from both stereo channels. This filter outputs front left and front right channels unchanged as available in stereo input.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cutoff
|
Double
|
Set the virtual bass cutoff frequency. Default value is 250 Hz. Allowed range is from 100 to 500 Hz. |
Default('250')
|
strength
|
Double
|
Set the virtual bass strength. Allowed range is from 0.5 to 3. Default value is 3. |
Default('3')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
vmafmotion
¶
vmafmotion(
*,
stats_file: String = Default(None),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Obtain the average VMAF motion score of a video. It is one of the component metrics of VMAF.
The obtained average motion score is printed through the logging system.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stats_file
|
String
|
If specified, the filter will use the named file to save the motion score of each frame with respect to the previous frame. When filename equals "-" the data is sent to standard output. |
Default(None)
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
volume
¶
volume(
*,
volume: String = Default("1.0"),
precision: (
Int | Literal["fixed", "float", "double"] | Default
) = Default("float"),
eval: (
Int | Literal["once", "frame"] | Default
) = Default("once"),
replaygain: (
Int
| Literal["drop", "ignore", "track", "album"]
| Default
) = Default("drop"),
replaygain_preamp: Double = Default("0"),
replaygain_noclip: Boolean = Default("true"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> AudioStream
Adjust the input audio volume.
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
volume
|
String
|
Modify the volume expression. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. |
Default('1.0')
|
precision
|
Int | Literal['fixed', 'float', 'double'] | Default
|
This parameter represents the mathematical precision. It determines which input sample formats will be allowed, which affects the precision of the volume scaling. @end table |
Default('float')
|
eval
|
Int | Literal['once', 'frame'] | Default
|
Set when the volume expression is evaluated. It accepts the following values: @end table Default value is once. |
Default('once')
|
replaygain
|
Int | Literal['drop', 'ignore', 'track', 'album'] | Default
|
Choose the behaviour on encountering ReplayGain side data in input frames. @end table |
Default('drop')
|
replaygain_preamp
|
Double
|
Pre-amplification gain in dB to apply to the selected replaygain gain. Default value for replaygain_preamp is 0.0. |
Default('0')
|
replaygain_noclip
|
Boolean
|
Prevent clipping by limiting the gain applied. Default value for replaygain_noclip is 1. |
Default('true')
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
volumedetect
¶
volumedetect(
extra_options: dict[str, Any] | None = None,
) -> AudioStream
Detect the volume of the input video.
The filter has no parameters. It supports only 16-bit signed integer samples, so the input will be converted when needed. Statistics about the volume will be printed in the log when the input stream end is reached.
In particular it will show the mean volume (root mean square), maximum volume (on a per-sample basis), and the beginning of a histogram of the registered volume values (from the maximum value to a cumulated 1/1000 of the samples).
All volumes are in decibels relative to the maximum PCM value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
AudioStream
|
the audio stream |
References
w3fdif
¶
w3fdif(
*,
filter: (
Int | Literal["simple", "complex"] | Default
) = Default("complex"),
mode: (
Int | Literal["frame", "field"] | Default
) = Default("field"),
parity: (
Int | Literal["tff", "bff", "auto"] | Default
) = Default("auto"),
deint: (
Int | Literal["all", "interlaced"] | Default
) = Default("all"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Deinterlace the input video ("w3fdif" stands for "Weston 3 Field Deinterlacing Filter").
Based on the process described by Martin Weston for BBC R&D, and implemented based on the de-interlace algorithm written by Jim Easterbrook for BBC R&D, the Weston 3 field deinterlacing filter uses filter coefficients calculated by BBC R&D.
This filter uses field-dominance information in frame to decide which of each pair of fields to place first in the output. If it gets it wrong use setfield filter before w3fdif filter.
There are two sets of filter coefficients, so called "simple" and "complex". Which set of filter coefficients is used can be set by passing an optional parameter:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filter
|
Int | Literal['simple', 'complex'] | Default
|
Set the interlacing filter coefficients. Accepts one of the following values: @end table Default value is complex. |
Default('complex')
|
mode
|
Int | Literal['frame', 'field'] | Default
|
The interlacing mode to adopt. It accepts one of the following values: @end table The default value is field. |
Default('field')
|
parity
|
Int | Literal['tff', 'bff', 'auto'] | Default
|
The picture field parity assumed for the input interlaced video. It accepts one of the following values: @end table The default value is auto. If the interlacing is unknown or the decoder does not export this information, top field first will be assumed. |
Default('auto')
|
deint
|
Int | Literal['all', 'interlaced'] | Default
|
Specify which frames to deinterlace. Accepts one of the following values: @end table Default value is all. |
Default('all')
|
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
waveform
¶
waveform(
*,
mode: (
Int | Literal["row", "column"] | Default
) = Default("column"),
intensity: Float = Default("0.04"),
mirror: Boolean = Default("true"),
display: (
Int
| Literal["overlay", "stack", "parade"]
| Default
) = Default("stack"),
components: Int = Default("1"),
envelope: (
Int
| Literal["none", "instant", "peak", "peak+instant"]
| Default
) = Default("none"),
filter: (
Int
| Literal[
"lowpass",
"flat",
"aflat",
"chroma",
"color",
"acolor",
"xflat",
"yflat",
]
| Default
) = Default("lowpass"),
graticule: (
Int
| Literal["none", "green", "orange", "invert"]
| Default
) = Default("none"),
opacity: Float = Default("0.75"),
flags: (
Flags | Literal["numbers", "dots"] | Default
) = Default("numbers"),
scale: (
Int
| Literal["digital", "millivolts", "ire"]
| Default
) = Default("digital"),
bgopacity: Float = Default("0.75"),
tint0: Float = Default("0"),
tint1: Float = Default("0"),
fitmode: (
Int | Literal["none", "size"] | Default
) = Default("none"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Video waveform monitor.
The waveform monitor plots color component intensity. By default luminance only. Each column of the waveform corresponds to a column of pixels in the source video.
It accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Int | Literal['row', 'column'] | Default
|
Can be either row, or column. Default is column. In row mode, the graph on the left side represents color component value 0 and the right side represents value = 255. In column mode, the top side represents color component value = 0 and bottom side represents value = 255. |
Default('column')
|
intensity
|
Float
|
Set intensity. Smaller values are useful to find out how many values of the same luminance are distributed across input rows/columns. Default value is 0.04. Allowed range is [0, 1]. |
Default('0.04')
|
mirror
|
Boolean
|
Set mirroring mode. 0 means unmirrored, 1 means mirrored. In mirrored mode, higher values will be represented on the left side for row mode and at the top for column mode. Default is 1 (mirrored). |
Default('true')
|
display
|
Int | Literal['overlay', 'stack', 'parade'] | Default
|
Set display mode. It accepts the following values: @end table Default is stack. |
Default('stack')
|
components
|
Int
|
Set which color components to display. Default is 1, which means only luminance or red color component if input is in RGB colorspace. If is set for example to 7 it will display all 3 (if) available color components. |
Default('1')
|
envelope
|
Int | Literal['none', 'instant', 'peak', 'peak+instant'] | Default
|
@end table |
Default('none')
|
filter
|
Int | Literal['lowpass', 'flat', 'aflat', 'chroma', 'color', 'acolor', 'xflat', 'yflat'] | Default
|
@end table |
Default('lowpass')
|
graticule
|
Int | Literal['none', 'green', 'orange', 'invert'] | Default
|
Set which graticule to display. @end table |
Default('none')
|
opacity
|
Float
|
Set graticule opacity. |
Default('0.75')
|
flags
|
Flags | Literal['numbers', 'dots'] | Default
|
Set graticule flags. @end table |
Default('numbers')
|
scale
|
Int | Literal['digital', 'millivolts', 'ire'] | Default
|
Set scale used for displaying graticule. @end table Default is digital. |
Default('digital')
|
bgopacity
|
Float
|
Set background opacity. |
Default('0.75')
|
tint0
|
Float
|
set 1st tint (from -1 to 1) (default 0) |
Default('0')
|
tint1
|
Float
|
Set tint for output. Only used with lowpass filter and when display is not overlay and input pixel formats are not RGB. |
Default('0')
|
fitmode
|
Int | Literal['none', 'size'] | Default
|
Set sample aspect ratio of video output frames. Can be used to configure waveform so it is not streched too much in one of directions. @end table Default is 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
weave
¶
weave(
*,
first_field: (
Int | Literal["top", "t", "bottom", "b"] | Default
) = Default("top"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
The weave takes a field-based video input and join each two sequential fields into single frame, producing a new double height clip with half the frame rate and half the frame count.
The doubleweave works same as weave but without halving frame rate and frame count.
It accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
first_field
|
Int | Literal['top', 't', 'bottom', 'b'] | Default
|
Set first field. Available values are: @end table |
Default('top')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
xbr
¶
xbr(
*,
n: Int = Default("3"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply the xBR high-quality magnification filter which is designed for pixel art. It follows a set of edge-detection rules, see https://forums.libretro.com/t/xbr-algorithm-tutorial/123.
It accepts the following option:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Int
|
Set the scaling dimension: 2 for 2xBR, 3 for 3xBR and 4 for 4xBR. Default is 3. |
Default('3')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
xcorrelate
¶
xcorrelate(
_secondary: VideoStream,
*,
planes: Int = Default("7"),
secondary: (
Int | Literal["first", "all"] | Default
) = Default("all"),
framesync_options: FFMpegFrameSyncOption | None = None,
eof_action: str | None = None,
shortest: bool | None = None,
repeatlast: bool | None = None,
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply normalized cross-correlation between first and second input video stream.
Second input video stream dimensions must be lower than first input video stream.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
planes
|
Int
|
Set which planes to process. |
Default('7')
|
secondary
|
Int | Literal['first', 'all'] | Default
|
Set which secondary video frames will be processed from second input video stream, can be first or all. Default is all. |
Default('all')
|
framesync_options
|
FFMpegFrameSyncOption | None
|
Framesync options |
None
|
timeline_options
|
FFMpegTimelineOption | None
|
Timeline options |
None
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
xfade
¶
xfade(
_xfade: VideoStream,
*,
transition: (
Int
| Literal[
"custom",
"fade",
"wipeleft",
"wiperight",
"wipeup",
"wipedown",
"slideleft",
"slideright",
"slideup",
"slidedown",
"circlecrop",
"rectcrop",
"distance",
"fadeblack",
"fadewhite",
"radial",
"smoothleft",
"smoothright",
"smoothup",
"smoothdown",
"circleopen",
"circleclose",
"vertopen",
"vertclose",
"horzopen",
"horzclose",
"dissolve",
"pixelize",
"diagtl",
"diagtr",
"diagbl",
"diagbr",
"hlslice",
"hrslice",
"vuslice",
"vdslice",
"hblur",
"fadegrays",
"wipetl",
"wipetr",
"wipebl",
"wipebr",
"squeezeh",
"squeezev",
"zoomin",
"fadefast",
"fadeslow",
]
| Default
) = Default("fade"),
duration: Duration = Default("1"),
offset: Duration = Default("0"),
expr: String = Default(None),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply cross fade from one input video stream to another input video stream. The cross fade is applied for specified duration.
Both inputs must be constant frame-rate and have the same resolution, pixel format, frame rate and timebase.
The filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transition
|
Int | Literal['custom', 'fade', 'wipeleft', 'wiperight', 'wipeup', 'wipedown', 'slideleft', 'slideright', 'slideup', 'slidedown', 'circlecrop', 'rectcrop', 'distance', 'fadeblack', 'fadewhite', 'radial', 'smoothleft', 'smoothright', 'smoothup', 'smoothdown', 'circleopen', 'circleclose', 'vertopen', 'vertclose', 'horzopen', 'horzclose', 'dissolve', 'pixelize', 'diagtl', 'diagtr', 'diagbl', 'diagbr', 'hlslice', 'hrslice', 'vuslice', 'vdslice', 'hblur', 'fadegrays', 'wipetl', 'wipetr', 'wipebl', 'wipebr', 'squeezeh', 'squeezev', 'zoomin', 'fadefast', 'fadeslow'] | Default
|
Set one of available transition effects: @end table Default transition effect is fade. |
Default('fade')
|
duration
|
Duration
|
Set cross fade duration in seconds. Range is 0 to 60 seconds. Default duration is 1 second. |
Default('1')
|
offset
|
Duration
|
Set cross fade start relative to first input stream in seconds. Default offset is 0. |
Default('0')
|
expr
|
String
|
Set expression for custom transition effect. The expressions can use the following variables and functions: @end table |
Default(None)
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
yadif
¶
yadif(
*,
mode: (
Int
| Literal[
"send_frame",
"send_field",
"send_frame_nospatial",
"send_field_nospatial",
]
| Default
) = Default("send_frame"),
parity: (
Int | Literal["tff", "bff", "auto"] | Default
) = Default("auto"),
deint: (
Int | Literal["all", "interlaced"] | Default
) = Default("all"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Deinterlace the input video ("yadif" means "yet another deinterlacing filter").
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Int | Literal['send_frame', 'send_field', 'send_frame_nospatial', 'send_field_nospatial'] | Default
|
The interlacing mode to adopt. It accepts one of the following values: @end table The default value is send_frame. |
Default('send_frame')
|
parity
|
Int | Literal['tff', 'bff', 'auto'] | Default
|
The picture field parity assumed for the input interlaced video. It accepts one of the following values: @end table The default value is auto. If the interlacing is unknown or the decoder does not export this information, top field first will be assumed. |
Default('auto')
|
deint
|
Int | Literal['all', 'interlaced'] | Default
|
Specify which frames to deinterlace. Accepts one of the following values: @end table The default value is all. |
Default('all')
|
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
yaepblur
¶
yaepblur(
*,
radius: Int = Default("3"),
planes: Int = Default("1"),
sigma: Int = Default("128"),
timeline_options: FFMpegTimelineOption | None = None,
enable: str | None = None,
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply blur filter while preserving edges ("yaepblur" means "yet another edge preserving blur filter"). The algorithm is described in "J. S. Lee, Digital image enhancement and noise filtering by use of local statistics, IEEE Trans. Pattern Anal. Mach. Intell. PAMI-2, 1980."
It accepts the following parameters:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radius
|
Int
|
Set the window radius. Default value is 3. |
Default('3')
|
planes
|
Int
|
Set which planes to filter. Default is only the first plane. |
Default('1')
|
sigma
|
Int
|
Set blur strength. Default value is 128. |
Default('128')
|
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
zmq
¶
zmq(
*,
bind_address: String = Default("tcp://*:5555"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Receive commands sent through a libzmq client, and forward them to filters in the filtergraph.
zmq and azmq work as a pass-through filters. zmq must be inserted between two video filters, azmq between two audio filters. Both are capable to send messages to any filter type.
To enable these filters you need to install the libzmq library and headers and configure FFmpeg with --enable-libzmq.
For more information about libzmq see: http://www.zeromq.org/
The zmq and azmq filters work as a libzmq server, which receives messages sent through a network interface defined by the bind_address (or the abbreviation "b") option. Default value of this option is tcp://localhost:5555. You may want to alter this value to your needs, but do not forget to escape any ':' signs (see filtergraph escaping).
The received message must be in the form: @example TARGET COMMAND [ARG] @end example
TARGET specifies the target of the command, usually the name of
the filter class or a specific filter instance name. The default
filter instance name uses the pattern Parsed_
COMMAND specifies the name of the command for the target filter.
ARG is optional and specifies the optional argument list for the given COMMAND.
Upon reception, the message is processed and the corresponding command is injected into the filtergraph. Depending on the result, the filter will send a reply to the client, adopting the format: @example ERROR_CODE ERROR_REASON MESSAGE @end example
MESSAGE is optional.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bind_address
|
String
|
set bind address (default "tcp://*:5555") |
Default('tcp://*:5555')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |
References
zoompan
¶
zoompan(
*,
zoom: String = Default("1"),
x: String = Default("0"),
y: String = Default("0"),
d: String = Default("90"),
s: Image_size = Default("hd720"),
fps: Video_rate = Default("25"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Apply Zoom & Pan effect.
This filter accepts the following options:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
zoom
|
String
|
Last calculated zoom from 'z' expression for current input frame. |
Default('1')
|
x
|
String
|
set the x expression (default "0") |
Default('0')
|
y
|
String
|
Last calculated 'x' and 'y' position from 'x' and 'y' expression for current input frame. |
Default('0')
|
d
|
String
|
Set the duration expression in number of frames. This sets for how many number of frames effect will last for single input image. Default is 90. |
Default('90')
|
s
|
Image_size
|
Set the output image size, default is 'hd720'. |
Default('hd720')
|
fps
|
Video_rate
|
Set the output frame rate, default is '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
zscale
¶
zscale(
*,
w: String = Default(None),
h: String = Default(None),
size: String = Default(None),
dither: (
Int
| Literal[
"none", "ordered", "random", "error_diffusion"
]
| Default
) = Default("none"),
filter: (
Int
| Literal[
"point",
"bilinear",
"bicubic",
"spline16",
"spline36",
"lanczos",
]
| Default
) = Default("bilinear"),
out_range: (
Int
| Literal[
"input",
"limited",
"full",
"unknown",
"tv",
"pc",
]
| Default
) = Default("input"),
primaries: (
Int
| Literal[
"input",
"709",
"unspecified",
"170m",
"240m",
"2020",
"unknown",
"bt709",
"bt470m",
"bt470bg",
"smpte170m",
"smpte240m",
"film",
"bt2020",
"smpte428",
"smpte431",
"smpte432",
"jedec-p22",
"ebu3213",
]
| Default
) = Default("input"),
transfer: (
Int
| Literal[
"input",
"709",
"unspecified",
"601",
"linear",
"2020_10",
"2020_12",
"unknown",
"bt470m",
"bt470bg",
"smpte170m",
"bt709",
"log100",
"log316",
"bt2020-10",
"bt2020-12",
"smpte2084",
"iec61966-2-4",
"iec61966-2-1",
"arib-std-b67",
]
| Default
) = Default("input"),
matrix: (
Int
| Literal[
"input",
"709",
"unspecified",
"470bg",
"170m",
"2020_ncl",
"2020_cl",
"unknown",
"gbr",
"bt709",
"fcc",
"bt470bg",
"smpte170m",
"smpte2400m",
"ycgco",
"bt2020nc",
"bt2020c",
"chroma-derived-nc",
"chroma-derived-c",
"ictcp",
]
| Default
) = Default("input"),
in_range: (
Int
| Literal[
"input",
"limited",
"full",
"unknown",
"tv",
"pc",
]
| Default
) = Default("input"),
primariesin: (
Int
| Literal[
"input",
"709",
"unspecified",
"170m",
"240m",
"2020",
"unknown",
"bt709",
"bt470m",
"bt470bg",
"smpte170m",
"smpte240m",
"film",
"bt2020",
"smpte428",
"smpte431",
"smpte432",
"jedec-p22",
"ebu3213",
]
| Default
) = Default("input"),
transferin: (
Int
| Literal[
"input",
"709",
"unspecified",
"601",
"linear",
"2020_10",
"2020_12",
"unknown",
"bt470m",
"bt470bg",
"smpte170m",
"bt709",
"log100",
"log316",
"bt2020-10",
"bt2020-12",
"smpte2084",
"iec61966-2-4",
"iec61966-2-1",
"arib-std-b67",
]
| Default
) = Default("input"),
matrixin: (
Int
| Literal[
"input",
"709",
"unspecified",
"470bg",
"170m",
"2020_ncl",
"2020_cl",
"unknown",
"gbr",
"bt709",
"fcc",
"bt470bg",
"smpte170m",
"smpte2400m",
"ycgco",
"bt2020nc",
"bt2020c",
"chroma-derived-nc",
"chroma-derived-c",
"ictcp",
]
| Default
) = Default("input"),
chromal: (
Int
| Literal[
"input",
"left",
"center",
"topleft",
"top",
"bottomleft",
"bottom",
]
| Default
) = Default("input"),
chromalin: (
Int
| Literal[
"input",
"left",
"center",
"topleft",
"top",
"bottomleft",
"bottom",
]
| Default
) = Default("input"),
npl: Double = Default("nan"),
agamma: Boolean = Default("true"),
param_a: Double = Default("nan"),
param_b: Double = Default("nan"),
extra_options: dict[str, Any] | None = None
) -> VideoStream
Scale (resize) the input video, using the z.lib library: https://github.com/sekrit-twc/zimg. To enable compilation of this filter, you need to configure FFmpeg with --enable-libzimg.
The zscale filter forces the output display aspect ratio to be the same as the input, by changing the output sample aspect ratio.
If the input image format is different from the format requested by the next filter, the zscale filter will convert the input to the requested format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
w
|
String
|
Output video width |
Default(None)
|
h
|
String
|
Set the output video dimension expression. The command accepts the same syntax of the corresponding option. If the specified expression is not valid, it is kept at its current value. |
Default(None)
|
size
|
String
|
Set the video size. For the syntax of this option, check the "Video size" section in the ffmpeg-utils manual. |
Default(None)
|
dither
|
Int | Literal['none', 'ordered', 'random', 'error_diffusion'] | Default
|
Set the dither type. Possible values are: @end table Default is none. |
Default('none')
|
filter
|
Int | Literal['point', 'bilinear', 'bicubic', 'spline16', 'spline36', 'lanczos'] | Default
|
Set the resize filter type. Possible values are: @end table Default is bilinear. |
Default('bilinear')
|
out_range
|
Int | Literal['input', 'limited', 'full', 'unknown', 'tv', 'pc'] | Default
|
set color range (from -1 to 1) (default input) |
Default('input')
|
primaries
|
Int | Literal['input', '709', 'unspecified', '170m', '240m', '2020', 'unknown', 'bt709', 'bt470m', 'bt470bg', 'smpte170m', 'smpte240m', 'film', 'bt2020', 'smpte428', 'smpte431', 'smpte432', 'jedec-p22', 'ebu3213'] | Default
|
Set the color primaries. Possible values are: @end table Default is same as input. |
Default('input')
|
transfer
|
Int | Literal['input', '709', 'unspecified', '601', 'linear', '2020_10', '2020_12', 'unknown', 'bt470m', 'bt470bg', 'smpte170m', 'bt709', 'log100', 'log316', 'bt2020-10', 'bt2020-12', 'smpte2084', 'iec61966-2-4', 'iec61966-2-1', 'arib-std-b67'] | Default
|
Set the transfer characteristics. Possible values are: @end table Default is same as input. |
Default('input')
|
matrix
|
Int | Literal['input', '709', 'unspecified', '470bg', '170m', '2020_ncl', '2020_cl', 'unknown', 'gbr', 'bt709', 'fcc', 'bt470bg', 'smpte170m', 'smpte2400m', 'ycgco', 'bt2020nc', 'bt2020c', 'chroma-derived-nc', 'chroma-derived-c', 'ictcp'] | Default
|
Set the colorspace matrix. Possible value are: @end table Default is same as input. |
Default('input')
|
in_range
|
Int | Literal['input', 'limited', 'full', 'unknown', 'tv', 'pc'] | Default
|
set input color range (from -1 to 1) (default input) |
Default('input')
|
primariesin
|
Int | Literal['input', '709', 'unspecified', '170m', '240m', '2020', 'unknown', 'bt709', 'bt470m', 'bt470bg', 'smpte170m', 'smpte240m', 'film', 'bt2020', 'smpte428', 'smpte431', 'smpte432', 'jedec-p22', 'ebu3213'] | Default
|
Set the input color primaries. Possible values are: @end table Default is same as input. |
Default('input')
|
transferin
|
Int | Literal['input', '709', 'unspecified', '601', 'linear', '2020_10', '2020_12', 'unknown', 'bt470m', 'bt470bg', 'smpte170m', 'bt709', 'log100', 'log316', 'bt2020-10', 'bt2020-12', 'smpte2084', 'iec61966-2-4', 'iec61966-2-1', 'arib-std-b67'] | Default
|
Set the input transfer characteristics. Possible values are: @end table Default is same as input. |
Default('input')
|
matrixin
|
Int | Literal['input', '709', 'unspecified', '470bg', '170m', '2020_ncl', '2020_cl', 'unknown', 'gbr', 'bt709', 'fcc', 'bt470bg', 'smpte170m', 'smpte2400m', 'ycgco', 'bt2020nc', 'bt2020c', 'chroma-derived-nc', 'chroma-derived-c', 'ictcp'] | Default
|
Set the input colorspace matrix. Possible value are: @end table |
Default('input')
|
chromal
|
Int | Literal['input', 'left', 'center', 'topleft', 'top', 'bottomleft', 'bottom'] | Default
|
Set the output chroma location. Possible values are: @end table |
Default('input')
|
chromalin
|
Int | Literal['input', 'left', 'center', 'topleft', 'top', 'bottomleft', 'bottom'] | Default
|
Set the input chroma location. Possible values are: @end table |
Default('input')
|
npl
|
Double
|
Set the nominal peak luminance. |
Default('nan')
|
agamma
|
Boolean
|
allow approximate gamma (default true) |
Default('true')
|
param_a
|
Double
|
Parameter A for scaling filters. Parameter "b" for bicubic, and the number of filter taps for lanczos. |
Default('nan')
|
param_b
|
Double
|
Parameter B for scaling filters. Parameter "c" for bicubic. |
Default('nan')
|
extra_options
|
dict[str, Any] | None
|
Extra options for the filter |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
default |
VideoStream
|
the video stream |