m1gin 4897

Calf Sidechain Compressor

When trying to use the plugin Calf Sidechain Compressor (LV2) in Ardour, it crashes and doesn't work.

After searching about it, the solution was removing calf-ladspa package from Ubuntu 18.04

sudo apt purge calf-ladspa

After that it worked as expected.


LSP Plugins:

Sidechain Compressor (LV2) and more...

https://sourceforge.net/projects/lsp-plugins/


TIP:

It is possible to adjust and save a preset in Ardour, then get the parameters from the saved presets.
The presets are saved under ~/.lv2/ folder. Open a preset with a text editor and see the values you can use in ffmpeg:

cat ~/.lv2/Calf_Gate_preset1.lv2/preset1.ttl



#ardour #calfplugins #montage #mixing #audioprocessing #plugins #filters #ffmpeg #lv2

m1gin 0

Tested with:

  • Ubuntu 19.10
  • ffmpeg 4.1.4

LV2 plugins with ffmpeg

List installed lv2 plugins:

lv2ls

Get info about an installed plugin. get parameters...

lv2info https://github.com/lucianodato/speech-denoiser

or print plugin control parameters and ranges by ffmpeg (notice: c=help):

ffmpeg -i in.mp3 -af lv2=http\\\\://calf.sourceforge.net/plugins/Compressor:c=help test.mp3

Using lv2 plugin with ffmpeg:

ffmpeg -i 'test.mp3' -af "lv2=p=https\\\\://github.com/lucianodato/speech-denoiser" -ac 1 test.ogg

Using multiple lv2 plugins with ffmpeg:

ffmpeg -y -i noisy-record.mp3 -af "lv2=p=https\\\\://github.com/lucianodato/speech-denoiser, lv2=p=http\\\\://calf.sourceforge.net/plugins/Gate:c=threshold=0.04010706|knee=8|range=0.03148599, lv2=http\\\\://calf.sourceforge.net/plugins/Compressor:c=knee=8|threshold=0.125, lv2=http\\\\://calf.sourceforge.net/plugins/Limiter:c=level_out=0.71697748|limit=0.62763602" -q:a 5 -vbr on -ac 1 - cleaned.mp3

Using lv2 and built-in plugins together with ffmpeg:

ffmpeg -y -i "in.mp3" -af "lv2=p=https\\\\://github.com/lucianodato/speech-denoiser:c=mix=-22, dynaudnorm=f=500:g=31:p=0.95:s=20, lv2=http\\\\://calf.sourceforge.net/plugins/Limiter:c=level_out=0.71697748|limit=0.62763602" -q:a 5 -ac 1 test21.mp3

ffmpeg -y -i "in.mp3" -af "lv2=p=https\\\\://github.com/lucianodato/speech-denoiser:c=mix=-22, lv2=http\\\\://calf.sourceforge.net/plugins/Compressor:c=knee=8|threshold=0.125, dynaudnorm=f=500:g=31:p=0.95, lv2=http\\\\://calf.sourceforge.net/plugins/Limiter:c=level_out=0.71697748|limit=0.62763602" -q:a 5 -ac 1 test17.mp3

Process multiple audio using some plugins with ffmpeg:

find "audio/" -iname "*.mp3" | xargs -I {} ffmpeg -y -i "{}" -af "lv2=p=https\\\\://github.com/lucianodato/speech-denoiser:c=mix=-22, dynaudnorm=f=500:g=31:p=0.95:s=20, lv2=http\\\\://calf.sourceforge.net/plugins/Limiter:c=level_out=0.71697748|limit=0.62763602" -q:a 5 -ac 1 "{}.mp3"


Using LADSPA plugins

Default ladspa path: HOME/.ladspa/lib/, /usr/local/lib/ladspa/, /usr/lib/ladspa/

See available plugins in a file:

ffmpeg -i test.ogg -af ladspa=file=tap_pitch test.mp3

See available parameters for a plugins:

ffmpeg -i test.ogg -af ladspa=file=tap_pitch:p=tap_pitch:c=help test.mp3

Use a ladspa plugin:

ffmpeg -i test.ogg -af "ladspa=file=tap_pitch:p=tap_pitch:c=c0=1.9|c1=1.2" test.mp3

Reference:

https://bbs.archlinux.org/viewtopic.php?id=178327

m1gin 0

