<span class="gmail_quote"><br></span>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.
<br>Here's some snippet of the handoff function of the fakesrc:<br><br><br>static void cb_handoff (GstElement *fakesrc,<br> GstBuffer *buffer,<br> GstPad *pad,<br> gpointer user_data)<br>
{
<br><br> pad->caps= gst_caps_new_simple ("video/mpeg",<br> "width", G_TYPE_INT, 720,<br> "height", G_TYPE_INT, 288,<br> "framerate",GST_TYPE_FRACTION,25,1,
<br> "mpegversion",G_TYPE_INT,4,<br> "systemstream",G_TYPE_BOOLEAN,false,NULL);<br><br> gst_buffer_set_caps(buffer,pad->caps);<br><br> GTimeVal gtime;<br> g_get_current_time(&gtime);
<br> GstClockTime gstClock=GST_TIMEVAL_TO_TIME(gtime);<br> buffer->timestamp =gstClock-baseTime;<br><br>//here I call a function that give me a mpeg4 packet received from the net, the packet is fg_image...
<br> <br> GST_BUFFER_MALLOCDATA(buffer) = (unsigned char*) g_memdup (fg_image->pixel_ptr,fg_image->dimension);<br> GST_BUFFER_DATA(buffer) = GST_BUFFER_MALLOCDATA(buffer);<br> GST_BUFFER_SIZE(buffer) = fg_image->dim_oggetto_byte;
<br> <br> <br> itf_Free(pUserData);<br> pUserData = NULL;<br> return;<br> }<br><br>}<br><br>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?
<br><br><br><br><br><br><br><br><br><div><span class="gmail_quote">2007/6/13, Edward Hervey <<a href="mailto:bilboed@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">bilboed@gmail.com</a>
>:</span><div><span class="e" id="q_113248ceb80299f2_1"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br> If the stream is properly packetized (the mpeg4 was in a container<br>format), then each mpeg4 packet is an individual GstBuffer. You can<br>get the timestamp and duration of those buffers by using<br>GST_BUFFER_TIMESTAMP(thatbuffer) and GST_BUFFER_DURATION(thatbuffer).
<br>The unit used is the nanosecond.<br><br> Edward<br><br>On 6/11/07, Riccardo Corona <<a href="mailto:coronariccardo@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">coronariccardo@gmail.com
</a>> wrote:<br>> Hi,<br>> is it possible to get the duration of an mpeg4 packet received from the
<br>> ffdec_mpeg4 plugin?<br>> I've noted that, when I launch my gst-app with GST_DEBUG, the ffdec_mpeg4<br>> plugin write int the output some info like:<br>><br>><br>> 0:00:08.734375000 [333m 380 [00m 01622C38 [37mLOG [00m [00;04m
<br>> default :0::<mpeg4-decoder> [00m Received new data of size 14815,<br>> ts:0:02:08.371833333, dur:0:00:00.493833333<br>><br>> 0:00: 08.734375000 [333m 380 [00m 01622C38 [37mLOG [00m [00;04m<br>> default :0::<mpeg4-decoder> [00m data:01D0BFD0, size:14815,
<br>> ts:0:02:08.371833333, dur:0:00:00.493833333<br>><br>> 0:00:08.734375000 [333m 380 [00m 01622C38 [36mDEBUG [00m [00;04m<br>> default :0::<mpeg4-decoder> [00m QOS: qostime 0:02: 08.371833333, earliest
<br>> 0:00:06.200000000<br>><br>> How could I get this information with gst api?I've searched with<br>> gst-inspector for ffdec_mpeg4 but I did'nt find anything.<br>><br>> Thank's to all of you.
<br>> --<br>> Riccardo Corona<br>> -------------------------------------------------------------------------<br>> This SF.net email is sponsored by DB2 Express<br>> Download DB2 Express C - the FREE version of DB2 express and take
<br>> control of your XML. No limits. Just data. Click to get it now.<br>> <a href="http://sourceforge.net/powerbar/db2/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://sourceforge.net/powerbar/db2/
</a><br>> _______________________________________________
<br>> gstreamer-devel mailing list<br>> <a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">gstreamer-devel@lists.sourceforge.net</a><br>>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>><br>><br><br><br>--<br>Edward Hervey<br>Multimedia editing developer / Fluendo S.A.<br><a href="http://www.pitivi.org/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.pitivi.org/</a>
<br></blockquote></span></div></div><br><br clear="all"><br>-- <br><span class="sg">Riccardo Corona
</span><br clear="all"><br>-- <br>Riccardo Corona