How to capture audio using v4l2

Charlie X. Liu charlie at
Mon Jun 9 17:51:08 PDT 2014

In the newer 2.6 and 3.x.y Linux kernels, the audio devices should be as
devices. Then, you would see them like hw:x,0. 

For example, if you use a Sensoray Model 811
<>  or Model 812
<>  / Model 1012
<> , you could use following
GSTreamer commands to capture audio from different channels:


$ gst-launch-0.10 alsasrc device=hw:1,0 !
audio/x-raw-int,rate=32000,channels=2,depth=16 ! audioconvert! autoaudiosink

  ( pre-listening, from audio Channel-1 )


$ gst-launch-0.10 alsasrc device=hw:2,0 ! wavenc ! filesink

  ( capturing raw audio, from audio Channel-2, and saving the data into a
.wav file )


$ gst-launch-0.10 alsasrc device=hw:3,0 ! audioconvert ! vorbisenc ! oggmux
! filesink location=./audio-ch3.ogg

  ( capturing audio, from audio Channel-3, encoding with vorbis and saving
the data into an .ogg file )


$ gst-launch-0.10 alsasrc device=hw:4,0 ! audio/x-raw-int,rate=
32000,channels=2,depth=16 ! audioconvert! avimux ! 

filesink location=./audio-ch4.avi

  ( capturing raw audio, from audio Channel-4, using avi muxer and saving
the audio data into an .avi file )



-----Original Message-----
From: gstreamer-devel [mailto:gstreamer-devel-bounces at]
On Behalf Of Baby Octopus
Sent: Sunday, June 08, 2014 8:13 AM
To: gstreamer-devel at
Subject: How to capture audio using v4l2




I'm wondering to capture audio from a device which supports v4l2. I dont
quite see any audio/x-raw caps in v4l2src element


Can someone please explain?







View this message in context:

Sent from the GStreamer-devel mailing list archive at


gstreamer-devel mailing list

 <mailto:gstreamer-devel at>
gstreamer-devel at


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gstreamer-devel mailing list