AudioBarGraph in VLCKit

This forum is about all development around libVLC.
StreaminVid
New Cone
New Cone
Posts: 6
Joined: 15 Mar 2019 07:39

AudioBarGraph in VLCKit

Postby StreaminVid » 15 Mar 2019 07:51

Hello,

I'm using VLCKit in MacOS to play some audio streams and now I'm looking for a way to meter the audio. Is it possible to add the AudioBarGraph filter? This is what I'm trying in Swift:

Code: Select all

var outputPlayer: VLCMediaPlayer = VLCMediaPlayer() let videoURL = URL(string: theURL) let media = VLCMedia(url: videoURL!) media.addOptions([AnyHashable("--audio-filter=audiobargraph_a") : NSNull()]) media.addOptions([AnyHashable("--audiobargraph_a-bargraph=1") : NSNull()]) media.addOptions([AnyHashable("--sub-source=audiobargraph_v") : NSNull()]) outputPlayer.media = media outputPlayer.delegate = self outputPlayer.drawable = self.OutputPlayerView outputPlayer.play()
The player plays the stream from the URL, but I don't see an audiobargraph showing. Am I adding the options incorrectly or is this a feature that is not implemented in VLCkit?

Thanks,

Streamin'

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: AudioBarGraph in VLCKit

Postby Jean-Baptiste Kempf » 16 Mar 2019 19:09

Look at the logs. But I don't think you should pas the Options with --
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

StreaminVid
New Cone
New Cone
Posts: 6
Joined: 15 Mar 2019 07:39

Re: AudioBarGraph in VLCKit

Postby StreaminVid » 17 Mar 2019 00:09

Thanks for getting back to me on this. I don't see anything in the logs about these options. I've gotten rid of the "--" with the same result. I had high hopes for doing it this way:

Code: Select all

var outputPlayer: VLCMediaPlayer = VLCMediaPlayer() let videoURL = URL(string: theURL) let media = VLCMedia(url: videoURL!) media.addOptions([AnyHashable("audio-filter") : "audiobargraph_a"]) media.addOptions([AnyHashable("audiobargraph_a-bargraph") : 1]) media.addOptions([AnyHashable("sub-source") : "audiobargraph_v"]) outputPlayer.media = media outputPlayer.delegate = self outputPlayer.drawable = self.OutputPlayerView outputPlayer.play()
but I still get the video with no audio bar graph showing up. Any ideas?

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

Re: AudioBarGraph in VLCKit

Postby mfkl » 17 Mar 2019 11:55

Use

Code: Select all

:
instead of

Code: Select all

--
https://mfkl.github.io

StreaminVid
New Cone
New Cone
Posts: 6
Joined: 15 Mar 2019 07:39

Re: AudioBarGraph in VLCKit

Postby StreaminVid » 17 Mar 2019 21:11

You mean like this:

Code: Select all

media.addOptions([AnyHashable(":audio-filter=audiobargraph_a") : NSNull()]) media.addOptions([AnyHashable(":audiobargraph_a-bargraph=1") : NSNull()]) media.addOptions([AnyHashable(":sub-source=audiobargraph_v") : NSNull()])

or like this:

Code: Select all

media.addOptions([AnyHashable(":audio-filter") : "audiobargraph_a"]) media.addOptions([AnyHashable(":audiobargraph_a-bargraph") : 1]) media.addOptions([AnyHashable(":sub-source") : "audiobargraph_v"])

Just tried both ways. Still no bar graph.

StreaminVid
New Cone
New Cone
Posts: 6
Joined: 15 Mar 2019 07:39

Re: AudioBarGraph in VLCKit

Postby StreaminVid » 17 Mar 2019 22:45

Just tried doing it this way:

Code: Select all

let myPlayerOptions = ["audio-filter=audiobargraph_a","audiobargraph_a-bargraph=1","sub-source=audiobargraph_v"] outputPlayer = VLCMediaPlayer.init(options: myPlayerOptions)

Still no bar graph. Interestingly... if I do it this way:

Code: Select all

let myPlayerOptions = ["--audio-filter=audiobargraph_a","--audiobargraph_a-bargraph=1","--sub-source=audiobargraph_v"] outputPlayer = VLCMediaPlayer.init(options: myPlayerOptions)

I end up getting a crash with this in the logs:

Code: Select all

vlc: unknown option or missing mandatory argument `--audiobargraph_a-bargraph=1'

While all other methods of supplying those options that I've tried go seemingly unnoticed, this method has gotten some attention and made a crash. Even more interesting is that it is the second parameter that is causing grief. Does that mean that the first parameter was accepted? Strange.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: AudioBarGraph in VLCKit

Postby Jean-Baptiste Kempf » 18 Mar 2019 19:55

Did you recompile VLCKit?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

StreaminVid
New Cone
New Cone
Posts: 6
Joined: 15 Mar 2019 07:39

Re: AudioBarGraph in VLCKit

Postby StreaminVid » 18 Mar 2019 21:21

Hmm... I'm not sure, actually. I added the framework to my Xcode project using a POD file. When I built my app for the first time, I'm not sure if it compiled VLCKit or just used a pre-compiled framework. I suspect that it was pre-compiled and I've never recompiled it. Are there changes that I need to make to the framework itself?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: AudioBarGraph in VLCKit

Postby Jean-Baptiste Kempf » 20 Mar 2019 08:17

Maybe, and that is hard.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: AudioBarGraph in VLCKit

Postby sherington » 20 Mar 2019 10:06

I don't know VLCKit, but for your "unknown or missing mandatory argument --audiobargraph_a-bargraph=1" error, you could try passing "--audiobargraph_a-bargraph" and "1" as separate options.

However...

I was just testing this In my own bindings and I can get an empty audio bar-graph to appear, but it does not receive data to render the levels.

I think I remember reading somewhere on these forums or in the Trac, that things like audio filters don't (can't?) work this way through LibVLC. IIRC someone wanted to use the audio compressor module and it was stated that it wouldn't work.

And then there's the usual caveat of using these options/arguments/switches via libvlc_new is not supported anyway.

I just found the related post here https://forum.videolan.org/viewtopic.php?t=143056.

So maybe you're stuck.

StreaminVid
New Cone
New Cone
Posts: 6
Joined: 15 Mar 2019 07:39

Re: AudioBarGraph in VLCKit

Postby StreaminVid » 20 Mar 2019 17:39

Ok, thank guys. I'm going to pull this feature from my app requirements for the time being. I went into this thinking that it might be an easy, supported option to just turn on and this does not appear to be the case. I'll keep checking in on VLCKit development from time to time and if things change, I'll add this feature into my app.

Thanks again for the help and guidance.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: AudioBarGraph in VLCKit

Postby Jean-Baptiste Kempf » 21 Mar 2019 19:40

You should open a bug, though, on VLCKit repo.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 27 guests