Skip to main content

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.

Audio filters let you modify the audio stream before it reaches the audio output. The filter chain syntax is identical to video filters.
mpv --af=<filter1[=param1:param2],filter2,...> audio.flac
Run mpv --af=help to list all available audio filters. Most filters are available via the lavfi wrapper, which exposes all of libavfilter’s audio filters.

Filter chain syntax

The syntax for --af is the same as --vf. See video filters for full details on labels, the ! prefix for disabled-by-default filters, and runtime toggling.
# Single filter
mpv --af=scaletempo2 audio.flac

# Filter chain
mpv --af=scaletempo2,lavfi=loudnorm audio.flac

# Add to an existing filter list
mpv --af-add=rubberband audio.flac
Filter list management options: --af-add, --af-pre, --af-clr. See --vf group of options for their behavior.

Available filters

lavcac3enc — AC-3 encoding

Encodes multi-channel audio to AC-3 at runtime using libavcodec. Supports up to 6 channels. Output is big-endian for raw AC-3, or native-endian for S/PDIF. Input is resampled to 48 kHz, 44.1 kHz, or 32 kHz if needed.
# Encode to AC-3 and output via S/PDIF (default)
mpv --af=lavcac3enc audio.flac

# Raw AC-3 stream output
mpv --af=lavcac3enc=tospdif=no audio.flac

# Set bitrate to 384 kbps
mpv --af=lavcac3enc=bitrate=384 audio.flac
ParameterDescription
tospdif=<yes|no>Output via S/PDIF passthrough (yes, default) or raw AC-3 stream (no)
bitrate=<rate>Bitrate in kbps (default: 640). Valid values: 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640. Use auto to select based on channel count.
minch=<n>Detach filter if input has fewer than n channels (default: 3)
encoder=<name>libavcodec encoder to use (must be an AC-3 encoder)
Auto bitrate by channel count:
ChannelsBitrate
196 kbps
2192 kbps
3224 kbps
4384 kbps
5–6448 kbps

format — audio format control

Forces a specific audio format, sample rate, or channel layout. Does not perform conversion itself; it instructs the filter system to insert necessary conversion filters.
# Force 48000 Hz sample rate
mpv --af=format=srate=48000 audio.flac

# Force stereo output
mpv --af=format=channels=stereo audio.flac

# List available formats
mpv --af=format=format=help
ParameterDescription
formatForce a specific sample format (e.g. s16, float)
srateForce a specific sample rate (e.g. 48000)
channelsForce a specific channel layout
To control audio output format (as opposed to mid-chain format), use --audio-format, --audio-samplerate, and --audio-channels instead.

scaletempo — tempo scaling (legacy)

Scales audio tempo without altering pitch, optionally synced to playback speed. Uses a time-domain WSOLA-like algorithm.
# Play at 1.2x speed with normal pitch
mpv --af=scaletempo --speed=1.2 audio.flac

# Sync tempo to speed, but don't respond to speed changes
mpv --af=scaletempo=scale=1.2:speed=none --speed=1.2 audio.flac
ParameterDefaultDescription
scale=<amount>1.0Additional tempo scale factor
stride=<ms>60Output stride length in milliseconds
overlap=<factor>0.20Overlap fraction of stride
search=<ms>14Search length for best overlap position
speed=<tempo|pitch|both|none>tempoHow to respond to speed changes: tempo (scale tempo), pitch (scale pitch instead, loses video sync), both, or none
Scales audio tempo without altering pitch using the WSOLA (Waveform Similarity Overlap-and-Add) algorithm, ported from Chromium. Higher audio quality than scaletempo and rubberband R2 engine. This filter is inserted automatically when --audio-pitch-correction is enabled (the default) and playback speed changes.
mpv --af=scaletempo2 --speed=1.5 audio.flac
ParameterDefaultDescription
min-speed=<speed>0.25Mute audio below this playback speed
max-speed=<speed>8.0Mute audio above this playback speed (0 = disabled)
search-interval=<ms>40Length in ms to search for best overlap position
window-size=<ms>12Length in ms of the overlap-and-add window

rubberband — high-quality pitch correction

High-quality pitch correction using librubberband. Can replace scaletempo and scaletempo2, and supports pitch adjustment independent of speed.
mpv --af=rubberband --speed=1.5 audio.flac

# Adjust pitch upward by a musical semitone
mpv --af=rubberband=pitch-scale=1.059463 audio.flac
ParameterDescription
pitch-scale=<amount>Pitch scaling factor; frequencies are multiplied by this value (default: 1.0)
engine=<faster|finer>Rubberband engine: faster (R2, less CPU) or finer (R3, higher quality — default if librubberband ≥ 3)
List all available rubberband sub-options:
mpv --af=rubberband=help
Runtime commands (via af-command):
  • set-pitch <value> — Change pitch-scale dynamically at runtime
  • multiply-pitch <factor> — Multiply the current pitch-scale dynamically
Example input.conf for semitone pitch stepping:
[ multiply speed 0.9438743126816935
] multiply speed 1.059463094352953

lavfi — libavfilter wrapper

Filters audio using FFmpeg’s libavfilter. Provides access to all of libavfilter’s audio filters.
mpv --af='lavfi=loudnorm' audio.flac

# EQ: boost bass by 5 dB below 200 Hz
mpv --af='lavfi=equalizer=f=200:width_type=h:width=200:g=5' audio.flac

# Normalize loudness
mpv --af='lavfi=loudnorm=I=-16:TP=-1.5:LRA=11' audio.flac
Quote libavfilter graphs to avoid conflicts with mpv’s own syntax. Use the same quoting strategies as described in the video filters lavfi section.
Additional options:
ParameterDescription
o=<string>AVOptions passed to the filter graph
fix-pts=<yes|no>Compute PTS from sample count instead of relying on libavfilter (default: no). Use for filters that reset or recompute PTS.

drop — frame dropping for SPDIF

Drops or repeats audio frames to adapt to playback speed. Operates on full audio frames, designed for S/PDIF (compressed audio passthrough). Used automatically with --video-sync=display-adrop.
This filter is extremely low quality. Do not use it unless you have a specific need for S/PDIF with display-adrop.

Common use cases

# scaletempo2 is used automatically, but you can be explicit:
mpv --speed=1.5 audio.flac

# Or force rubberband for higher quality:
mpv --af=rubberband --speed=1.5 audio.flac
mpv --af=lavcac3enc audio.mkv
This is useful when your audio output device requires AC-3 but the source file is in a different multichannel format.
mpv --af='lavfi=loudnorm=I=-16:TP=-1.5:LRA=11' audio.flac
# 5 dB boost at 100 Hz with 50 Hz bandwidth
mpv --af='lavfi=equalizer=f=100:width_type=h:width=50:g=5' audio.flac
# Shift pitch up by one semitone
mpv --af=rubberband=pitch-scale=1.059463 audio.flac

Filter help

# List all available audio filters
mpv --af=help

# Show parameters for a specific filter
mpv --af=scaletempo=help
For libavfilter audio filters, refer to the FFmpeg filter documentation.