Question about audio streams inside vlc's core

This forum is about all development around libVLC.
XilasZ
Developer
Developer
Posts: 189
Joined: 16 Jun 2009 20:35

Question about audio streams inside vlc's core

Postby XilasZ » 29 Sep 2010 15:54

Hi,

I'm thinking about developping a plugin to upmix/downmix/resample the audio (using ac3filter's core, the same way i did it for winamp). That requires the possibility to select the output settings manually.

I read this page http://wiki.videolan.org/Documentation: ... dio_Output, and if i understand correctly, it's the core of vlc which decide the output settings (number of channels, sample rate, ...) based on the input and the audio devices, and then choose filters to adapt the stream if necessary.

That would that it's not possible to make such a plugin with the current vlc.

Am i right ? or is there a way to do it ?

Thanks for your help.

Rémi Denis-Courmont
Developer
Developer
Posts: 15148
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Question about audio streams inside vlc's core

Postby Rémi Denis-Courmont » 01 Oct 2010 11:39

No. The decoder decides on the audio parameters based on the input codec. Then the decoded audio is passed through configured audio filters (if any), which are free to change its parameters. And last, the filtered audio is fed to the audio output.

Generally, audio filters and the audio output are expected to match the output from the previous element as much as possible. If however, and only if, they request a different format, then the VLC core will insert further conversion filters so that the whole chain can be connected: channels mixer, resampler and/or sample format conversion.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

XilasZ
Developer
Developer
Posts: 189
Joined: 16 Jun 2009 20:35

Re: Question about audio streams inside vlc's core

Postby XilasZ » 01 Oct 2010 13:32

So, it's possible to make an audio filter which upmix the audio from stereo to 5.1 (for instance).

After that, the audio output will just play 5.1 ? The vlc core won't insert another filter to downmix ?

Rémi Denis-Courmont
Developer
Developer
Posts: 15148
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Question about audio streams inside vlc's core

Postby Rémi Denis-Courmont » 01 Oct 2010 13:42

Depends if the audio output accepts 5.1
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

XilasZ
Developer
Developer
Posts: 189
Joined: 16 Jun 2009 20:35

Re: Question about audio streams inside vlc's core

Postby XilasZ » 01 Oct 2010 14:00

Yes of course. I just checked the code of both aout_directx and waveout (the goal is for windows, the lib from ac3filter's core is for windows only and has never been ported to unix), they both have 5.1 related code, so that should work i guess.

I'll make some tests when i'll have some time (such as duplicate the stereo to 4.0, it should be fast and easy to do).

XilasZ
Developer
Developer
Posts: 189
Joined: 16 Jun 2009 20:35

Re: Question about audio streams inside vlc's core

Postby XilasZ » 09 Oct 2010 12:06

Hi, after reading your answers, i though it was possible to force channels number and sampling rate in an audio filter, and that the output module would just adapt to the news settings.
But instead it's locked, and if vlc decided it was stereo, even if an audio filter upmix it to 5.1, vlc just insert another filter behind to revert back to stereo, or just plays the 5.1 signal as stereo.

I guess i can't do the same as i did with winamp (insert a filter, change settings, and force the output behind).

I'll try something else : copy an output plugin (directx or waveout) and insert my processing directly inside.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 2 guests