Capturing jpegs from an h264 stream

Alex Hewson mock at mocko.org.uk
Fri Jun 7 01:13:28 PDT 2013


On 07/06/2013 07:31, Tim-Philipp Müller wrote:
> Hi,
>
> I think framerate=25 will make the framerate field an integer type field, which will cause not-negotiated errors. Use framerate=25/1 instead.
>
> But also, a capssetter directly after decodebin is probably not right (if decodebin outputs caps with a different framerate you'll also get an error).

Cool.  I've modified my pipeline to be:

raspivid -n -t 1000000 -vf -b 2000000 -fps 25 -o - |   \
   gst-launch-1.0 fdsrc fd=0 ! decodebin \
     ! capssetter caps='video/x-raw,framerate=25/1' replace=true ! 
videorate \
     ! video/x-raw,framerate=1/1 ! videorate ! jpegenc quality=75 \
     ! multifilesink location='img_%04d.jpg'

What I get now is:

root at raspberrypi:~/streamtest# ./l2.sh
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...

(gst-launch-1.0:8069): GStreamer-WARNING **: 
gstpad.c:4503:store_sticky_event:<typefind:src> Sticky event 
misordering, got 'caps' before 'stream-start'
ERROR: from element 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0: 
Internal data stream error.
Additional debug info:
gstomxvideodec.c(1670): gst_omx_video_dec_loop (): 
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstOMXH264Dec-omxh264dec:omxh264dec-omxh264dec0:
stream stopped, reason not-negotiated
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

So the error as you predicted.


Now let's try putting the capssetter before decodebin...

raspivid -n -t 1000000 -vf -b 2000000 -fps 25 -o - |   \
   gst-launch-1.0 fdsrc fd=0 ! capssetter 
caps='video/x-raw,framerate=25/1' replace=true \
     ! decodebin ! videorate \
     ! video/x-raw,framerate=1/1 ! videorate ! jpegenc quality=75 \
     ! multifilesink location='img_%04d.jpg'

root at raspberrypi:~/streamtest# ./l2.sh
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...

(gst-launch-1.0:8124): GStreamer-WARNING **: 
gstpad.c:4503:store_sticky_event:<typefind:src> Sticky event 
misordering, got 'caps' before 'stream-start'
...sticks in 'prerolling' forever.


So no joy I'm afraid!


Cheers,
Alex.



-- 
Alex Hewson
m: +44 7895 265219 | e: mock at mocko.org.uk | Skype: alex.hewson



More information about the gstreamer-devel mailing list