<span class="gmail_quote"><br></span>Yes, but the problem is that I&#39;m using a fakesrc in which I get the mpeg4 packets and so I&#39;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&#39;t know how to set the duration.
<br>Here&#39;s some snippet of the handoff function of the fakesrc:<br><br><br>static void cb_handoff (GstElement *fakesrc,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GstBuffer&nbsp; *buffer,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GstPad&nbsp;&nbsp;&nbsp;&nbsp; *pad,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; gpointer&nbsp;&nbsp;&nbsp; user_data)<br>
{
<br><br>&nbsp;&nbsp;&nbsp; pad-&gt;caps= gst_caps_new_simple (&quot;video/mpeg&quot;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;width&quot;, G_TYPE_INT, 720,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;height&quot;, G_TYPE_INT, 288,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;framerate&quot;,GST_TYPE_FRACTION,25,1,
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;mpegversion&quot;,G_TYPE_INT,4,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;systemstream&quot;,G_TYPE_BOOLEAN,false,NULL);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_buffer_set_caps(buffer,pad-&gt;caps);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GTimeVal gtime;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; g_get_current_time(&amp;gtime);
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GstClockTime gstClock=GST_TIMEVAL_TO_TIME(gtime);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; buffer-&gt;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>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GST_BUFFER_MALLOCDATA(buffer) =&nbsp;&nbsp;&nbsp; (unsigned char*) g_memdup (fg_image-&gt;pixel_ptr,fg_image-&gt;dimension);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GST_BUFFER_DATA(buffer) = GST_BUFFER_MALLOCDATA(buffer);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GST_BUFFER_SIZE(buffer) = fg_image-&gt;dim_oggetto_byte;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; itf_Free(pUserData);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pUserData = NULL;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return;<br>&nbsp;&nbsp;&nbsp; }<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 &lt;<a href="mailto:bilboed@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">bilboed@gmail.com</a>
&gt;:</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>&nbsp;&nbsp;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>&nbsp;&nbsp; Edward<br><br>On 6/11/07, Riccardo Corona &lt;<a href="mailto:coronariccardo@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">coronariccardo@gmail.com
</a>&gt; wrote:<br>&gt; Hi,<br>&gt; is it possible to get the duration of an mpeg4 packet received from the
<br>&gt; ffdec_mpeg4 plugin?<br>&gt; I&#39;ve noted that, when I launch my gst-app with GST_DEBUG, the ffdec_mpeg4<br>&gt; plugin write int the output some info like:<br>&gt;<br>&gt;<br>&gt; 0:00:08.734375000 [333m&nbsp;&nbsp;380 [00m 01622C38 [37mLOG&nbsp;&nbsp;[00m [00;04m
<br>&gt; default :0::&lt;mpeg4-decoder&gt; [00m Received new data of size 14815,<br>&gt; ts:0:02:08.371833333, dur:0:00:00.493833333<br>&gt;<br>&gt; 0:00: 08.734375000 [333m&nbsp;&nbsp;380 [00m 01622C38 [37mLOG&nbsp;&nbsp;[00m [00;04m<br>&gt;&nbsp;&nbsp;default :0::&lt;mpeg4-decoder&gt; [00m data:01D0BFD0, size:14815,
<br>&gt; ts:0:02:08.371833333, dur:0:00:00.493833333<br>&gt;<br>&gt; 0:00:08.734375000 [333m&nbsp;&nbsp;380 [00m 01622C38 [36mDEBUG [00m [00;04m<br>&gt;&nbsp;&nbsp;default :0::&lt;mpeg4-decoder&gt; [00m QOS: qostime 0:02: 08.371833333, earliest
<br>&gt; 0:00:06.200000000<br>&gt;<br>&gt; How could I get this information with gst api?I&#39;ve searched with<br>&gt; gst-inspector for ffdec_mpeg4 but I did&#39;nt find anything.<br>&gt;<br>&gt; Thank&#39;s to all of you.
<br>&gt; --<br>&gt; Riccardo Corona<br>&gt; -------------------------------------------------------------------------<br>&gt; This SF.net email is sponsored by DB2 Express<br>&gt; Download DB2 Express C - the FREE version of DB2 express and take
<br>&gt; control of your XML. No limits. Just data. Click to get it now.<br>&gt; <a href="http://sourceforge.net/powerbar/db2/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://sourceforge.net/powerbar/db2/
</a><br>&gt; _______________________________________________
<br>&gt; gstreamer-devel mailing list<br>&gt; <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>&gt; 
<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>&gt;<br>&gt;<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