[MPlayer-dev-eng] [PATCH] New commands for loading/unloading audio filters at runtime

Jehan Pagès jehan.marmottard at gmail.com
Fri Apr 9 08:05:32 CEST 2010


Hi again,

ok there was indeed one tab at the very first line. My mistake. Hope
there is no other (didn't find at least).

So attached is the updated patch.
As for fool proof testing instruction:

- You can either add key binding in your input.conf. For instance, I
set these ones (because they are the ones I often use):

k af_add karaoke
K af_del karaoke
t af_add scaletempo=speed=tempo
T af_del scaletempo

Of course take care of removing any other binding for the same keys
(here k, K, t and T) you use, if you want it to work.
Then just activate/deactivate karaoke mode with k/K, etc.

- Or for testing random audio filters, run your file in slave mode:
./mplayer -slave -quiet the_media_file.ogg

Then you will be able to use all the commands and load or unload any
filters (see section "AUDIO FILTERS" to get the available list, from
the man). Of course some filters work only in specific conditions,
like if you have a sound card with more than 4 channels (surround), or
more than 2 loudspeakers (delay), so test with the -af option on
command line to compare before saying my command does not work with
some filters. ;)

af_add karaoke
af_add scaletempo=speed=pitch
af_add extrastereo=3

etc.
Then delete some with:
af_del karaoke
af_del scaletempo
af_del extrastereo

or all with:
af_clr

For the scaletempo to be interesting, you must change the speed of the
playback (otherwise, you won't see any difference). By default, if you
change the speed (with the commands "speed_mult some_multiplier" or
without slave mode, with [ or { for half, and } ], then backspace for
reset to 1), the pitch will change (the tune of the song), with
speed=pitch, only the tune changes, but not the speed, with
speed=tempo, the speed changes, but not the tune.
So it can be interesting to change the speed, then load/unload
scaletempo, and see how it changes, etc. (in various combinations)

What is interesting too is adding ladspa filters. I tested, it worked
as well as all the integrated audio filters that I have tested. For
this, mplayer must be compiled with ladspa support (auto-detected by
the configure script if the ladspa dev libraries are installed,
package usually called "ladspa-sdk"), then you can install ladspa
plugins from your package manager, and see the list in /usr/lib/ladspa
(typical installation path).

So for instance, if you have the tap-plugins installed, let's add some tremolo:

af_add ladspa=/usr/lib/ladspa/tap_tremolo.so:tap_tremolo:10:50:20

To see the controls of a ladspa plugin, you just try to run it (with
the -af command line option is easier in this case) in verbose mode,
without any control:

 mplayer -v -af ladspa=/usr/lib/ladspa/tap_tremolo.so:tap_tremolo:

It will display the list of control with ranges, you just have to
randomly (this is my method as I don't really know what every control
means, but if you do, you can choose wisely not to destroy your ears
as I did with some tests, uhuh) some control values.
Etc.
Tell me if you have any difficulty.
Bye.

Jehan

2010/4/9 Jehan Pagès <jehan.marmottard at gmail.com>:
> Hi,
>
>
> On Fri, Apr 9, 2010 at 2:26 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
>> Jehan, if you want me to apply, please resend without the tab but with
>> fool-proof testing instructions.
>>
>> Carl Eugen
>
> Fool-proof instruction, I can, but... the tabs? What do you mean? I
> made special care to configure my editor to use spaces instead of tabs
> as I read here that spaces were your norm. Is there some tabs in my
> files?
>
> Jehan
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer_af_filters2.patch
Type: text/x-patch
Size: 3922 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100409/5a5e92ca/attachment.bin>


More information about the MPlayer-dev-eng mailing list