Trying to stream webcam with VLC, video works but no audio
by MirceaKitsune from LinuxQuestions.org on (#5NHR2)
I created a bash script a while back to stream my webcam to http with VLC. The line I used was:
Code:cvlc -vvv v4l2:///dev/video0 input_stream --sout '#transcode{vcodec=MJPG,vb=0,scale=1,acodec=none}:standard{access=http,mux=mpjpeg,dst=:1234}'That works fine but no audio. I've been trying to update it to capture sound from the webcam as well, but nothing I do seems to get that working. I know the ALSA address of the mic which is "hw:2,0" and using the arecord command as a test confirms it works, it's just vlc that isn't capturing or streaming accordingly. Here's the latest command I managed to work out, video is functional but no audio:
Code:cvlc -vvv v4l2:///dev/video0 alsa://hw:2,0 --live-caching=5000 --sout '#transcode{vcodec=h264,vb=1024,acodec=mpga,ab=128,samplerate=44100,channels=2}:standard{access=http,mux=ffmpeg{mux=flv},dst=:1234}'What is wrong with it and how do you recommend improving this? Thanks.
Code:cvlc -vvv v4l2:///dev/video0 input_stream --sout '#transcode{vcodec=MJPG,vb=0,scale=1,acodec=none}:standard{access=http,mux=mpjpeg,dst=:1234}'That works fine but no audio. I've been trying to update it to capture sound from the webcam as well, but nothing I do seems to get that working. I know the ALSA address of the mic which is "hw:2,0" and using the arecord command as a test confirms it works, it's just vlc that isn't capturing or streaming accordingly. Here's the latest command I managed to work out, video is functional but no audio:
Code:cvlc -vvv v4l2:///dev/video0 alsa://hw:2,0 --live-caching=5000 --sout '#transcode{vcodec=h264,vb=1024,acodec=mpga,ab=128,samplerate=44100,channels=2}:standard{access=http,mux=ffmpeg{mux=flv},dst=:1234}'What is wrong with it and how do you recommend improving this? Thanks.