How to send every comes source video buffer to the udp sink without of a buffering?

Denis Shienkov denis.shienkov at gmail.com
Mon Dec 25 15:18:29 UTC 2017


Hi Tim,

I already have tried this, but in this case ths delay decreases
up to ~10-11 frames.

Also I have tried many different options:

     ::g_object_set(G_OBJECT(videoenc),
//                   "pass", "qual",
//                   "quantizer", 20,
                    "tune", "zerolatency",
                    "speed-preset", "ultrafast",
                    "byte-stream", true,
                    "key-int-max", 1,
                    "intra-refresh", true,
//                   "bitrate", 500,
                    "rc-lookahead" , 5,
                    nullptr);

but, the resulting minimum delay stays ~10-11 frames.

It is too big delay anyway...

I tries to do workaround for every new present frame,
to stimulate the "real-time" sending, by pushing the
same frame with > 10 times, e.g. as following:

void Foo::presentImage(const QImage &image)
{
     ...

     auto nsecs = m_timestamp.nsecsElapsed();

     for (int i = 0; i < 15; ++i) {
         const auto buffer = gst_buffer_new_and_alloc(m_image.byteCount());

         const auto bytesCopied = ::gst_buffer_fill(
                     buffer, 0, m_image.constBits(), m_image.byteCount());
         Q_UNUSED(bytesCopied)

         GST_BUFFER_PTS(buffer) = nsecs;
         nsecs += 10; // to add a fake stamp

         const auto result = ::gst_app_src_push_buffer(
                     GST_APP_SRC(m_appsrc), buffer);
         if (result != GST_FLOW_OK) {
             qCCritical(msProducerControl) << "Unable to push buffer";
         }
     }
}

But, it is ugly, too. I don't know, how to fix it. :(

25.12.2017 17:03, Tim Müller пишет:
> On Mon, 2017-12-25 at 16:38 +0300, Denis Shienkov wrote:
>
> Hi,
>
>> 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?
> The easiest way to enable this is to set  x264enc tune=zerolatency
>
> Cheers
> -Tim
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20171225/24b5698e/attachment-0001.html>


More information about the gstreamer-devel mailing list