Page 1 of 1

Streaming and recording webcam with sound

Posted: 17 Jun 2023 13:31
by NicolasS
Hi,

I am developing a small application with libvlc whose purpose is to stream and record video from a webcam.

For the moment, it works fine by sound is missing.

And now, I wish to add sound. In the command line, I do:
vlc v4l2:///dev/video0 :input-slave=pulse:// --gain=0 ...

But with libvlc I can't get the :input-slave: and --gain arguments to be considered.

I tried calling libvlc_new with these 2 arguments but still no sound.

I would like to know the right way to do it. If anyone has an idea, it would be great.

Thanks in advance for help.

Nicolas.

Re: Streaming and recording webcam with sound

Posted: 19 Jun 2023 06:42
by mfkl
I tried calling libvlc_new with these 2 arguments but still no sound.
Please share your actual code. And verbose logs.

look into libvlc_media_add_option also

Re: Streaming and recording webcam with sound

Posted: 19 Jun 2023 10:26
by NicolasS
Hi mfkl.

I have tried to use libvlc_media_add_option and it works with it.

Thanks for help. Now audio is working fine !