Tested with:

  • Ubuntu 19.10
  • mpv 0.29.1
  • ffmpeg 4.1.4

List available plugins in MPV

mpv -af=help

See available parameters in a plugin (for example agate):

mpv --af=agate=help

Using a plugin with mpv

  • mpv --af="lavfi=[agate=range=0.066:threshold=0.15:ratio=3]" test.ogg
  • mpv --af=lavfi='[ladspa=/home/user/.ladspa/rnnoise/librnnoise_ladspa.so:p=noise_suppressor_stereo:c=c0=44]' test.mp3
  • mpv --af=lavfi='[lv2=p=https\\://github.com/lucianodato/noise-repellent#adaptive-stereo:c=reduction=15|offset=4|smoothing=20]' test.ogg

Using multiple plugins / audio filters at the same time:

  • mpv --af="lavfi=[agate=range=0.066:threshold=0.45:ratio=3],lavfi=[alimiter=10:1:1:5:8000]" test.ogg
  • mpv --af='ladspa=/usr/lib/ladspa/tap_pitch.so:tap_pitch:[2.1,1.5,3]' --af-add='pan="mono|c0=c0"' test.ogg
  • mpv --af=lavfi='[ladspa=/usr/lib/ladspa/tap_pitch.so:tap_pitch:c=c0=2.1|c1=1.5|c2=3]' --af-add='pan="mono|c0=c0"' test.flac

TIP: Switch Between Audio Filters While MPV Playing

It is also possible to change audio filters in mpv on fly by assigning a hotkey in ~/.config/mpv/input.conf

# s cycle-values af "ladspa=/usr/lib/ladspa/tap_pitch.so:tap_pitch:[2.1,1.5]" ""

v cycle-values af "lavfi=[compand=0 0:1 1:-90/-900 -70/-70 -30/-12 -20/-6 0/-1:6:0:0:0]" "lavfi=[acompressor=6]" "lavfi=[loudnorm=i=-16:tp=-1]" "lavfi=[dynaudnorm=f=50:g=21:n=0:p=0.95:m=12:s=15]" "lavfi=[alimiter=10:1:1:5:8000]" "lavfi=[acompressor=threshold=0.13:ratio=4:attack=100:release=500:detection=rms]" "lavfi=[dynaudnorm=f=100:g=25:p=0.77]" "lavfi=[ladspa=/usr/lib/ladspa/tap_pitch.so:tap_pitch:c=c0=2.1|c1=1.5]" "lavfi=[alimiter=10:1:1:5:8000],lavfi=[ladspa=/usr/lib/ladspa/tap_pitch.so:tap_pitch:c=c0=2.1|c1=1.5]" ""

u cycle-values af "lavfi=[dynaudnorm=f=50:g=21:n=0:p=0.95:m=12:compress=11]" "pan=[mono|c0=c0]" "pan=[mono|c0=c1]" "lavfi=[lv2=p=https\\\\://github.com/lucianodato/speech-denoiser:c=mix=-22]" "lavfi=[lv2=p='https\\\\://github.com/lucianodato/noise-repellent':c=adaptive_noise_learn=1|noise_learn=1]" "lavfi=[ladspa=/home/user/.ladspa/rnnoise/librnnoise_ladspa.so:p=noise_suppressor_stereo:c=c0=11]" "lavfi=[ladspa=/usr/lib/ladspa/tap_pitch.so:tap_pitch:c=c0=2.1|c1=0.5|c2=3]" ""


Using LADSPA plugins in MPV

Default ladspa plugins path: ~/.ladspa/lib/, /usr/local/lib/ladspa/, /usr/lib/ladspa/

  • mpv --af=lavfi='[ladspa=/usr/lib/ladspa/tap_pitch.so:tap_pitch:c=c0=2.1|c1=1.5]' test.ogg
  • mpv '--af=lavfi=[ladspa=/usr/lib/ladspa/mbeq_1197.so:mbeq:c=c0=0|c1=0]' test.ogg

The following usage didn't work mpv v0.33

  • mpv --af=ladspa=/usr/lib/ladspa/tap_pitch.so:tap_pitch:[2.1,1.5] test.ogg

Using LV2 Plugins in MPV

list built-in filters:

  • mpv --af=lavfi=help

