Help Needed : H264 SPS Extraction

Vikas Malhotra ervikaspec at gmail.com
Fri May 4 22:37:58 PDT 2012


> if u are trying to play h264 content from mp4 file  , u can look for codec
> data inside setcaps function in ur decoder plugin .
>
> have a look at ffmpeg decoder plugin . src
>
>
Thankyou for your quick reply. Yes  i am trying to play an MP4 file with
h264 content.  have coded to search for "codec_data" in setcaps function in
my decoder as follows:


  if (gst_structure_has_name (structure, "video/x-h264")) {

  // has a codec_data
  if ((value = gst_structure_get_value (structure, "codec_data"))) {
    GstBuffer *buffer;
    gint i, len;
    guint8 *data;
    guint size, num_sps, num_pps;
    guint nal_length_size;

    buffer = gst_value_get_buffer (value);
    data = GST_BUFFER_DATA (buffer);
    size = GST_BUFFER_SIZE (buffer);
    ....
    ....

But i am getting NULL in "value" variable i.e. my decoder is unable to find
"codec_data" in caps structure.

I have checked with qtdemux also, it adds the required "codec_data" to the
caps structure.
But somehow my code is not able to retrieve the same.

Please help me.

Thankyou



> On Fri, May 4, 2012 at 11:38 AM, Vikas Malhotra <ervikaspec at gmail.com
> >wrote:
>
> > Hello everybody,
> >
> > I am trying to write a H264 decoder plugin. My decoder needs SPS NAL Unit
> > to construct the decoder API.
> > I am new to GStreamer Source. So, I am not sure how to retrieve SPS NAL
> > Units in my decoder plugin.
> >
> > Please help me solve my problem.
> >
> > Thankyou
> >
> > --
> >
> > --------------------------------------
> > Vikas
> > Bachelor of Engineering
> > Computer Science and Engineering
> > <http://www.vikaspec.co.cc/>
> >
> > _______________________________________________
> > gstreamer-devel mailing list
> > gstreamer-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120504/be556ab3/attachment-0001.htm
> >
>
> ------------------------------
>
> Message: 3
> Date: Fri, 4 May 2012 08:38:47 +0200
> From: Marc Leeman <marc.leeman at gmail.com>
> Subject: Re: [gmail] Help Needed : H264 SPS Extraction
> To: Discussion of the development of and with GStreamer
>        <gstreamer-devel at lists.freedesktop.org>
> Message-ID: <20120504063847.GE2382 at scorpius.homelinux.org>
> Content-Type: text/plain; charset="iso-8859-15"
>
> > I am new to GStreamer Source. So, I am not sure how to retrieve SPS NAL
> > Units in my decoder plugin.
> >
> > Please help me solve my problem.
>
> See:
>
> http://bit.ly/KjiZQV
>
>
>
 Thanks for your reply. I have coded the required thing in setcaps to
retrieve "codec_data" in my decoder which would provide me with SPS units
but somehow my setcaps function is not able to retrieve the "codec_data" in
caps structure.

Please help.

Thankyou

> --
>  greetz, marc
> harvey 2.6.29.1 #1 PREEMPT Mon Apr 6 22:33:31 CDT 2009 GNU/Linux
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120505/b183141b/attachment.html>


More information about the gstreamer-devel mailing list