<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    On 01/26/2012 10:50 AM, Bruno Gonzalez wrote:
    <blockquote
cite="mid:CAORBtqzi1pX37bKMhaAh8w1Dg_9MVfX12852tCwvuTaBowraCg@mail.gmail.com"
      type="cite">I expect I cannot get duration, since the RTSP source
      can sometimes be live video (unknown duration).</blockquote>
    Yes, that can be the case.<br>
    <blockquote
cite="mid:CAORBtqzi1pX37bKMhaAh8w1Dg_9MVfX12852tCwvuTaBowraCg@mail.gmail.com"
      type="cite">
      <div>However, when I try to get the position, using a Query on my
        rtspsrc element of the pipeline, I always get "-1" as result.
        I've tried using a position query with bytes, buffers, time,
        percentage and everything, but none returns a usable value.</div>
    </blockquote>
    Well invetigate the code and figure out why you get a -1. In most
    cases reporting a position should be possible. Trying the different
    formats is less useful as e.g. percent is calculated from pos and
    duration.<br>
    <blockquote
cite="mid:CAORBtqzi1pX37bKMhaAh8w1Dg_9MVfX12852tCwvuTaBowraCg@mail.gmail.com"
      type="cite">
      <div><br>
      </div>
      <div>Furthermore, the rtspsrc clock is not usable either, since
        it's just a counter of time passed on the client side. So when
        playing at 2x, it doesn't match the server time, nor does it
        account for jitter.</div>
      <div><br>
      </div>
      <div>What can be influencing the queries to return -1? Am I doing
        something wrong?</div>
    </blockquote>
    Dump a pipeline graph of you pipeline to see which element are used
    and check their query implementations to see why they don't answer
    the position query.<br>
    <br>
    Stefan<br>
    <blockquote
cite="mid:CAORBtqzi1pX37bKMhaAh8w1Dg_9MVfX12852tCwvuTaBowraCg@mail.gmail.com"
      type="cite">
      <div><br>
      </div>
      <div>The code I'm using looks like this (using gstreamer-sharp):</div>
      <br>
      Element rtspsrc = m_pipeline.GetByName("rtspsrc");<br>
      Query query = Query.NewPosition(Gst.Format.Time);<br>
      rtspsrc.Query(query);<br>
      long value;<br>
      Gst.Format format;<br>
      query.ParsePosition(out format, out value);<br>
      writeTrace("Query results: " + format + ", " + value);
      <div>
        <br>
        Is that correct?</div>
      <div><br>
        <div class="gmail_quote">On Wed, Jan 25, 2012 at 10:07, Stefan
          Sauer <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:ensonic@hora-obscura.de" target="_blank">ensonic@hora-obscura.de</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">
            <div bgcolor="#ffffff" text="#000000">
              <div> On 01/24/2012 05:24 PM, Bruno Gonzalez wrote:
                <blockquote type="cite"><span>Thanks for the input.</span><br>
                  <br>
                  <span>Unfortunately, I still don't have any hints as
                    to how to get the play </span><span>time in the
                    original source file.</span><br>
                </blockquote>
                <br>
              </div>
              Use queries to get the duration and current playback
              position<span><font color="#888888"><br>
                  <br>
                  Stefan.</font></span>
              <div>
                <div><br>
                  <blockquote type="cite"> <br>
                    <span>Doing back-of-the-envelope calculations on the
                      client is not an </span><span>option, I need the
                      actual playing time, with a precision of cents of </span><span>second.</span>
                    <div> <font color="#222222" face="arial,
                        sans-serif"><br>
                      </font></div>
                    <div><font color="#222222" face="arial, sans-serif">Any
                        idea?<br>
                      </font><br>
                      <div class="gmail_quote">On Tue, Jan 24, 2012 at
                        16:08, Stefan Sauer <span dir="ltr">&lt;<a
                            moz-do-not-send="true"
                            href="mailto:ensonic@hora-obscura.de"
                            target="_blank">ensonic@hora-obscura.de</a>&gt;</span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:
                          0pt 0pt 0pt 0.8ex; border-left: 1px solid
                          rgb(204, 204, 204); padding-left: 1ex;">
                          <div bgcolor="#ffffff" text="#000000">
                            <div> On 01/24/2012 03:49 PM, Bruno Gonzalez
                              wrote:
                              <blockquote type="cite"><span>Hi,</span><br>
                                <br>
                                <span>I have a server-client video
                                  streaming using gstreamer and RTP. So
                                  basically:</span><br>
                                <span>[source storage] --&gt; [server]
                                  ---------&gt; [client] --&gt; [frames
                                  rendered</span><br>
                                <span>on screen]</span><br>
                                <br>
                                <span>Is there any way to know, for each
                                  rendered frame, what was the</span><br>
                                <span>original playing time in the video
                                  source of the server?</span><br>
                                <br>
                                <span>For example.</span><br>
                                <span> - At 10 fps, after 30 seconds of
                                  playing, the "playing time" would be</span><br>
                                <span>300.0 seconds.</span><br>
                                <span> - But if the network is slow, the
                                  playing time could very well be</span><br>
                                <span>only 276.4 seconds.</span><br>
                                <span> - Or maybe some frames could be
                                  lost if using UDP.</span><br>
                                <span> - Also, if the source storage has
                                  variable framerate, I cannot use</span><br>
                                <span>"10fps" or any other average fps
                                  for any calculations.</span><br>
                              </blockquote>
                              <br>
                            </div>
                            video is synchronized to the clock. That is
                            after 30 sec of playing time the video is
                            more or less at 30s. If the network is slow,
                            it is likely that some frames have been
                            skipped.<br>
                            <br>
                            Stefan<br>
                            <br>
                            <blockquote type="cite">
                              <div> <br>
                                <span>How could this be achieved?</span><br>
                                <br>
                                <span>Thanks!</span><br clear="all">
                                <div><br>
                                </div>
                                -- <br>
                                Saludos,<br>
                                     Bruno González<br>
                                <br>
