How to capture audio using v4l2

Charlie X. Liu charlie at sensoray.com
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
ALSA <http://en.wikipedia.org/wiki/Advanced_Linux_Sound_Architecture>
devices. Then, you would see them like hw:x,0. 

For example, if you use a Sensoray Model 811
<http://www.sensoray.com/products/811.htm>  or Model 812
<http://www.sensoray.com/products/812.htm>  / Model 1012
<http://www.sensoray.com/products/1012.htm> , 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
location=./audio-ch2.wav

  ( 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 lists.freedesktop.org]
On Behalf Of Baby Octopus
Sent: Sunday, June 08, 2014 8:13 AM
To: gstreamer-devel at lists.freedesktop.org
Subject: How to capture audio using v4l2

 

Hi,

 

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?

 

~BO

 

 

 

--

View this message in context:
<http://gstreamer-devel.966125.n4.nabble.com/How-to-capture-audio-using-v4l2
-tp4667420.html>
http://gstreamer-devel.966125.n4.nabble.com/How-to-capture-audio-using-v4l2-
tp4667420.html

Sent from the GStreamer-devel mailing list archive at Nabble.com.

_______________________________________________

gstreamer-devel mailing list

 <mailto:gstreamer-devel at lists.freedesktop.org>
gstreamer-devel at lists.freedesktop.org

 <http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel>
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140609/1d1d5137/attachment.html>


More information about the gstreamer-devel mailing list