[gst-devel] num-buffers to limit capture time?

David Liontooth liontooth at cogweb.net
Tue Oct 3 23:02:06 CEST 2006


I need to limit capture time in a script, and someone suggested using num-buffers.

I did this sort of thing in a bash script:

# Convert time in seconds to NTSC frames for use with num-buffers 
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.

The capture does not stop after $TIM seconds. What am I doing wrong?

Where can I find this fully documented? I'm seeing some general information on buffers at http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-data.html, but nothing I can use.

Dave





More information about the gstreamer-devel mailing list