Capturing jpegs from an h264 stream

Wes Miller wmiller at sdr.com
Tue Jun 4 06:32:19 PDT 2013


Ummm....  I haven't (can't) try this as I have no Raspberry Pi, but does this
actually work?

    raspivid -n -t 1000000 -vf -b 2000000 -fps 25 -o - |  \
    gst-launch-1.0 fdsrc fd=0 ! decodebin ! videorate !
    video/x-raw,framerate=1/1 ! jpegenc ! multifilesink
location=img_%03d.jpeg 

First, you're mssing a \ on line 2 (or it got lost in the posting).

This is a Linux pipeline married to a gst pipeline.  Does gst_launch accept
piped input?  Are you actually producing piped input? Should the Linux pipe
char (|) perhaps be && to launch both these commands at the same time and
(hope, hope, hope) get gst lunch to read from stdin (fd = 0) synchronously?  

And when it does read, the multifilesink is going to write one file per
jpeg/frame.  Is 1/1 a valid framerate?  What happens to the other 24 frames
per second?  Might you need a wrapper for the raspvid line that reruns the
command once per second so you only get 1 frame per second?  Or would that
lead to lexcess EOS's?  Or, perhaps put that wrapper around the whole
command?

#!/bin/bash
while (true) do
    sleep 1
    raspivid -n -t 1000000 -vf -b 2000000 -fps 25
-some_cmd_to_run_only_1_frame -o - &&  \
    gst-launch-1.0 fdsrc fd=0 ! decodebin ! videorate ! \
    video/x-raw,framerate=1/1 ! jpegenc ! multifilesink
location=img_%03d.jpeg 
done

Wes
   



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Capturing-jpegs-from-an-h264-stream-tp4660254p4660270.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list