_______________________________________________<br>
                                Jabber: stenyak AT <a
                                  moz-do-not-send="true"
                                  href="http://gmail.com"
                                  target="_blank">gmail.com</a><br>
                                <a moz-do-not-send="true"
                                  href="http://www.stenyak.com"
                                  target="_blank">http://www.stenyak.com</a><br>
                              </div>
                              <pre><fieldset></fieldset>
_______________________________________________
gstreamer-devel mailing list
<a moz-do-not-send="true" href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a>
<a moz-do-not-send="true" href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
                            </blockquote>
                            <br>
                          </div>
                          <br>
_______________________________________________<br>
                          gstreamer-devel mailing list<br>
                          <a moz-do-not-send="true"
                            href="mailto:gstreamer-devel@lists.freedesktop.org"
                            target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
                          <a moz-do-not-send="true"
                            href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel"
                            target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
                          <br>
                        </blockquote>
                      </div>
                      <br>
                      <br clear="all">
                      <div><br>
                      </div>
                      -- <br>
                      Saludos,<br>
                           Bruno González<br>
                      <br>
                      _______________________________________________<br>
                      Jabber: stenyak AT <a moz-do-not-send="true"
                        href="http://gmail.com" target="_blank">gmail.com</a><br>
                      <a moz-do-not-send="true"
                        href="http://www.stenyak.com" target="_blank">http://www.stenyak.com</a><br>
                    </div>
                    <pre><fieldset></fieldset>
_______________________________________________
gstreamer-devel mailing list
<a moz-do-not-send="true" href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a>
<a moz-do-not-send="true" href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            gstreamer-devel mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:gstreamer-devel@lists.freedesktop.org"
              target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel"
              target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
            <br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        Saludos,<br>
             Bruno González<br>
        <br>
        _______________________________________________<br>
        Jabber: stenyak AT <a moz-do-not-send="true"
          href="http://gmail.com" target="_blank">gmail.com</a><br>
        <a moz-do-not-send="true" href="http://www.stenyak.com"
          target="_blank">http://www.stenyak.com</a><br>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
gstreamer-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>