Capturing jpegs from an h264 stream

Alex Hewson mock at mocko.org.uk
Fri Jun 7 02:23:17 PDT 2013


On 07/06/2013 10:14, Tim-Philipp Müller wrote:
> This works fine for me (with 1.0.x at least, there seems to be a bit of
> an issue with this in git master / 1.1.x though):
>
> cat /home/tpm/rpi/hello_pi/hello_video/test.h264 | gst-launch-1.0
> fdsrc ! video/x-h264,framerate=25/1,stream-format=byte-stream !
> h264parse ! avdec_h264 ! videorate ! video/x-raw,framerate=1/1 !
> videoconvert ! jpegenc ! multifilesink location=/tmp/img_%04d.jpg
Just tried the following on my pi:

root at raspberrypi:~/streamtest# cat l2.sh
#!/bin/bash

set -e

rm -f stream*.h264 img*.jpg snaps*

raspivid -n -t 1000000 -vf -b 2000000 -fps 25 -o - |   \
   gst-launch-1.0 fdsrc fd=0 \
     ! video/x-h264,framerate=25/1,stream-format=byte-stream \
     ! h264parse ! avdec_h264 ! videorate ! video/x-raw,framerate=1/1 \
     ! videoconvert ! jpegenc ! multifilesink location=/tmp/img_%04d.jpg

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

(gst-launch-1.0:8366): GStreamer-WARNING **: 
gstpad.c:4503:store_sticky_event:<capsfilter0:src> Sticky event 
misordering, got 'segment' before 'caps'

(gst-launch-1.0:8366): GStreamer-WARNING **: 
gstpad.c:4503:store_sticky_event:<h264parse0:sink> Sticky event 
misordering, got 'segment' before 'caps'
Redistribute latency...
^CCaught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...



Still sticks in prerolling, no jpegs emerge.

Tried also replacing my 'raspivid...' command with a simple 'cat 
testvideo.h264' but it makes no difference.


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



More information about the gstreamer-devel mailing list