[gst-devel] Fwd: ffdec_mpeg4 mpeg4 packet duration
Riccardo Corona
coronariccardo at gmail.com
Wed Jun 13 12:07:24 CEST 2007
Yes, but the problem is that I'm using a fakesrc in which I get the mpeg4
packets and so I'm the one that fill the gstbuffer in the handoff function
of the fakesrc: I set the timestamp with the basetime subtracted to the
currenttime but I don't know how to set the duration.
Here's some snippet of the handoff function of the fakesrc:
static void cb_handoff (GstElement *fakesrc,
GstBuffer *buffer,
GstPad *pad,
gpointer user_data)
{
pad->caps= gst_caps_new_simple ("video/mpeg",
"width", G_TYPE_INT, 720,
"height", G_TYPE_INT, 288,
"framerate",GST_TYPE_FRACTION,25,1,
"mpegversion",G_TYPE_INT,4,
"systemstream",G_TYPE_BOOLEAN,false,NULL);
gst_buffer_set_caps(buffer,pad->caps);
GTimeVal gtime;
g_get_current_time(>ime);
GstClockTime gstClock=GST_TIMEVAL_TO_TIME(gtime);
buffer->timestamp =gstClock-baseTime;
//here I call a function that give me a mpeg4 packet received from the net,
the packet is fg_image...
GST_BUFFER_MALLOCDATA(buffer) = (unsigned char*) g_memdup
(fg_image->pixel_ptr,fg_image->dimension);
GST_BUFFER_DATA(buffer) = GST_BUFFER_MALLOCDATA(buffer);
GST_BUFFER_SIZE(buffer) = fg_image->dim_oggetto_byte;
itf_Free(pUserData);
pUserData = NULL;
return;
}
}
Without setting it the duration should be automatically set to
GST_CLOCK_TIME_NONE, so how the ffdec_mpeg4 can output that value for the
duration?
2007/6/13, Edward Hervey <bilboed at gmail.com>:
>
> Hi,
>
> If the stream is properly packetized (the mpeg4 was in a container
> format), then each mpeg4 packet is an individual GstBuffer. You can
> get the timestamp and duration of those buffers by using
> GST_BUFFER_TIMESTAMP(thatbuffer) and GST_BUFFER_DURATION(thatbuffer).
> The unit used is the nanosecond.
>
> Edward
>
> On 6/11/07, Riccardo Corona <coronariccardo at gmail.com> wrote:
> > Hi,
> > is it possible to get the duration of an mpeg4 packet received from the
> > ffdec_mpeg4 plugin?
> > I've noted that, when I launch my gst-app with GST_DEBUG, the
> ffdec_mpeg4
> > plugin write int the output some info like:
> >
> >
> > 0:00:08.734375000 [333m 380 [00m 01622C38 [37mLOG [00m [00;04m
> > default :0::<mpeg4-decoder> [00m Received new data of size 14815,
> > ts:0:02:08.371833333, dur:0:00:00.493833333
> >
> > 0:00: 08.734375000 [333m 380 [00m 01622C38 [37mLOG [00m [00;04m
> > default :0::<mpeg4-decoder> [00m data:01D0BFD0, size:14815,
> > ts:0:02:08.371833333, dur:0:00:00.493833333
> >
> > 0:00:08.734375000 [333m 380 [00m 01622C38 [36mDEBUG [00m [00;04m
> > default :0::<mpeg4-decoder> [00m QOS: qostime 0:02: 08.371833333,
> earliest
> > 0:00:06.200000000
> >
> > How could I get this information with gst api?I've searched with
> > gst-inspector for ffdec_mpeg4 but I did'nt find anything.
> >
> > Thank's to all of you.
> > --
> > Riccardo Corona
> >
> -------------------------------------------------------------------------
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > gstreamer-devel mailing list
> > gstreamer-devel at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> >
> >
>
>
> --
> Edward Hervey
> Multimedia editing developer / Fluendo S.A.
> http://www.pitivi.org/
>
--
Riccardo Corona
--
Riccardo Corona
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20070613/d09405a7/attachment.htm>
More information about the gstreamer-devel
mailing list