<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <font size="-1">Hi Tim,<br>
      <br>
      I already have tried this, but in this case ths delay decreases<br>
      up to ~10-11 frames.<br>
      <br>
      Also I have tried many different options:<br>
      <br>
          ::g_object_set(G_OBJECT(videoenc),<br>
      //                   "pass", "qual",<br>
      //                   "quantizer", 20,<br>
                         "tune", "zerolatency",<br>
                         "speed-preset", "ultrafast",<br>
                         "byte-stream", true,<br>
                         "key-int-max", 1,<br>
                         "intra-refresh", true,<br>
      //                   "bitrate", 500,<br>
                         "rc-lookahead" , 5,<br>
                         nullptr);<br>
      <br>
      but, the resulting minimum delay stays ~10-11 frames.<br>
      <br>
      It is too big delay anyway... <br>
      <br>
      I tries to do workaround for every new present frame,<br>
      to stimulate the "real-time" sending, by pushing the <br>
      same frame with > 10 times, e.g. as following:<br>
      <br>
      void Foo::presentImage(const QImage &image)<br>
      {<br>
          ...<br>
      <br>
          auto nsecs = m_timestamp.nsecsElapsed();<br>
      <br>
          for (int i = 0; i < 15; ++i) {<br>
              const auto buffer =
      gst_buffer_new_and_alloc(m_image.byteCount());<br>
      <br>
              const auto bytesCopied = ::gst_buffer_fill(<br>
                          buffer, 0, m_image.constBits(),
      m_image.byteCount());<br>
              Q_UNUSED(bytesCopied)<br>
      <br>
              GST_BUFFER_PTS(buffer) = nsecs;<br>
              nsecs += 10; // to add a fake stamp<br>
      <br>
              const auto result = ::gst_app_src_push_buffer(<br>
                          GST_APP_SRC(m_appsrc), buffer);<br>
              if (result != GST_FLOW_OK) {<br>
                  qCCritical(msProducerControl) << "Unable to push
      buffer";<br>
              }<br>
          }<br>
      }<br>
      <br>
      But, it is ugly, too. I don't know, how to fix it. :(<br>
      <br>
    </font>
    <div class="moz-cite-prefix">25.12.2017 17:03, Tim Müller пишет:<br>
    </div>
    <blockquote type="cite"
      cite="mid:1514210603.11131.1.camel@centricular.com">
      <pre wrap="">On Mon, 2017-12-25 at 16:38 +0300, Denis Shienkov wrote:

Hi,

</pre>
      <blockquote type="cite">
        <pre wrap="">Is it possible to configure the x264enc, or rtph264pay (I don't know
what I need), to that the udpsink will send the *every encoded
frame*, immediatelly after a *source frame* comes to the appsrc? And
do not wait for 48 source buffers for this?
</pre>
      </blockquote>
      <pre wrap="">
The easiest way to enable this is to set  x264enc tune=zerolatency

Cheers
-Tim

</pre>
    </blockquote>
    <br>
  </body>
</html>