Audio Level of A Duplicated Media

This forum is about all development around libVLC.
Moriquendi
Blank Cone
Blank Cone
Posts: 74
Joined: 31 May 2011 16:22

Audio Level of A Duplicated Media

Postby Moriquendi » 25 Oct 2018 16:48

Hello everyone,

I can control audio level of a media using "libvlc_audio_set_volume" function. However, once I duplicate the media as given with the code below:

Code: Select all

:sout=#duplicate{dst=display, dst=std{access=file,mux=ts,dst=save.ts}}
I can no longer change the volume by any means. I want to change only the displayed part volume of the duplicated media.

Any help would be appreciated.

Cheers.

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

Re: Audio Level of A Duplicated Media

Postby mfkl » 29 Oct 2018 03:47

I don't think I understand what you're trying to achieve. What's the "displayed part volume"?
https://mfkl.github.io

Moriquendi
Blank Cone
Blank Cone
Posts: 74
Joined: 31 May 2011 16:22

Re: Audio Level of A Duplicated Media

Postby Moriquendi » 30 Oct 2018 07:26

Yeah, sorry for the poor explanation. Basically what I am trying to say is that, I can control the audio level of a media using "libvlc_audio_set_volume". However, if I duplicate the media, for example;

Code: Select all

:sout=#duplicate{dst=display, dst=std{access=file,mux=ts,dst=save.ts}}
I can no longer change the volume of the media. Is there any way to control the audio level for a duplicated media?

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

Re: Audio Level of A Duplicated Media

Postby mfkl » 30 Oct 2018 08:56

Is there any way to control the audio level for a duplicated media?
Stricly using libvlc, you could use

Code: Select all

libvlc_media_duplicate
and then call

Code: Select all

libvlc_audio_set_volume
with the duplicate media reference.

Using the CLI args I don't know.
https://mfkl.github.io

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

Re: Audio Level of A Duplicated Media

Postby Rémi Denis-Courmont » 30 Oct 2018 19:55

By design, output controls cannot apply to stream output. It does not work in the VLC media player either.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Moriquendi
Blank Cone
Blank Cone
Posts: 74
Joined: 31 May 2011 16:22

Re: Audio Level of A Duplicated Media

Postby Moriquendi » 31 Oct 2018 15:05

Hi Remi,
By design, output controls cannot apply to stream output. It does not work in the VLC media player either.
I just tried this again using VLC 2.2.8 and it actually works from the GUI. This is the steps I followed;

1. Connect two PC on the same network. Let's call them PC1 and PC2.
2. Open VLC on PC1.
3. Media->Stream...->Network Tab
4. udp://@:44001 (I have a valid stream on the PC1 already)
5. Press "Stream" button. Press "Next"
6. Check "Display locally". New destination as "UDP (legacy)". Press "Add".
7. Enter "Address" (192.20.20.102) and "Port" (1234) and Press "Next".
8. Press "Next"
9. Press "Stream"

I can watch the stream on PC2 on port 1234 and I can change the volume of the media on PC1 by using VLC audio controls. I am almost positive that this works on VLC 3.0.3 as well.

As mfkl suggested, I tried duplicating media (using libvlc api) and using a second player. However since both media players try to access to the same udp address, I can either only display the media or stream to the second PC (PC2 in our example).

Is there any method (other than "libvlc_audio_set_volume" function) to change the volume of the stream output? Or whats the method VLC player uses, so maybe I can use it as well?

Cheers.

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

Re: Audio Level of A Duplicated Media

Postby Rémi Denis-Courmont » 31 Oct 2018 20:51

I just tried this again using VLC 2.2.8 and it actually works from the
No it does not work in 2.x any better than 3.x. There are no ways to achieve that in VLC or LibVLC.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Moriquendi
Blank Cone
Blank Cone
Posts: 74
Joined: 31 May 2011 16:22

Re: Audio Level of A Duplicated Media

Postby Moriquendi » 01 Nov 2018 06:39

Hi Remi,

I think there is a misunderstanding. I just tried this scenario in VLC 3.0.3 and it works. Please check this image out. https://imgur.com/a/XSN4UzT

Basically I have an input source and two PCs. Lets call them PC1 and PC2. PC1 has two ethernet adapters.

* The input source is coming from udp://@:44001 over ETH1.
* I open VLC 3.0.3. Media --> Stream... --> Network Tab
* I enter network URL (udp://@:44001)
* Pressing "Stream" and "Next" buttons.
* I check "Display locally" box. I choose New Destination as "UDP (legacy)" from the combobox and press "Add".
* I enter "Address" (192.20.20.102). This is the ethernet adapter address of PC2. For port I enter "1234" and press "Next".
* I press "Next" again.
* Generated stream output string is automatically formed as ":sout=#duplicate{dst=udp{dst=192.20.20.102:1234},dst=display} :no-sout-all :sout-keep"
* I press "Stream".

Now I can watch the stream on both PC1 and PC2. However, I am only interested in changing the volume of the media on PC1. Which is equaivalent of the dst=display part of the duplicated media. And I can change the volume of the media on PC1 using VLC 3.0.3. I do NOT want to change the volume of the media streamed to PC2.

I hope I could explain my problem well enough.

Cheers.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 3 guests