libVLCSharp Audio Filters Support

This forum is about all development around libVLC.
Martin4343
New Cone
New Cone
Posts: 5
Joined: 20 Apr 2020 22:03

libVLCSharp Audio Filters Support

Postby Martin4343 » 20 Apr 2020 22:17

I am trying to use audio filters dynamic range compressor or volume normalizer in a windows form application with libVLCSharp. I have tested the command line parameters in the actual command line and they work there. But it does not work with the following code. Any help is highly appreciated. I am trying to solve this for days now.

Code: Select all

Core.Initialize(); InitializeComponent(); _libVLC = new LibVLC(new string[] { "--audio-filter=compressor", "--compressor-rms-peak=0", "--compressor-attack=10", "--compressor-release=165", "--compressor-threshold=-30", "--compressor-ratio=20", "--compressor-knee=1", "--compressor-makeup-gain=19" }); _mp = new MediaPlayer(_libVLC); videoView1.MediaPlayer = _mp; _mp.Play(new Media(_libVLC, @"C:\Testfile.mp4", FromType.FromPath));
I have also tried using these parameters with Media.M.AddOption(string[] options), with the "--" syntax and with ":" syntax, but this does not work either.

Thanks
Martin

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: libVLCSharp Audio Filters Support

Postby mfkl » 21 Apr 2020 14:25

Looks like he got it working https://github.com/SimpleSandman/TwitchBot/blob/bf7344bc3e2aa03ca927d6b9f8fca873978ec3b6/TwitchBot/TwitchBot/Threads/LibVLCSharpPlayer.cs#L39

try with floats, i.e. `0.00` instead of `0`. Failing that, please provide full logs with `--verbose=2`
https://mfkl.github.io

Martin4343
New Cone
New Cone
Posts: 5
Joined: 20 Apr 2020 22:03

Re: libVLCSharp Audio Filters Support

Postby Martin4343 » 21 Apr 2020 20:51

Thank you for your reply.

I used the exact same command line spelling as in the link you sent:

Code: Select all

private readonly string[] _commandLineOptions = { //"--verbose=2", "--audio-filter=compressor", "--compressor-rms-peak=0.00", "--compressor-attack=24.00", "--compressor-release=250.00", "--compressor-threshold=-25.00", "--compressor-ratio=2.00", "--compressor-knee=4.50", "--compressor-makeup-gain=17.00" }; [...] _libVLC = new LibVLC(_commandLineOptions); [rest is the same...]
This doesn't work either. I created log files from the libVLCSharp application and also from calling VLC via the command line (using --file-logging) - here the compressor filter works on the same computer. Both are attached below. My observations from comparing the two:
- The cmd line log mentions "plug-ins loaded: 494 modules", libVLCSharp does not mention any plugins at all. ->Do I have to to something to explicitly load plugins? dll files are stored in the /bin folder of the application, libcompressor_plugin.dll is there.
- libVLCSharp uses 32 bit, the command line 64 bit - can this make a difference?

Martin4343
New Cone
New Cone
Posts: 5
Joined: 20 Apr 2020 22:03

Re: libVLCSharp Audio Filters Support

Postby Martin4343 » 21 Apr 2020 21:03

libVLCSharp logging - compressor filter does not work: [url]https://pastebin.com/ffKHWN5r[/url]

VLC from actual command line - compressor filter works: [url]https://pastebin.com/ymfivyvs[/url]

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: libVLCSharp Audio Filters Support

Postby mfkl » 22 Apr 2020 09:42

Do I have to to something to explicitly load plugins?
No, they're loaded fine.
libVLCSharp uses 32 bit, the command line 64 bit - can this make a difference?
I doubt it, but try.
https://mfkl.github.io

Martin4343
New Cone
New Cone
Posts: 5
Joined: 20 Apr 2020 22:03

Re: libVLCSharp Audio Filters Support

Postby Martin4343 » 22 Apr 2020 11:51

Ok Thanks.
- How can I force libVLCSharp to use 64 bit?
- Do you have any other ideas I can test?

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: libVLCSharp Audio Filters Support

Postby mfkl » 22 Apr 2020 13:34

- How can I force libVLCSharp to use 64 bit?
You build a 64 bits app in VS, and libvlcsharp will use 64 bits libvlc builds automatically.
- Do you have any other ideas I can test?
Not really... if this is a bug, you should try writing a C sample to reproduce in C to make a proper bug report.

You can start from there https://github.com/jeremyVignelles/TestLibvlcNative
https://mfkl.github.io

Martin4343
New Cone
New Cone
Posts: 5
Joined: 20 Apr 2020 22:03

Re: libVLCSharp Audio Filters Support

Postby Martin4343 » 24 Apr 2020 23:17

Hello everyone,

I did a lot more research and got the compressor filter working with all libvlc versions 2.1.x. With all versions starting from 2.2.0 or later the compressor does not work.

I had to test using the wrapper VLC.DotNet 2.2.1, because the libVLCSharp wrapper is only available from 3.0.0 or later and does not work with the old libVLC dlls. Anyway the functions used and the command line parameters I used are the same. Therefore I think the issue comes from libVLC.

-> What was changed from 2.1.5 to 2.2.0 that could cause the compressor command to not work in libVLC (--audio-filter=compressor)? The same command does work in the actual command line for the VLC application with higher versions (3.0.8) on the same computer. So whatever was changed seems to only affect the functionality if the dlls are called from custom code and not from the VLC application.

Any ideas?

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: libVLCSharp Audio Filters Support

Postby mfkl » 25 Apr 2020 21:25

Any ideas?
From your observations, it seems like this is a libvlc issue.

So
if this is a bug, you should try writing a C sample to reproduce in C to make a proper bug report.

You can start from there https://github.com/jeremyVignelles/TestLibvlcNative
Then you can make a ticket on https://trac.videolan.org/vlc/
https://mfkl.github.io


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 31 guests