[gst-devel] what format is exchanged between qtdemux and ffdec_h264

Wim Taymans wim.taymans at gmail.com
Fri Oct 3 11:26:41 CEST 2008


On Thu, 2008-10-02 at 09:53 +0200, franchan wrote:
> Hello,
> 
> I'm asked to create a gstreamer plug-in using a proprietary h264
> decoder library (binary only :-(.
> I based myself on the many gstreamer plug-ins.
> So implementing this until getting the chain function to work was smooth.
> 
> Then now I'm blocked.
> The data that is passed from the qtdemuxer into the plug-in's chain function
> does not seem to contain any NAL headers or NAL unit.
> Can somebody explain what data format the qtdemux outputs?
> 
> As a working reference I used this working pipeline:
> gst-launch filesrc location=small.mp4 ! qtdemu name demux
> demux.VIDEO_00 ! queue ! ffdec_h264 ! ffmpegcolorspace ! xvimagesink
> 
> I dumped some GstBuffer data and I think it is part
> of the 'mdat' mp4 box for the mp4 container (small.mp4)
> What is passed to the ffdec_h264 is the same as what it passed to my
> plug-in wrapper.
> The proprietary decoder library hints that it does not understand the
> syntax of the content.
> I already tried to glue some 00 00 01 NAL prefix in front but
> this does not solve the problem.

H264 in quicktime is what we call in gstreamer 'packtized' h264. A
codec_data is exchanged in the caps that contains, among other things,
the nal_length_size field and SPS, PPS. 

The data consists of a nal_length_size header containing the length of
the NAL unit that immediatly follows the size header. 

Inserting the SPS,PPS (after prefixing them with escape codes) and
exchanging the size header with escape codes is a valid way to transform
a packetized stream into a byte stream. h264parse in gst-plugins-bad
will show you how this is done in code.

Wim

> 
> Thanks in advance,
> franchan
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel





More information about the gstreamer-devel mailing list