Getting Each h264 Frame

Tim Müller tim at centricular.com
Tue Jan 28 16:30:36 PST 2014


On Tue, 2014-01-28 at 08:16 -0600, Timm Murray wrote:

> My app requires fetching each frame of an h264 stream, wrapping the
> frame in custom headers, and then sending it over the network.

Then you probably want something like:

  .. ! h264parse !
video/x-h264,alignment=au,stream-format=byte-stream ! ...

(or just stream-format=avc which implies frame alignment already, if you
don't want annex-b type data).

 Cheers
  -Tim

> For testing, I'm using a raw .h264 file and trying to fetch each frame
> in a fakesink.  On the command line, it's similar to this:
> 
> $ gst-launch-0.10 filesrc location=in.h264 ! h264parse ! filesink
> location=out.h264
> 
> 
> I would have expected out.h264 to be identical to in.h264.  And they
> are the right size, but there are slight differences between them:
> 
> $ ls -l in.h264 out.h264
> -rw-r--r-- 1 user group 100495 Jan 19 17:00 in.h264
> -rw-r--r-- 1 user group 100495 Jan 28 08:00 out.h264
> $ sha1sum in.h264 out.h264 
> 2046b04ed23d3980d35c4819a97358113beb0f6c  in.h264
> ef8233787e025dfc8aeb4b8f1a245014bb43d528  out.h264
> 
> 
> Looking at them in a hex editor, in.h264 starts with 0x00000001, and
> out.h264 starts with 0x0000000A.  There are a few other differences
> here and there, too.  It's enough that mplayer doesn't detect the
> right filetype and refuses to play in (in.h264 plays fine).
> 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com



More information about the gstreamer-devel mailing list