[Linux-uvc-devel] How to record audio and video from a webcam?
bnc at astronomicalresearchaustralia.org
Sat Oct 20 03:44:51 CEST 2007
> Any updates on this?
> (application to record synchronized video and audio from webcam...
> something like luvcview but with sound support)
I posted a similar question some months back and posted the 'solution'
below. However, I too would like to get both working in an app.
Both luvcview and Motion do not do it as far as I can tell.
Anyway I have been playing around for a week and finally got some sound
output. Below is what I did in case you need it.
1)This gives you the number of the usb sound card in my case it was 2/0
0 [Live ]: EMU10K1 - SBLive! Value [CT4832]
SBLive! Value [CT4832] (rev.6, serial:0x80271102) at 0xc800, irq 217
1 [V8235 ]: VIA8233 - VIA 8235
VIA 8235 with ALC650F at 0xe000, irq 193
2 [U0x46d0x8c1 ]: USB-Audio - USB Device 0x46d:0x8c1
USB Device 0x46d:0x8c1 at usb-0000:00:10.3-2, high speed
2) I assume you have alsa available and can issue alsa commands.
aplay -h will give you what formats are available and it is a matter of
finding one that works for your camera, mine worked with this
arecord -D plughw:2,0 -c 1 -f S16_LE --buffer-size=48000 -v | aplay -f
S16_LE -c 1 --buffer-size=48000 -v
The w:2,0 is the card number
The -c 1 says only one channel but I do not think this works.
The -f is my chosen format, -f cd also worked
The buffer is to prevent underruns it defaults to 24000
All this is piped into aplay and the sound comes out of my speakers.
Now all I have to figure out is how to put both this and the luvcview
output into an avi.
Hope this is of some interest and would like to know if you come across
a better way.
More information about the Linux-uvc-devel