Page 1 of 1

libVLC and AudioBarGraph filter

Posted: 26 Oct 2015 14:22
by ampi
Hi,

I'm using libVLC in a .NET application (C#) and it works like a charm!
Now I want to use the audiobargraph filter but it doesn't work.

I'm using libVLC this way :

VlcInstance class

Code: Select all

internal IntPtr Handle; public VlcInstance() { List<string> vlcArgs = new List<string>(); vlcArgs.Add("--audio-filter=audiobargraph_a"); vlcArgs.Add("--audiobargraph_a-bargraph=1"); vlcArgs.Add("--sub-source=audiobargraph_v"); this.Handle = LibVlc.libvlc_new(vlcArgs.Count, vlcArgs.ToArray()); if (this.Handle == IntPtr.Zero) throw new VlcException(); }
VlcMediaPlayer class

Code: Select all

internal IntPtr Handle; public VlcMediaPlayer(VlcInstance instance) { if (instance.Handle != IntPtr.Zero) this.Handle = LibVlc.libvlc_media_player_new(instance.Handle); if (Handle == IntPtr.Zero) throw new VlcException(); } private IntPtr _pDrawable; public IntPtr Drawable { get { return _pDrawable; } set { if (Handle != IntPtr.Zero) { LibVlc.libvlc_media_player_set_hwnd(Handle, value); _pDrawable = value; } else throw new VlcException(); } } public VlcMedia Media { get { IntPtr media = LibVlc.libvlc_media_player_get_media(Handle); if (media == IntPtr.Zero) return null; return new VlcMedia(media); } set { LibVlc.libvlc_media_player_set_media(Handle, value.Handle); } }
VlcMedia class

Code: Select all

internal IntPtr Handle; public VlcMedia(VlcInstance instance) { this.Handle = LibVlc.libvlc_media_new_as_node(instance.Handle, "mediaName"); if (Handle == IntPtr.Zero) throw new VlcException(); }
Application class

Code: Select all

using (VlcMedia media = new VlcMedia(_vlcInstance, url)) { if (_vlcPlayer == null) _vlcPlayer = new VlcMediaPlayer(media); else _vlcPlayer.Media = media; } _vlcPlayer.Drawable = PreviewPictureBox.Handle; _vlcPlayer.Play();
The audio meter is present but not showing audio levels:

Image

I've started vlc with the same args and it works flawlessly:

Code: Select all

vlc "rtp://@239.239.239.239:51416" --audio-filter=audiobargraph_a --audiobargraph_a-bargraph=1 --sub-source=audiobargraph_v
Image

Am I doing something wrong? Is it possible to use audiobargraph in libVLC? If not, anybody got a workaround to integrate audiobargraph in .NET application?

Many thanks,
ampi.

Re: libVLC and AudioBarGraph filter

Posted: 26 Oct 2015 14:27
by RĂ©mi Denis-Courmont
1) N/A. 2) Not so far.

Re: libVLC and AudioBarGraph filter

Posted: 30 Oct 2015 18:40
by Jean-Baptiste Kempf
Did you check the log to see if both modules were loaded?

Re: libVLC and AudioBarGraph filter

Posted: 12 May 2016 19:01
by zoidber_isid
Hi all. I'm working too in the audiobargraph over a video using libVLC. I have the same issue than ampi (using C++ instead of C#) and I'm developing with libVLC 2.2.0. I've read a thousand threads looking for the way to show audiobar using libvlc and no one showed me the light.
Is there any improvement in libVLC that allows me to show correctly the audiobargraph?

Regards from Discworld's fan. :D

Re: libVLC and AudioBarGraph filter

Posted: 28 Jun 2016 10:11
by Jean-Baptiste Kempf
It's not tested, but it should not be hard to fix, tbh.

Re: libVLC and AudioBarGraph filter

Posted: 24 Dec 2016 01:34
by AppStar
Any update on this? I have a similar problem where I can't enable the AudiooBarGraph in the Windows Universal VLC app. I'm using the same parameters in the PlaybackService.Initialize method but can only see a scale without audio bars just like the original post.

Ultimately I'd like to subscribe to or monitor the audio level to perform an action when a certain level is reached. This probably needs fixed before I can even attempt that.

Re: libVLC and AudioBarGraph filter

Posted: 27 Dec 2016 11:38
by Jean-Baptiste Kempf
So far, you cannot act on audiobargraph detection.

Re: libVLC and AudioBarGraph filter

Posted: 13 Oct 2017 15:45
by mklimo
Hi,
i am wondering if this is still an issue. I am trying to add audiobargraph using libvlc but only thing i get is empty scale without audio bars. I tried multiple libvlc versions including 3.0.0 nightlies.

Re: libVLC and AudioBarGraph filter

Posted: 16 Oct 2017 06:07
by Jean-Baptiste Kempf
Hi,
i am wondering if this is still an issue. I am trying to add audiobargraph using libvlc but only thing i get is empty scale without audio bars. I tried multiple libvlc versions including 3.0.0 nightlies.
It might have not been tested enough, tbh. Does it work with VLC desktop?

Re: libVLC and AudioBarGraph filter

Posted: 07 Nov 2017 10:41
by mklimo
Yes, its working flawlessly with almost all desktop VLC versions :)
Sorry for late response.

Re: libVLC and AudioBarGraph filter

Posted: 11 Nov 2017 14:40
by Jean-Baptiste Kempf
Yes, its working flawlessly with almost all desktop VLC versions :)
Sorry for late response.
That's weird. It could be that the sub-source is not loaded, but I don't see why.

Re: libVLC and AudioBarGraph filter

Posted: 15 Feb 2018 21:45
by cube45
Hello,
This is a follow-up of the issue posted here : https://github.com/ZeBobo5/Vlc.DotNet/issues/33

I just made some tests and saw that I have a lot of
[0000028a1df1c040] main subpicture warning: original picture size is undefined
(using vlc-3.0.0) in the logs

Here is the full log : https://pastebin.com/1njhqbM0

Is there an associated trac issue already?