Hi,<br>I&#39;ve written a gst-app that use a fakesrc in which I get mpeg4 packets from a stream source.The timestamp buffer in the callback function of the fakesrc is set with the basetime (saved from the pipeline at the play moment) subtracted from the current_time (seved on each callback call with the get_current_time function), here&#39;s an example:
<br><br><br>here I get the basetime:<br><br>int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])<br>{<br>...<br><br>//clock is a static GstClock*<br>//basetime is a static GstClockTime<br>gst_element_set_state (pipeline, GST_STATE_PLAYING);
<br>clock=gst_pipeline_get_clock ((GstPipeline*)pipeline);<br>baseTime=gst_clock_get_time(clock2);<br>&nbsp;&nbsp;&nbsp; <br>g_main_loop_run (loop);<br clear="all">....<br><br><br>And here I set the timestamp:<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>...<br><br>GTimeVal gtime;<br>g_get_current_time(&amp;gtime);<br>GstClockTime gstClock=GST_TIMEVAL_TO_TIME(gtime);<br>
buffer-&gt;timestamp =gstClock-baseTime;<br>.....<br><br>}<br><br><br>The stream works well and the video show the frames at my framerate but I get continuosly an error of&nbsp; &quot;header damaged&quot;, like this:<br><br>0:00:
01.109361000  4336 014FD458 WARN  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default :0::&lt;mpeg4-decoder&gt; ffdec_mpeg4: decoding error (len: -1, have_data: 0)<br>0:00:01.109361000  4336 014FD458 ERROR &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ffmpeg :0:: header damaged
<br><br>And the cpu goes to 100%.<br>Now, my questions are:<br><br><ol><li>There&#39;s a way to know exactly what&#39;s the error on the header (I&#39;ve already tried a debug level 5 with no success)?</li><li>Is right to setting the timestamp in this way?
</li><li>How can I set the duration on the buffer?</li></ol><br>Thank&#39;s you for all the tips&amp;hints.<br><br>Regards.<br><br><br><br><br><br><br><br><br><br><br><br>...<br><br><br><br><br><br>-- <br>Riccardo Corona