get parameters/options for a filter:

  • mpv --af=chorus=help
  • mpv --af=arnndn=help
  • mpv "--af=lavfi=lavfi=[highpass=200],lavfi=[lowpass=3000],lavfi=[afftdn=nf=-25]" test.ogg
  • mpv "--af=lavfi=[afftdn=noise_reduction=18:noise_floor=-25]" test.ogg
  • mpv --af=lavfi='[lv2=p=http\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=12]' test.ogg
  • mpv --af=lavfi='[lv2=http\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=12]' test.ogg
  • mpv --af=lavfi='[lv2=http\\://calf.sourceforge.net/plugins/VintageDelay:c=amount=3]' test.ogg

List installed lv2 plugins:

lv2ls

Get info about an installed plugin and see the parameters:

lv2info https://github.com/lucianodato/speech-denoiser

Print plugin control parameters and ranges

  • ffmpeg -f alsa -i pulse -af lv2=p=https\\\\://github.com/lucianodato/speech-denoiser:c=help test.mp3
  • ffmpeg -f alsa -i pulse -af lv2=http\\\\://calf.sourceforge.net/plugins/Compressor:c=help test.mp3
  • ffmpeg -f alsa -i pulse -af lv2='http\\://calf.sourceforge.net/plugins/Compressor:c=help' test.mp3
  • ffmpeg -f alsa -i pulse -af lv2='https\\://github.com/lucianodato/noise-repellent#adaptive':c=help test.mp3

Using Mixed Multiple Plugins with MPV

I don't know why all the LV2 plugins doesn't work with MPV. For example these didn't work:

  • mpv --af "lavfi=[aformat=channel_layouts=stereo],lv2=[https\\\\://github.com/lucianodato/speech-denoiser:c=mix=-22] " test.mp3 #DOESN'T WORK
  • mpv --af "lv2=[https\\\\://github.com/lucianodato/speech-denoiser:c=mix=-22] " "$f" #DOESN'T WORK
  • mpv --af "lv2=[https://github.com/lucianodato/speech-denoiser] " "$f" #DOESN'T WORK

The error message is similar to this one:

[ffmpeg] auto_resampler_0: Cannot select channel layout for the link between filters auto_resampler_0 and mpv_sink_out0.
[ffmpeg] auto_resampler_0: Unknown channel layouts not supported, try specifying a channel layout using 'aformat=channel_layouts=something'.
[lavfi] failed to configure the filter graph
Disabling filter lavfi.00 because it has failed.
[ao/pulse] The stream is suspended. Bailing out.


But the following works:

  • mpv --af=lavfi="[lv2=http\\\\://calf.sourceforge.net/plugins/Compressor:c=threshold=0.125|ratio=2.0]" test.mp3
  • mpv -af "lv2=[http://calf.sourceforge.net/plugins/VintageDelay],lavfi=[lv2=http\\\\://calf.sourceforge.net/plugins/HaasEnhancer:c=s_delay1=7.4]" test.mp3
  • mpv -af "lavfi=[aformat=channel_layouts=stereo],lv2=[urn:ardour:a-reverb]" test.mp3
  • mpv -af "lavfi=[aformat=channel_layouts=stereo],lv2=[http://calf.sourceforge.net/plugins/VintageDelay],lv2=[http://calf.sourceforge.net/plugins/HaasEnhancer]" test.mp3
  • mpv -af "lv2=[http://calf.sourceforge.net/plugins/VintageDelay],lv2=[http://calf.sourceforge.net/plugins/HaasEnhancer]" test.mp3
  • mpv -af "lv2=[http://calf.sourceforge.net/plugins/VintageDelay],lavfi=[aformat=channel_layouts=stereo],lv2=[urn:ardour:a-reverb]" test.mp3
  • mpv -af "lavfi=[aformat=channel_layouts=stereo],ladspa=/usr/lib/ladspa/tap_pitch.so:tap_pitch:[2.1,1.5]" test.mp3


ERRORS:

mpv --af="lavfi=[lv2=p=https://github.com/lucianodato/noise-repellent:c=adaptive_noise_learn=1|noise_learn=1]" test.mp3


error: attempt to map invalid URI `https'

SOLUTION:

  • mpv --af="lavfi=[lv2=p='https\\://github.com/lucianodato/noise-repellent':c=adaptive_noise_learn=1|noise_learn=1]" test.mp3
  • mpv --af=lavfi='[lv2=p=https\\://github.com/lucianodato/noise-repellent-stereo#new]' test.mp3



Add to: