I’ve had a few queries regarding streaming audio as well as video on the Raspberry Pi, so tonight I set up my little Raspberry Pi with a Logitech C110. This webcam also has a microphone integrated which the Pi can use to record audio.
Everything has been setup as per part 3 of my ffmpeg streaming guide.
A little investigation reveals which hardware device the microphone is recognised as.
# arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: C110 [Webcam C110], device 0: USB Audio [USB Audio]
Subdevice #0: subdevice #0
So the device is recognised as card 1. This comes in later when we are setting up the audio part of the streaming.
I’ve updated the webcam.sh script to reflect the fact that we are now recording sound –
ffserver -f /root/ff.conf & ffmpeg -vcodec mjpeg -v verbose -r 15 -s 176x128 -f video4linux2 -i /dev/video0 -f alsa -ac 1 -i hw:1 http://localhost:81/webcam.ffm
And I also need to update ff.conf with the new streaming settings
The Stream webcam section has now turned into this –
With this configuration, I could start ffmpeg with audio and video streaming. However I could not get my laptop with vlc to connect to it for now, so I’ll have to keep investigating that.
Hopefully this helps though.
Please support the continued development of any useful scripts and tutorials that you have found useful !