Hi Thiago,<br><br>Thanks for the information. I just tried the latest code, but it did not
work either. The mux jumped to label &quot;no_time&quot; just as the previous version did.<br><br>  if (buf == NULL ||<br>      !GST_BUFFER_TIMESTAMP_IS_VALID (last_buf) ||<br>      !GST_BUFFER_TIMESTAMP_IS_VALID (buf) ||<br>
      GST_BUFFER_TIMESTAMP (buf) &lt; GST_BUFFER_TIMESTAMP (last_buf)) {<br>    if (!GST_BUFFER_DURATION_IS_VALID (last_buf)) {<br>      /* be forgiving for some possibly last upstream flushed buffer */<br>      if (buf)<br>
        goto no_time;<br><br>If I commented out the last two lines, the file can be captured now. <br><br>The captured video can be played correctly by VLC, but I observed some jerkiness when I played it in totem. Could that be a problem in qtdemux, since totem is based on gstreamer, and VLC is not? The captured file is attached to the email if you are interested in looking into the details. <br>
<br>Here is the a trace from playback &quot;gst-launch filesrc location=a_30.mov ! decodebin ! xvimagesink). Please note some frames have the same timestamp. <br><br>0:00:01.972883491  8491  0x9e30800 INFO               GST_EVENT gstevent.c:839:gst_event_new_qos: creating qos proportion 0.000000, diff -16495981, timestamp 0:00:01.692000000<br>
0:00:01.999683398  8491  0x9e30800 INFO               GST_EVENT gstevent.c:839:gst_event_new_qos: creating qos proportion 0.000000, diff -11739020, timestamp 0:00:01.717000000<br>0:00:02.030359901  8491  0x9e30800 INFO               GST_EVENT gstevent.c:839:gst_event_new_qos: creating qos proportion 0.000000, diff -21690153, timestamp 0:00:01.753333333<br>
0:00:02.064175070  8491  0x9e30800 INFO               GST_EVENT gstevent.c:839:gst_event_new_qos: creating qos proportion 0.000000, diff -29498016, timestamp 0:00:01.792000000<br>0:00:02.097518598  8491  0x9e30800 INFO               GST_EVENT gstevent.c:839:gst_event_new_qos: creating qos proportion 0.000000, diff -28982855, timestamp 0:00:01.825333333<br>
0:00:02.130852310  8491  0x9e30800 INFO               GST_EVENT gstevent.c:839:gst_event_new_qos: creating qos proportion 0.000000, diff -29174458, timestamp 0:00:01.858666666<br>0:00:02.164338707  8491  0x9e30800 INFO               GST_EVENT gstevent.c:839:gst_event_new_qos: creating qos proportion 0.000000, diff -28967572, timestamp 0:00:01.892000000<br>
0:00:02.189270327  8491  0x9e30800 INFO               GST_EVENT gstevent.c:839:gst_event_new_qos: creating qos proportion 0.000000, diff -20473058, timestamp 0:00:01.917000000<br>0:00:02.211482344  8491  0x9e30800 INFO               GST_EVENT gstevent.c:839:gst_event_new_qos: creating qos proportion 0.000000, diff 4209870, timestamp 0:00:01.917000000<br>
0:00:02.214562919  8491  0x9e30800 INFO               GST_EVENT gstevent.c:839:gst_event_new_qos: creating qos proportion 0.000000, diff 26280241, timestamp 0:00:01.917000000<br>0:00:02.217906820  8491  0x9e30800 INFO               GST_EVENT gstevent.c:839:gst_event_new_qos: creating qos proportion 0.000000, diff 29624745, timestamp 0:00:01.917000000<br>
0:00:02.221188594  8491  0x9e30800 INFO               GST_EVENT gstevent.c:839:gst_event_new_qos: creating qos proportion 0.000000, diff 32906654, timestamp 0:00:01.917000000<br>0:00:02.224190717  8491  0x9e30800 INFO               GST_EVENT gstevent.c:839:gst_event_new_qos: creating qos proportion 0.000000, diff 35908727, timestamp 0:00:01.917000000<br>
0:00:02.262820788  8491  0x9e30800 INFO               GST_EVENT gstevent.c:839:gst_event_new_qos: creating qos proportion 0.000000, diff -34995449, timestamp 0:00:01.990666666<br><br>
I looked at &quot;stts&quot; atom. The duration of a sample is not fixed at 100
as it should be, but they are varying around that value. I guess it is
because the duration is calculated from the timestamp during running
time in qtmux. The samples that have zero duration are RBSP&#39;s that do
not have frame data. Examples are SPS/PPS/SEI/Access Unit Delimiter, etc.<br>
<br>I guess the actual problem is in rtph264depay. Similar to a problem fixed in v4l2src,
rtph264depay does not provide a valid duration either. I think the best solution is that every element generates duration correctly. But if I compare ffmux_mp4 and qtmux, ffmux_mp4 is more forgiving by setting duration to 0 (line 645 ~ 650) in gstffmpegmux.c.<br>
<br>Thanks,<br>Yiliang<br><br><div class="gmail_quote">On Thu, Nov 26, 2009 at 3:27 AM, <a href="mailto:thiagossantos@gmail.com">thiagossantos@gmail.com</a> <span dir="ltr">&lt;<a href="mailto:thiagossantos@gmail.com">thiagossantos@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br><div class="gmail_quote"><div class="im">On Tue, Nov 24, 2009 at 7:19 PM, Yiliang Bao <span dir="ltr">&lt;<a href="mailto:yiliangb@gmail.com" target="_blank">yiliangb@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hi Florian,<br><br>Thanks for replying to my message. ffmux_mp4 did not work for me either when I posted the original message. All I got are access unit delimiter RBSP&#39;s. An acces unit delimiter RBSP is something like 000000010910 for the I frame, and 000000010030 for the non-I frame.<br>



<br>Since the AU delimiter has the same timestamp as the following NAL, I was wondering whether that was a problem. And indeed it was. In the function compute_pkt_fields2() in file: /gst-ffmpeg-0.10.9/gst-libs/ext/ffmpeg/libavformat/utils.c<br>



<br>I changed the following line to allow two consecutive packets have same time stamp:<br><br>

<p style="margin: 0px; text-indent: 0px;">#if 1</p>
<p style="margin: 0px; text-indent: 0px;">    if(st-&gt;cur_dts &amp;&amp; st-&gt;cur_dts != AV_NOPTS_VALUE &amp;&amp; st-&gt;cur_dts &gt; pkt-&gt;dts){</p>
<p style="margin: 0px; text-indent: 0px;">#else</p>
<p style="margin: 0px; text-indent: 0px;">    if(st-&gt;cur_dts &amp;&amp; st-&gt;cur_dts != AV_NOPTS_VALUE &amp;&amp; st-&gt;cur_dts &gt;= pkt-&gt;dts){</p>
<p style="margin: 0px; text-indent: 0px;">#endif</p>
<p style="margin: 0px; text-indent: 0px;"></p><br>Now I can capture video correctly. I am wondering if anyone working on ffmpeg can verify whether this fix is a valid solution. Maybe I should post a separate message on ffmux_mp4.<br>




<br>However, this does not solve my problem. I still need to make qtmux work since it supports the audio codec which ffmux_mp4 does not support.<br><br>Thanks,<br><font color="#888888">Yiliang</font><div><div></div><div>


<br><br><div class="gmail_quote">On Tue, Nov 24, 2009 at 12:05 AM, florian iragne <span dir="ltr">&lt;<a href="mailto:florian.iragne@viewsurf.com" target="_blank">florian.iragne@viewsurf.com</a>&gt;</span> wrote:<br>
<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>
Yiliang Bao a écrit :<br>
<div>&gt; I got this error:<br>
&gt;<br>
&gt; gstqtmux.c(1347): gst_qt_mux_add_buffer ():<br>
&gt; /GstPipeline:pipeline0/GstQTMux:qtmux0:<br>
&gt; Failed to determine time to mux.<br>
<br>
</div>i got the same error and have had no success using qtmux or mp4mux.<br></blockquote></div></div></div></blockquote><div><br></div></div><div>Some fixes were pushed to qtmux/mp4mux for improving timestamps and durations handling yesterday. Could you retry and check if it works now?</div>
<div class="im">

<div> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



<div><br>
&gt; I also tried ffmux_mp4. The pipeline can continue, but it looks like that<br>
&gt; only the access unit delimiter RBSP is captured.<br>
<br>
</div>I use ffmux_mp4 with success in my pipeline. Could you provide yours to<br>
check what&#39;s wrong?<br>
<font color="#888888"><br>
<br>
Florian<br>
</font><div><div></div><div><br>
------------------------------------------------------------------------------<br>
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day<br>
trial. Simplify your report design, integration and deployment - and focus on<br>
what you do best, core application coding. Discover what&#39;s new with<br>
Crystal Reports now.  <a href="http://p.sf.net/sfu/bobj-july" target="_blank">http://p.sf.net/sfu/bobj-july</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</div></div></blockquote></div><br>
</div></div><br>------------------------------------------------------------------------------<br>
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day<br>
trial. Simplify your report design, integration and deployment - and focus on<br>
what you do best, core application coding. Discover what&#39;s new with<br>
Crystal Reports now.  <a href="http://p.sf.net/sfu/bobj-july" target="_blank">http://p.sf.net/sfu/bobj-july</a><br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
<br></blockquote></div></div><font color="#888888"><br><br clear="all"><br>-- <br>Thiago Sousa Santos<br>
</font><br>------------------------------------------------------------------------------<br>
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day<br>
trial. Simplify your report design, integration and deployment - and focus on<br>
what you do best, core application coding. Discover what&#39;s new with<br>
Crystal Reports now.  <a href="http://p.sf.net/sfu/bobj-july" target="_blank">http://p.sf.net/sfu/bobj-july</a><br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br>