Video filters let you modify the video stream before it reaches the video output. Filters are chained together, with each filter’s output feeding into the next.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mpv-player/mpv/llms.txt
Use this file to discover all available pages before exploring further.
--vf takes a single video track as input. Filters requiring multiple inputs cannot be used with --vf. Use --lavfi-complex for multi-input filter graphs.Filter chain syntax
The full syntax for a filter entry is:: (not ,, which starts a new filter).
Labels and runtime toggling
Labels let you identify and control individual filters at runtime.vf command in the mpv console or via input bindings:
! prefix marks a filter as disabled by default. It is created but skipped, ready to be enabled at runtime.
Managing the filter list
| Option | Description |
|---|---|
--vf-append=filter | Append a filter to the end of the chain |
--vf-add=filter | Append a filter (deprecated for multiple filters) |
--vf-pre=filter | Prepend a filter to the beginning of the chain |
--vf-remove=filter | Remove a filter by name/args or by @label |
--vf-toggle=filter | Add if absent, remove if present |
--vf-clr | Clear the entire filter chain |
lavfi — libavfilter wrapper
lavfi is the primary filter for most video processing tasks. It wraps FFmpeg’s libavfilter, giving you access to hundreds of filters.
ffmpeg command line. Quote it with [ and ] to prevent parsing conflicts with mpv’s own syntax:
lavfi- prefix to force the libavfilter bridge for any filter name:
If a filter name is not a built-in mpv filter, the
lavfi-bridge is tried automatically. The bridge does not verify parameters before use and does not support help output.Built-in filters
format
Applies video parameter overrides (pixel format, color matrix, color levels, etc.) with optional conversion.| Parameter | Description |
|---|---|
fmt | Pixel format (e.g. rgb24, 420p). Conversion is always performed. |
colormatrix | YUV-to-RGB color space: auto, bt.601, bt.709, bt.2020-ncl, bt.2020-cl, bt.2100-pq, bt.2100-hlg, dolbyvision, smpte-240m |
colorlevels | Color range: auto, limited, full |
primaries | RGB primaries: auto, bt.601-525, bt.601-625, bt.709, bt.2020, dci-p3, and more |
convert=yes|no | If yes, use libswscale or zimg for actual conversion (default: no) |
rotate | Set rotation in degrees. -1 uses the input format. |
sub
Moves subtitle rendering to an arbitrary point in the filter chain, or forces subtitle rendering into the video stream instead of the video output’s OSD layer.bottom-margin— Adds a black band at the bottom for subtitle placementtop-margin— Adds a black band at the top for toptitles
vapoursynth
Loads a VapourSynth filter script for streamed processing. Requires expert knowledge; usevspipe + a pipe for random-access processing instead.
Common use cases
Deinterlacing
Deinterlacing
Use libavfilter’s For runtime toggling:
yadif (Yet Another DeInterlacing Filter) via lavfi:Scaling to a specific resolution
Scaling to a specific resolution
Applying subtitles in the filter chain
Applying subtitles in the filter chain
Move subtitle rendering before other filters, so subtitles are affected by color adjustments:
HDR tonemapping and format conversion
HDR tonemapping and format conversion
Use the For HDR tonemapping in the renderer, prefer
format filter to adjust color metadata for incorrectly tagged content:--vo=gpu-next with --target-colorspace-hint.Flip and rotate
Flip and rotate
Chaining multiple filters
Chaining multiple filters