[gst-devel] v4l2src

David Liontooth liontooth at cogweb.net
Fri Sep 29 20:38:09 CEST 2006


ensonic wrote:
> hi,
>
> you can use the num-buffers property of v4l2src (number of frames in this
> case).
>   
Thanks! That's an elegant solution:

# Convert time in seconds to NTSC frames
FRAMES=$[$[TIM*30000]/1001]

echo "Initiating recording of $FIL from channel $1"
echo "on capture card $DEV, at $(date +%T), duration $TIM seconds"

gst-launch-0.10 oggmux name=mux ! filesink location=$DIR/$FIL.avi
v4l2src device=/dev/video$DEV num-buffers=$FRAMES ! \
video/x-raw-yuv,width=640,height=480,framerate=\(fraction\)30000/1001 !
ffmpegcolorspace ! theoraenc ! queue ! mux. alsasrc \
device=hw:$DEV ! audio/x-raw-int,channels=2,rate=32000,depth=16 !
audioconvert ! vorbisenc ! mux.

I still don't think I'm really getting sound though -- perhaps I should
try the trick suggested on
http://linuxtv.org/v4lwiki/index.php/Saa7134-alsa:

    arecord -D hw:$DEV,0 -r 32000 -c 2 -f S16_LE | aplay -

But how do I pipe this to gstreamer?

Now if only Marillat will package the gstreamer ffmpeg encoders for
Debian...

Cheers,
David

> Stefan
>
> On 7:54:16 am 29/09/2006 David Liontooth <liontooth at cogweb.net> wrote:
>   
>> I just discovered the v4l2src plugin (it recently made it into
>> Debian), and tested it against some saa713x tv cards:
>>
>> gst-launch-0.10 oggmux name=mux ! filesink location=/tv7/test0.ogg
>> v4l2src device=/dev/video2 !
>> video/x-raw-yuv,width=640,height=480,framerate=\(fraction\)30000/1001
>> ! ffmpegcolorspace ! theoraenc ! queue ! mux. alsasrc
>> device=hw:2,0 ! audio/x-raw-int,channels=2,rate=32000,depth=16 !
>> audioconvert ! vorbisenc ! mux.
>>
>> These cards have 32000Hz audio output, and gstreamer didn't appear to
>> detect this, so I had to add it manually. The picture is good, and the
>> file claims to have sound:
>>
>> Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
>> AUDIO: 32000 Hz, 2 ch, s16le, 112.0 kbit/10.94% (ratio: 14000->128000)
>> Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis decoder)
>> ======================================================================
>> ====
>> alsa-init: using device default
>> alsa: 32000 Hz/2 channels/4 bpf/65536 bytes buffer/Signed 16 bit
>> Little Endian
>> AO: [alsa] 32000Hz 2ch s16le (2 bytes per sample)
>> Starting playback...
>> A:  27.2 V:  27.3 A-V: -0.140 ct: -0.019 818/818 29%  1%  0.7% 0 0
>>
>> ... but in fact I cannot hear anything. Suggestions welcome.
>>
>> How can I tell gstreamer to stop capturing after n minutes?
>>
>> Dave
>>
>> ----------------------------------------------------------------------
>> ---
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to
>> share your opinions on IT & business topics through brief surveys --
>> and earn cash http://www.techsay.com/default.php?page=join.php&p=sourc
>> eforge&CID=DEVDEV
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>     
>
>   





More information about the gstreamer-devel mailing list