Capturing jpegs from an h264 stream

Alex Hewson mock at mocko.org.uk
Sun Jun 9 14:37:25 PDT 2013


On 09/06/2013 13:54, Alex Hewson wrote:
> On 09/06/2013 12:04, Tim-Philipp Müller wrote:
>> You are using GStreamer git / 1.1.x judging by those sticky warnings. As
>> I mentioned, there's a [blocker] bug in 1.1.x which causes problems with
>> the timestamping. Perhaps you could try 1.0.7 as well?
>
> Something odd is going on here - perhaps over the numerous recompiles 
> I've left a fragment of 1.1 lying around on my pi.  I'm going to 
> remove all traces of gstreamer from the system and make it again with 
> a fresh build tree.  Will let you know how that goes.

After 434m, 55.916s I have a new build of gstreamer.  Let's see what 
happens...

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

set -e

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 !   \
   decodebin ! videorate ! video/x-raw,framerate=1/5 !   \
   videoconvert ! jpegenc ! multifilesink location=img_%04d.jpg


root at raspberrypi:~/streamtest# ./l2.sh
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^CCaught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 17793322411 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

root at raspberrypi:~/streamtest# ls -lh
total 1.6M
-rw-r--r-- 1 root root  45K Jun  9 20:35 img_0000.jpg
-rw-r--r-- 1 root root 183K Jun  9 20:35 img_0001.jpg
-rw-r--r-- 1 root root 190K Jun  9 20:35 img_0002.jpg


Forgive me for shouting on a mailing list but IT WORKS!

So you're absolutely right, there's a bug in part of 1.1 which prevents 
the use of gstreamer with raspivid.  I thought I'd purged every bit of 
1.1 from my system when I told that build script to check everything out 
from the 1.0 branch but apparently not.  Hosing down my system and 
rebuilding 1.0 from scratch has cleared it.

Thanks to everyone who helped.  We got there in the end and I'll be sure 
to share the solution with the rest of the Raspberry Pi community.

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



More information about the gstreamer-devel mailing list