[gst-devel] v4l2src
David Liontooth
liontooth at cogweb.net
Fri Sep 29 20:50:06 CEST 2006
David Liontooth wrote:
> 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'm obviously missing something -- setting the frames to the number of
seconds times 29.97 doesn't make the recording stop at the right time
and I had to interrupt it:
Preparing to record 2006-09-29_1132_KNBC_test
Initiating recording of 2006-09-29_1132_KNBC_test from channel 4,
on capture card 3, at 11:32:25, duration 115 seconds
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: audioclock0
Caught interrupt -- Pausing pipeline.
Pipeline paused.
WARNING: Element "pipeline0" warns: pipeline interrupted
Element "pipeline0" has gone from PLAYING to PAUSED, quitting.
Execution ended after 612376053000 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
FREEING pipeline ...
-rw-r--r-- 1 tv tv 22057627 2006-09-29 11:42
/stv1/2006/2006-09/2006-09-29/2006-09-29_1132_KNBC_test.avi
-rw-r--r-- 1 tv tv 10907 2006-09-29 11:42
/stv1/2006/2006-09/2006-09-29/2006-09-29_1132_KNBC_test.txt
Completed capture on Friday 29 September 2006 at 11:42:38
Video and audio file size 22M
Closed captioning file size 12K
Suggestions?
I'm still not getting sound of course -- otherwise things are working
well -- low cpu consumption, good quality.
Dave
> 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
>>>
>>>
>>
>>
>
>
> -------------------------------------------------------------------------
> 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=sourceforge&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