From 25e0b77bbe596b8f53497d42f3fad4e5870a6d87 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Thu, 8 Jun 2017 12:35:23 +0530 Subject: [PATCH] encodebin: Don't try rate adjustment before the first buffer With both audiorate and videorate, it seems more sensible to apply rate adjustments after the first buffer appears. For example, with v4l2src, there is often a small delay before the first video buffer turns up, and this can cause a stuttery start because of videorate trying to ensure a perfect stream. --- gst/encoding/gstencodebin.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst/encoding/gstencodebin.c b/gst/encoding/gstencodebin.c index 153b37d867..65bf509c1d 100644 --- a/gst/encoding/gstencodebin.c +++ b/gst/encoding/gstencodebin.c @@ -1504,6 +1504,7 @@ _create_stream_group (GstEncodeBin * ebin, GstEncodingProfile * sprof, missing_element_name = "videorate"; goto missing_element; } + g_object_set (vrate, "skip-to-first", TRUE, NULL); gst_bin_add ((GstBin *) ebin, vrate); tosync = g_list_prepend (tosync, vrate); @@ -1535,6 +1536,8 @@ _create_stream_group (GstEncodeBin * ebin, GstEncodingProfile * sprof, goto missing_element; } g_object_set (arate, "tolerance", (guint64) ebin->tolerance, NULL); + g_object_set (arate, "skip-to-first", TRUE, NULL); + aconv = gst_element_factory_make ("audioconvert", NULL); aconv2 = gst_element_factory_make ("audioconvert", NULL); ares = gst_element_factory_make ("audioresample", NULL);