mpv/DOCS/man/af.rst

618 lines
24 KiB
ReStructuredText
Raw Normal View History

AUDIO FILTERS
=============
Audio filters allow you to modify the audio stream and its properties. The
syntax is:
2013-07-08 16:02:14 +00:00
``--af=<filter1[=parameter1:parameter2:...],filter2,...>``
Setup a chain of audio filters.
2013-07-08 16:02:14 +00:00
.. note::
To get a full list of available audio filters, see ``--af=help``.
You can also set defaults for each filter. The defaults are applied before the
normal filter parameters.
``--af-defaults=<filter1[=parameter1:parameter2:...],filter2,...>``
Set defaults for each filter.
Audio filters are managed in lists. There are a few commands to manage the
2013-07-08 16:02:14 +00:00
filter list:
2013-07-08 16:02:14 +00:00
``--af-add=<filter1[,filter2,...]>``
Appends the filters given as arguments to the filter list.
2013-07-08 16:02:14 +00:00
``--af-pre=<filter1[,filter2,...]>``
Prepends the filters given as arguments to the filter list.
2013-07-08 16:02:14 +00:00
``--af-del=<index1[,index2,...]>``
Deletes the filters at the given indexes. Index numbers start at 0,
negative numbers address the end of the list (-1 is the last).
2013-07-08 16:02:14 +00:00
``--af-clr``
Completely empties the filter list.
Available filters are:
2013-07-08 16:02:14 +00:00
``lavrresample[=option1:option2:...]``
This filter uses libavresample (or libswresample, depending on the build)
to change sample rate, sample format, or channel layout of the audio stream.
2013-07-08 16:02:14 +00:00
This filter is automatically enabled if the audio output does not support
the audio configuration of the file being played.
It supports only the following sample formats: u8, s16, s32, float.
``filter-size=<length>``
2013-07-08 16:02:14 +00:00
Length of the filter with respect to the lower sampling rate. (default:
16)
``phase-shift=<count>``
2013-07-08 16:02:14 +00:00
Log2 of the number of polyphase entries. (..., 10->1024, 11->2048,
12->4096, ...) (default: 10->1024)
2013-07-08 16:02:14 +00:00
``cutoff=<cutoff>``
Cutoff frequency (0.0-1.0), default set depending upon filter length.
``linear``
If set then filters will be linearly interpolated between polyphase
entries. (default: no)
``no-detach``
Do not detach if input and output audio format/rate/channels match.
(If you just want to set defaults for this filter that will be used
even by automatically inserted lavrresample instances, you should
prefer setting them with ``--af-defaults=lavrresample:...``.)
``o=<string>``
Set AVOptions on the SwrContext or AVAudioResampleContext. These should
be documented by FFmpeg or Libav.
2013-07-08 16:02:14 +00:00
``lavcac3enc[=tospdif[:bitrate[:minchn]]]``
Encode multi-channel audio to AC-3 at runtime using libavcodec. Supports
16-bit native-endian input format, maximum 6 channels. The output is
big-endian when outputting a raw AC-3 stream, native-endian when
2013-07-08 16:02:14 +00:00
outputting to S/PDIF. If the input sample rate is not 48 kHz, 44.1 kHz or
32 kHz, it will be resampled to 48 kHz.
``tospdif=<yes|no>``
Output raw AC-3 stream if ``no``, output to S/PDIF for
2014-09-01 02:25:57 +00:00
pass-through if ``yes`` (default).
``bitrate=<rate>``
The bitrate use for the AC-3 stream. Set it to 384 to get 384 kbps.
The default is 640. Some receivers might not be able to handle this.
Valid values: 32, 40, 48, 56, 64, 80, 96, 112, 128,
160, 192, 224, 256, 320, 384, 448, 512, 576, 640.
The special value ``auto`` selects a default bitrate based on the
input channel number:
:1ch: 96
:2ch: 192
:3ch: 224
:4ch: 384
:5ch: 448
:6ch: 448
``minchn=<n>``
2013-07-08 16:02:14 +00:00
If the input channel number is less than ``<minchn>``, the filter will
detach itself (default: 3).
2013-07-08 16:02:14 +00:00
``sweep[=speed]``
Produces a sine sweep.
2013-07-08 16:02:14 +00:00
``<0.0-1.0>``
Sine function delta, use very low values to hear the sweep.
2013-07-08 16:02:14 +00:00
``sinesuppress[=freq:decay]``
2014-09-01 02:25:57 +00:00
Remove a sine at the specified frequency. Useful to get rid of the 50/60 Hz
2013-07-08 16:02:14 +00:00
noise on low quality audio equipment. It only works on mono input.
2013-07-08 16:02:14 +00:00
``<freq>``
The frequency of the sine which should be removed (in Hz) (default:
50)
2013-07-08 16:02:14 +00:00
``<decay>``
Controls the adaptivity (a larger value will make the filter adapt to
amplitude and phase changes quicker, a smaller value will make the
adaptation slower) (default: 0.0001). Reasonable values are around
0.001.
2013-07-08 16:02:14 +00:00
``bs2b[=option1:option2:...]``
Bauer stereophonic to binaural transformation using libbs2b. Improves the
headphone listening experience by making the sound similar to that from
loudspeakers, allowing each ear to hear both channels and taking into
account the distance difference and the head shadowing effect. It is
2013-07-08 16:02:14 +00:00
applicable only to 2-channel audio.
2013-07-08 16:02:14 +00:00
``fcut=<300-1000>``
Set cut frequency in Hz.
2013-07-08 16:02:14 +00:00
``feed=<10-150>``
Set feed level for low frequencies in 0.1*dB.
2013-07-08 16:02:14 +00:00
``profile=<value>``
Several profiles are available for convenience:
:default: will be used if nothing else was specified (fcut=700,
feed=45)
:cmoy: Chu Moy circuit implementation (fcut=700, feed=60)
:jmeier: Jan Meier circuit implementation (fcut=650, feed=95)
2013-07-08 16:02:14 +00:00
If ``fcut`` or ``feed`` options are specified together with a profile, they
will be applied on top of the selected profile.
2013-07-08 16:02:14 +00:00
``hrtf[=flag]``
Head-related transfer function: Converts multichannel audio to 2-channel
output for headphones, preserving the spatiality of the sound.
==== ===================================
Flag Meaning
==== ===================================
m matrix decoding of the rear channel
s 2-channel matrix decoding
0 no matrix decoding (default)
==== ===================================
``equalizer=g1:g2:g3:...:g10``
2013-07-08 16:02:14 +00:00
10 octave band graphic equalizer, implemented using 10 IIR band-pass
filters. This means that it works regardless of what type of audio is
being played back. The center frequencies for the 10 bands are:
=== ==========
No. frequency
=== ==========
0 31.25 Hz
1 62.50 Hz
2 125.00 Hz
3 250.00 Hz
4 500.00 Hz
5 1.00 kHz
6 2.00 kHz
7 4.00 kHz
8 8.00 kHz
9 16.00 kHz
=== ==========
If the sample rate of the sound being played is lower than the center
frequency for a frequency band, then that band will be disabled. A known
bug with this filter is that the characteristics for the uppermost band
are not completely symmetric if the sample rate is close to the center
frequency of that band. This problem can be worked around by upsampling
2013-07-08 16:02:14 +00:00
the sound using a resampling filter before it reaches this filter.
2013-07-08 16:02:14 +00:00
``<g1>:<g2>:<g3>:...:<g10>``
floating point numbers representing the gain in dB for each frequency
band (-12-12)
2013-07-08 16:02:14 +00:00
.. admonition:: Example
2013-07-08 16:02:14 +00:00
``mpv --af=equalizer=11:11:10:5:0:-12:0:5:12:12 media.avi``
Would amplify the sound in the upper and lower frequency region
2014-09-01 02:25:57 +00:00
while canceling it almost completely around 1 kHz.
``channels=nch[:routes]``
Can be used for adding, removing, routing and copying audio channels. If
2013-07-08 16:02:14 +00:00
only ``<nch>`` is given, the default routing is used. It works as follows:
If the number of output channels is greater than the number of input
channels, empty channels are inserted (except when mixing from mono to
stereo; then the mono channel is duplicated). If the number of output
channels is less than the number of input channels, the exceeding
channels are truncated.
2013-07-08 16:02:14 +00:00
``<nch>``
number of output channels (1-8)
``<routes>``
List of ``,`` separated routes, in the form ``from1-to1,from2-to2,...``.
Each pair defines where to route each channel. There can be at most
8 routes. Without this argument, the default routing is used. Since
``,`` is also used to separate filters, you must quote this argument
with ``[...]`` or similar.
2013-07-08 16:02:14 +00:00
.. admonition:: Examples
``mpv --af=channels=4:[0-1,1-0,0-2,1-3] media.avi``
2013-07-08 16:02:14 +00:00
Would change the number of channels to 4 and set up 4 routes that
swap channel 0 and channel 1 and leave channel 2 and 3 intact.
Observe that if media containing two channels were played back,
channels 2 and 3 would contain silence but 0 and 1 would still be
swapped.
``mpv --af=channels=6:[0-0,0-1,0-2,0-3] media.avi``
2013-07-08 16:02:14 +00:00
Would change the number of channels to 6 and set up 4 routes that
copy channel 0 to channels 0 to 3. Channel 4 and 5 will contain
silence.
.. note::
You should probably not use this filter. If you want to change the
output channel layout, try the ``format`` filter, which can make mpv
automatically up- and downmix standard channel layouts.
audio/filter: split af_format into separate filters, rename af_force af_format is the old audio conversion filter. It could do all possible conversions supported by the audio chain. However, ever since the addition of af_lavrresample, most conversions are done by libav/swresample, and af_format is used as fallback. Separate out the fallback cases and remove af_format. af_convert24 does 24 bit <-> 32 bit conversions, while af_convertsignendian does sign and endian conversions. Maybe the way the conversions are split sounds a bit odd. But the former changes the size of the audio data, while the latter is fully in-place, so there's at least different buffer management. This requires a quite complicated algorithm to make sure all these "partial" conversion filters can actually get from one format to another. E.g. s24le->s32be always requires convertsignendian and convert24, but af.c has no idea what the intermediate format should be. So I added a graph search (trying every possible format and filter) to determine required format and filter. When I wrote this, it seemed this was still better than messing everything into af_lavrresample, but maybe this is overkill and I'll change my opinion. For now, it seems nice to get rid of af_format though. The AC3->IEC61937 conversion isn't supported anymore, but I don't think this is needed anywhere. Most AOs test all formats explicitly, or use the AF_FORMAT_IS_IEC61937() macro (which includes AC3). One positive consequence of this change is that conversions always include dithering (done by libav/swresample), instead of possibly going through af_format, which doesn't do anything fancy. Rename af_force to af_format. It's essentially compatible with command line uses of af_format. We retain a compatibility alias for af_force.
2013-10-21 23:20:43 +00:00
``format=format:srate:channels:out-format:out-srate:out-channels``
Force a specific audio format/configuration without actually changing the
audio data. Keep in mind that the filter system might auto-insert actual
conversion filters before or after this filter if needed.
All parameters are optional. The first 3 parameters restrict what the filter
accepts as input. The ``out-`` parameters change the audio format, without
actually doing a conversion. The data will be 'reinterpreted' by the
filters or audio outputs following this filter.
audio/filter: split af_format into separate filters, rename af_force af_format is the old audio conversion filter. It could do all possible conversions supported by the audio chain. However, ever since the addition of af_lavrresample, most conversions are done by libav/swresample, and af_format is used as fallback. Separate out the fallback cases and remove af_format. af_convert24 does 24 bit <-> 32 bit conversions, while af_convertsignendian does sign and endian conversions. Maybe the way the conversions are split sounds a bit odd. But the former changes the size of the audio data, while the latter is fully in-place, so there's at least different buffer management. This requires a quite complicated algorithm to make sure all these "partial" conversion filters can actually get from one format to another. E.g. s24le->s32be always requires convertsignendian and convert24, but af.c has no idea what the intermediate format should be. So I added a graph search (trying every possible format and filter) to determine required format and filter. When I wrote this, it seemed this was still better than messing everything into af_lavrresample, but maybe this is overkill and I'll change my opinion. For now, it seems nice to get rid of af_format though. The AC3->IEC61937 conversion isn't supported anymore, but I don't think this is needed anywhere. Most AOs test all formats explicitly, or use the AF_FORMAT_IS_IEC61937() macro (which includes AC3). One positive consequence of this change is that conversions always include dithering (done by libav/swresample), instead of possibly going through af_format, which doesn't do anything fancy. Rename af_force to af_format. It's essentially compatible with command line uses of af_format. We retain a compatibility alias for af_force.
2013-10-21 23:20:43 +00:00
``<format>``
Force conversion to this format. Use ``--af=format=format=help`` to get
a list of valid formats.
audio/filter: split af_format into separate filters, rename af_force af_format is the old audio conversion filter. It could do all possible conversions supported by the audio chain. However, ever since the addition of af_lavrresample, most conversions are done by libav/swresample, and af_format is used as fallback. Separate out the fallback cases and remove af_format. af_convert24 does 24 bit <-> 32 bit conversions, while af_convertsignendian does sign and endian conversions. Maybe the way the conversions are split sounds a bit odd. But the former changes the size of the audio data, while the latter is fully in-place, so there's at least different buffer management. This requires a quite complicated algorithm to make sure all these "partial" conversion filters can actually get from one format to another. E.g. s24le->s32be always requires convertsignendian and convert24, but af.c has no idea what the intermediate format should be. So I added a graph search (trying every possible format and filter) to determine required format and filter. When I wrote this, it seemed this was still better than messing everything into af_lavrresample, but maybe this is overkill and I'll change my opinion. For now, it seems nice to get rid of af_format though. The AC3->IEC61937 conversion isn't supported anymore, but I don't think this is needed anywhere. Most AOs test all formats explicitly, or use the AF_FORMAT_IS_IEC61937() macro (which includes AC3). One positive consequence of this change is that conversions always include dithering (done by libav/swresample), instead of possibly going through af_format, which doesn't do anything fancy. Rename af_force to af_format. It's essentially compatible with command line uses of af_format. We retain a compatibility alias for af_force.
2013-10-21 23:20:43 +00:00
``<srate>``
Force conversion to a specific sample rate. The rate is an integer,
48000 for example.
audio/filter: split af_format into separate filters, rename af_force af_format is the old audio conversion filter. It could do all possible conversions supported by the audio chain. However, ever since the addition of af_lavrresample, most conversions are done by libav/swresample, and af_format is used as fallback. Separate out the fallback cases and remove af_format. af_convert24 does 24 bit <-> 32 bit conversions, while af_convertsignendian does sign and endian conversions. Maybe the way the conversions are split sounds a bit odd. But the former changes the size of the audio data, while the latter is fully in-place, so there's at least different buffer management. This requires a quite complicated algorithm to make sure all these "partial" conversion filters can actually get from one format to another. E.g. s24le->s32be always requires convertsignendian and convert24, but af.c has no idea what the intermediate format should be. So I added a graph search (trying every possible format and filter) to determine required format and filter. When I wrote this, it seemed this was still better than messing everything into af_lavrresample, but maybe this is overkill and I'll change my opinion. For now, it seems nice to get rid of af_format though. The AC3->IEC61937 conversion isn't supported anymore, but I don't think this is needed anywhere. Most AOs test all formats explicitly, or use the AF_FORMAT_IS_IEC61937() macro (which includes AC3). One positive consequence of this change is that conversions always include dithering (done by libav/swresample), instead of possibly going through af_format, which doesn't do anything fancy. Rename af_force to af_format. It's essentially compatible with command line uses of af_format. We retain a compatibility alias for af_force.
2013-10-21 23:20:43 +00:00
``<channels>``
Force mixing to a specific channel layout. See ``--audio-channels`` option
for possible values.
2013-07-08 16:02:14 +00:00
``<out-format>``
2013-07-08 16:02:14 +00:00
``<out-srate>``
2013-07-08 16:02:14 +00:00
``<out-channels>``
See also ``--audio-format``, ``--audio-samplerate``, and
``--audio-channels`` for related options. Keep in mind that
``--audio-channels`` does not actually force the number of
audio/filter: split af_format into separate filters, rename af_force af_format is the old audio conversion filter. It could do all possible conversions supported by the audio chain. However, ever since the addition of af_lavrresample, most conversions are done by libav/swresample, and af_format is used as fallback. Separate out the fallback cases and remove af_format. af_convert24 does 24 bit <-> 32 bit conversions, while af_convertsignendian does sign and endian conversions. Maybe the way the conversions are split sounds a bit odd. But the former changes the size of the audio data, while the latter is fully in-place, so there's at least different buffer management. This requires a quite complicated algorithm to make sure all these "partial" conversion filters can actually get from one format to another. E.g. s24le->s32be always requires convertsignendian and convert24, but af.c has no idea what the intermediate format should be. So I added a graph search (trying every possible format and filter) to determine required format and filter. When I wrote this, it seemed this was still better than messing everything into af_lavrresample, but maybe this is overkill and I'll change my opinion. For now, it seems nice to get rid of af_format though. The AC3->IEC61937 conversion isn't supported anymore, but I don't think this is needed anywhere. Most AOs test all formats explicitly, or use the AF_FORMAT_IS_IEC61937() macro (which includes AC3). One positive consequence of this change is that conversions always include dithering (done by libav/swresample), instead of possibly going through af_format, which doesn't do anything fancy. Rename af_force to af_format. It's essentially compatible with command line uses of af_format. We retain a compatibility alias for af_force.
2013-10-21 23:20:43 +00:00
channels in most cases, while this filter can do this.
audio/filter: split af_format into separate filters, rename af_force af_format is the old audio conversion filter. It could do all possible conversions supported by the audio chain. However, ever since the addition of af_lavrresample, most conversions are done by libav/swresample, and af_format is used as fallback. Separate out the fallback cases and remove af_format. af_convert24 does 24 bit <-> 32 bit conversions, while af_convertsignendian does sign and endian conversions. Maybe the way the conversions are split sounds a bit odd. But the former changes the size of the audio data, while the latter is fully in-place, so there's at least different buffer management. This requires a quite complicated algorithm to make sure all these "partial" conversion filters can actually get from one format to another. E.g. s24le->s32be always requires convertsignendian and convert24, but af.c has no idea what the intermediate format should be. So I added a graph search (trying every possible format and filter) to determine required format and filter. When I wrote this, it seemed this was still better than messing everything into af_lavrresample, but maybe this is overkill and I'll change my opinion. For now, it seems nice to get rid of af_format though. The AC3->IEC61937 conversion isn't supported anymore, but I don't think this is needed anywhere. Most AOs test all formats explicitly, or use the AF_FORMAT_IS_IEC61937() macro (which includes AC3). One positive consequence of this change is that conversions always include dithering (done by libav/swresample), instead of possibly going through af_format, which doesn't do anything fancy. Rename af_force to af_format. It's essentially compatible with command line uses of af_format. We retain a compatibility alias for af_force.
2013-10-21 23:20:43 +00:00
*NOTE*: this filter used to be named ``force``. Also, unlike the old
``format`` filter, this does not do any actual conversion anymore.
Conversion is done by other, automatically inserted filters.
``convert24``
Filter for internal use only. Converts between 24-bit and 32-bit sample
formats.
``convertsign``
Filter for internal use only. Converts between signed/unsigned formats.
2014-03-14 21:10:10 +00:00
``volume[=<volumedb>[:...]]``
Implements software volume control. Use this filter with caution since it
can reduce the signal to noise ratio of the sound. In most cases it is
2013-07-08 16:02:14 +00:00
best to use the *Master* volume control of your sound card or the volume
knob on your amplifier.
*NOTE*: This filter is not reentrant and can therefore only be enabled
once for every audio stream.
``<volumedb>``
2014-09-01 02:25:57 +00:00
Sets the desired gain in dB for all channels in the stream from -200 dB
to +60 dB, where -200 dB mutes the sound completely and +60 dB equals a
gain of 1000 (default: 0).
``replaygain-track``
Adjust volume gain according to the track-gain replaygain value stored
in the file metadata.
``replaygain-album``
Like replaygain-track, but using the album-gain value instead.
``replaygain-preamp``
Pre-amplification gain in dB to apply to the selected replaygain gain
(default: 0).
``replaygain-clip=yes|no``
Prevent clipping caused by replaygain by automatically lowering the
gain (default). Use ``replaygain-clip=no`` to disable this.
2014-03-14 21:10:10 +00:00
``softclip``
Turns soft clipping on. Soft-clipping can make the
sound more smooth if very high volume levels are used. Enable this
option if the dynamic range of the loudspeakers is very low.
*WARNING*: This feature creates distortion and should be considered a
last resort.
2014-03-14 21:10:10 +00:00
``s16``
Force S16 sample format if set. Lower quality, but might be faster
in some situations.
``detach``
Remove the filter if the volume is not changed at audio filter config
time. Useful with replaygain: if the current file has no replaygain
tags, then the filter will be removed if this option is enabled.
(If ``--softvol=yes`` is used and the player volume controls are used
during playback, a different volume filter will be inserted.)
2013-07-08 16:02:14 +00:00
.. admonition:: Example
``mpv --af=volume=10.1 media.avi``
2014-09-01 02:25:57 +00:00
Would amplify the sound by 10.1 dB and hard-clip if the sound level
2013-07-08 16:02:14 +00:00
is too high.
2014-03-14 21:10:10 +00:00
``pan=n:[<matrix>]``
Mixes channels arbitrarily. Basically a combination of the volume and the
channels filter that can be used to down-mix many channels to only a few,
2013-07-08 16:02:14 +00:00
e.g. stereo to mono, or vary the "width" of the center speaker in a
surround sound system. This filter is hard to use, and will require some
tinkering before the desired result is obtained. The number of options for
this filter depends on the number of output channels. An example how to
downmix a six-channel file to two channels with this filter can be found
in the examples section near the end.
2013-07-08 16:02:14 +00:00
``<n>``
Number of output channels (1-8).
``<matrix>``
A list of values ``[L00,L01,L02,...,L10,L11,L12,...,Ln0,Ln1,Ln2,...]``,
where each element ``Lij`` means how much of input channel i is mixed
into output channel j (range 0-1). So in principle you first have n
numbers saying what to do with the first input channel, then n numbers
that act on the second input channel etc. If you do not specify any
numbers for some input channels, 0 is assumed.
Note that the values are separated by ``,``, which is already used
by the option parser to separate filters. This is why you must quote
the value list with ``[...]`` or similar.
2013-07-08 16:02:14 +00:00
.. admonition:: Examples
``mpv --af=pan=1:[0.5,0.5] media.avi``
2013-07-08 16:02:14 +00:00
Would downmix from stereo to mono.
``mpv --af=pan=3:[1,0,0.5,0,1,0.5] media.avi``
2013-07-08 16:02:14 +00:00
Would give 3 channel output leaving channels 0 and 1 intact, and mix
channels 0 and 1 into output channel 2 (which could be sent to a
subwoofer for example).
.. note::
If you just want to force remixing to a certain output channel layout,
it is easier to use the ``format`` filter. For example,
``mpv '--af=format=channels=5.1' '--audio-channels=5.1'`` would always force
remixing audio to 5.1 and output it like this.
2013-07-08 16:02:14 +00:00
``sub[=fc:ch]``
Adds a subwoofer channel to the audio stream. The audio data used for
creating the subwoofer channel is an average of the sound in channel 0 and
channel 1. The resulting sound is then low-pass filtered by a 4th order
Butterworth filter with a default cutoff frequency of 60Hz and added to a
separate channel in the audio stream.
2013-07-08 16:02:14 +00:00
.. warning::
Disable this filter when you are playing media with an LFE channel
(e.g. 5.1 surround sound), otherwise this filter will disrupt the sound
to the subwoofer.
2013-07-08 16:02:14 +00:00
``<fc>``
2014-09-01 02:25:57 +00:00
cutoff frequency in Hz for the low-pass filter (20 Hz to 300 Hz)
(default: 60 Hz) For the best result try setting the cutoff frequency
as low as possible. This will improve the stereo or surround sound
experience.
2013-07-08 16:02:14 +00:00
``<ch>``
Determines the channel number in which to insert the sub-channel
audio. Channel number can be between 0 and 7 (default: 5). Observe
that the number of channels will automatically be increased to <ch> if
necessary.
2013-07-08 16:02:14 +00:00
.. admonition:: Example
``mpv --af=sub=100:4 --audio-channels=5 media.avi``
2014-09-01 02:25:57 +00:00
Would add a subwoofer channel with a cutoff frequency of 100 Hz to
2013-07-08 16:02:14 +00:00
output channel 4.
2013-07-08 16:02:14 +00:00
``center``
Creates a center channel from the front channels. May currently be low
quality as it does not implement a high-pass filter for proper extraction
yet, but averages and halves the channels instead.
2013-07-08 16:02:14 +00:00
``<ch>``
Determines the channel number in which to insert the center channel.
Channel number can be between 0 and 7 (default: 5). Observe that the
2013-07-08 16:02:14 +00:00
number of channels will automatically be increased to ``<ch>`` if
necessary.
2013-07-08 16:02:14 +00:00
``surround[=delay]``
Decoder for matrix encoded surround sound like Dolby Surround. Some files
with 2-channel audio actually contain matrix encoded surround sound.
2013-07-08 16:02:14 +00:00
``<delay>``
delay time in ms for the rear speakers (0 to 1000) (default: 20) This
delay should be set as follows: If d1 is the distance from the
listening position to the front speakers and d2 is the distance from
the listening position to the rear speakers, then the delay should be
set to 15ms if d1 <= d2 and to 15 + 5*(d1-d2) if d1 > d2.
2013-07-08 16:02:14 +00:00
.. admonition:: Example
``mpv --af=surround=15 --audio-channels=4 media.avi``
2014-09-01 02:25:57 +00:00
Would add surround sound decoding with 15 ms delay for the sound to
2013-07-08 16:02:14 +00:00
the rear speakers.
``delay[=[ch1,ch2,...]]``
Delays the sound to the loudspeakers such that the sound from the
different channels arrives at the listening position simultaneously. It is
only useful if you have more than 2 loudspeakers.
``[ch1,ch2,...]``
The delay in ms that should be imposed on each channel (floating point
number between 0 and 1000).
2013-07-08 16:02:14 +00:00
To calculate the required delay for the different channels, do as follows:
1. Measure the distance to the loudspeakers in meters in relation to your
listening position, giving you the distances s1 to s5 (for a 5.1
system). There is no point in compensating for the subwoofer (you will
not hear the difference anyway).
2. Subtract the distances s1 to s5 from the maximum distance, i.e.
``s[i] = max(s) - s[i]; i = 1...5``.
3. Calculate the required delays in ms as ``d[i] = 1000*s[i]/342; i =
1...5``.
2013-07-08 16:02:14 +00:00
.. admonition:: Example
``mpv --af=delay=[10.5,10.5,0,0,7,0] media.avi``
2014-09-01 02:25:57 +00:00
Would delay front left and right by 10.5 ms, the two rear channels
and the subwoofer by 0 ms and the center channel by 7 ms.
``export=mmapped_file:nsamples]``
Exports the incoming signal to other processes using memory mapping
2013-07-08 16:02:14 +00:00
(``mmap()``). Memory mapped areas contain a header::
2013-07-08 16:02:14 +00:00
int nch /* number of channels */
int size /* buffer size */
unsigned long long counter /* Used to keep sync, updated every time
new data is exported. */
2013-07-08 16:02:14 +00:00
The rest is payload (non-interleaved) 16-bit data.
2013-07-08 16:02:14 +00:00
``<mmapped_file>``
File to map data to (required)
2013-07-08 16:02:14 +00:00
``<nsamples>``
number of samples per channel (default: 512).
2013-07-08 16:02:14 +00:00
.. admonition:: Example
2013-07-08 16:02:14 +00:00
``mpv --af=export=/tmp/mpv-af_export:1024 media.avi``
Would export 1024 samples per channel to ``/tmp/mpv-af_export``.
2013-07-08 16:02:14 +00:00
``extrastereo[=mul]``
(Linearly) increases the difference between left and right channels which
adds some sort of "live" effect to playback.
2013-07-08 16:02:14 +00:00
``<mul>``
Sets the difference coefficient (default: 2.5). 0.0 means mono sound
(average of both channels), with 1.0 sound will be unchanged, with
-1.0 left and right channels will be swapped.
2013-07-08 16:02:14 +00:00
``drc[=method:target]``
Applies dynamic range compression. This maximizes the volume by compressing
2013-09-19 12:33:01 +00:00
the audio signal's dynamic range. (Formerly called ``volnorm``.)
2013-07-08 16:02:14 +00:00
``<method>``
Sets the used method.
1
Use a single sample to smooth the variations via the standard
weighted mean over past samples (default).
2
Use several samples to smooth the variations via the standard
weighted mean over past samples.
2013-07-08 16:02:14 +00:00
``<target>``
Sets the target amplitude as a fraction of the maximum for the sample
type (default: 0.25).
2013-07-08 16:02:14 +00:00
.. note::
2013-07-08 16:02:14 +00:00
This filter can cause distortion with audio signals that have a very
large dynamic range.
``ladspa=file:label:[<control0>,<control1>,...]``
Load a LADSPA (Linux Audio Developer's Simple Plugin API) plugin. This
filter is reentrant, so multiple LADSPA plugins can be used at once.
2013-07-08 16:02:14 +00:00
``<file>``
Specifies the LADSPA plugin library file.
.. note::
See also the note about the ``LADSPA_PATH`` variable in the
`ENVIRONMENT VARIABLES`_ section.
``<label>``
Specifies the filter within the library. Some libraries contain only
2013-07-08 16:02:14 +00:00
one filter, but others contain many of them. Entering 'help' here
will list all available filters within the specified library, which
eliminates the use of 'listplugins' from the LADSPA SDK.
``[<control0>,<control1>,...]``
Controls are zero or more ``,`` separated floating point values that
determine the behavior of the loaded plugin (for example delay,
threshold or gain).
In verbose mode (add ``-v`` to the mpv command line), all
available controls and their valid ranges are printed. This eliminates
the use of 'analyseplugin' from the LADSPA SDK.
Note that ``,`` is already used by the option parser to separate
filters, so you must quote the list of values with ``[...]`` or
similar.
.. admonition:: Example
``mpv --af=ladspa='/usr/lib/ladspa/delay.so':delay_5s:[0.5,0.2] media.avi``
Does something.
2013-07-08 16:02:14 +00:00
``karaoke``
Simple voice removal filter exploiting the fact that voice is usually
recorded with mono gear and later 'center' mixed onto the final audio
stream. Beware that this filter will turn your signal into mono. Works
well for 2 channel tracks; do not bother trying it on anything but 2
channel stereo.
2013-07-08 16:02:14 +00:00
``scaletempo[=option1:option2:...]``
Scales audio tempo without altering pitch, optionally synced to playback
speed (default).
This works by playing 'stride' ms of audio at normal speed then consuming
'stride*scale' ms of input audio. It pieces the strides together by
blending 'overlap'% of stride with audio following the previous stride. It
optionally performs a short statistical analysis on the next 'search' ms
of audio to determine the best overlap position.
2013-07-08 16:02:14 +00:00
``scale=<amount>``
Nominal amount to scale tempo. Scales this amount in addition to
speed. (default: 1.0)
2013-07-08 16:02:14 +00:00
``stride=<amount>``
Length in milliseconds to output each stride. Too high of a value will
cause noticeable skips at high scale amounts and an echo at low scale
amounts. Very low values will alter pitch. Increasing improves
performance. (default: 60)
2013-07-08 16:02:14 +00:00
``overlap=<percent>``
Percentage of stride to overlap. Decreasing improves performance.
(default: .20)
2013-07-08 16:02:14 +00:00
``search=<amount>``
Length in milliseconds to search for best overlap position. Decreasing
improves performance greatly. On slow systems, you will probably want
to set this very low. (default: 14)
2013-07-08 16:02:14 +00:00
``speed=<tempo|pitch|both|none>``
Set response to speed change.
tempo
Scale tempo in sync with speed (default).
pitch
Reverses effect of filter. Scales pitch without altering tempo.
Add ``[ speed_mult 0.9438743126816935`` and ``] speed_mult
1.059463094352953`` to your ``input.conf`` to step by musical
semi-tones.
2013-07-08 16:02:14 +00:00
.. warning::
Loses sync with video.
both
Scale both tempo and pitch.
none
Ignore speed changes.
2013-07-08 16:02:14 +00:00
.. admonition:: Examples
2013-07-08 16:02:14 +00:00
``mpv --af=scaletempo --speed=1.2 media.ogg``
Would play media at 1.2x normal speed, with audio at normal
pitch. Changing playback speed would change audio tempo to match.
2013-07-08 16:02:14 +00:00
``mpv --af=scaletempo=scale=1.2:speed=none --speed=1.2 media.ogg``
Would play media at 1.2x normal speed, with audio at normal
pitch, but changing playback speed would have no effect on audio
tempo.
2013-07-08 16:02:14 +00:00
``mpv --af=scaletempo=stride=30:overlap=.50:search=10 media.ogg``
2014-09-01 02:25:57 +00:00
Would tweak the quality and performance parameters.
``mpv --af=format=float,scaletempo media.ogg``
2013-07-08 16:02:14 +00:00
Would make scaletempo use float code. Maybe faster on some
platforms.
2013-07-08 16:02:14 +00:00
``mpv --af=scaletempo=scale=1.2:speed=pitch audio.ogg``
Would play media at 1.2x normal speed, with audio at normal pitch.
Changing playback speed would change pitch, leaving audio tempo at
1.2x.
2013-07-08 16:02:14 +00:00
``lavfi=graph``
2014-09-01 02:25:57 +00:00
Filter audio using FFmpeg's libavfilter.
2013-07-08 16:02:14 +00:00
``<graph>``
Libavfilter graph. See ``lavfi`` video filter for details - the graph
syntax is the same.
2013-07-08 16:02:14 +00:00
.. warning::
Don't forget to quote libavfilter graphs as described in the lavfi
video filter section.
``o=<string>``
AVOptions.