video
¶
Video stream.
Classes:
| Name | Description |
|---|---|
VideoStream |
Video stream. |
VideoStream
¶
Bases: FilterableStream
Video stream.
Methods:
| Name | Description |
|---|---|
addroi |
Mark a region of interest in a video frame. |
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 |
amplify |
Amplify differences between current pixel and pixels of adjacent frames in |
ass |
Same as the subtitles filter, except that it doesn't require libavcodec |
atadenoise |
Apply an Adaptive Temporal Averaging Denoiser to the video input. |
avgblur |
Apply average blur filter. |
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. |
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. |
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. |
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. |
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. |
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. |
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 |
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 |
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. |
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 |
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 |
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 |
haldclut |
Apply a Hald CLUT to a video stream. |
hflip |
Flip the input video horizontally. |
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. |
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. |
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. |
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 |
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. |
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 |
shuffleframes |
Reorder and/or duplicate and/or drop video frames. |
shufflepixels |
Reorder pixels in video frames. |
shuffleplanes |
Reorder and/or duplicate video planes. |
sidedata |
Delete frame side data, or select frames based on it. |
signalstats |
Evaluate various visual metrics that assist in determining issues associated |
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 |
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. |
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 |
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. |
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. |
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. |
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. |
vmafmotion |
Obtain the average VMAF motion score of a 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: |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 |