I run an RTSP server on my Raspberry Pi 3 by using cvlc
. I recently wanted to add audio as well but I can't the audio to work.
Here's my current cvlc
config:
cvlc \
v4l2:///dev/video0:chroma=h264:width=1280:height=720:input-slave=alsa://hw:1,0 \
--sout '#transcode{acodec=mpga,ab=128,channels=2,samplerate=44100,threads=4,audio-sync=1}:rtp{mux=ts,mime=video/ts,sdp=rtsp://:8080/stream.sdp}'
Right now I'm getting the following when I try to run this:
VLC media player 3.0.8 Vetinari (revision 3.0.8-0-gf350b6b5a7)
[00936060] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[00936060] main interface error: no suitable interface module
[008bc938] main libvlc error: interface "dbus,none" initialization failed
[0093b7e8] main interface error: no suitable interface module
[008bc938] main libvlc error: interface "globalhotkeys,none" initialization failed
[0093b850] dummy interface: using the dummy interface module...
I don't have any monitor attached to my Raspberry Pi so all this output seems ~fine. However, when I stream via VLC -- I don't hear any audio. Looking at the stream statistics in VLC, no audio is being received?
I've verified the audio is at hw:1,0
using arecord
:
$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: C920 [HD Pro Webcam C920], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
How can I troubleshoot this? Would it be possible to capture audio from the webcam and push it to the headphone jack so I can verify audio is being picked up? Is there some sort of pulseaudio/alsa configuration I should check?