From f7d82312bba13806f32d8de56a3d66575bfb08c7 Mon Sep 17 00:00:00 2001 From: Vivia Nikolaidou Date: Mon, 28 Nov 2016 15:14:18 +0200 Subject: [PATCH] x264enc: Auto-detect interlace mode from caps If the caps are interlaced, interlacing is always enabled on the encoder. If the interlace-mode field is missing or if it's progressive, the encoder uses the "interlaced" property. https://bugzilla.gnome.org/show_bug.cgi?id=775228 --- ext/x264/gstx264enc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ext/x264/gstx264enc.c b/ext/x264/gstx264enc.c index 5208ba2070..5f91b242c1 100644 --- a/ext/x264/gstx264enc.c +++ b/ext/x264/gstx264enc.c @@ -2264,6 +2264,12 @@ gst_x264_enc_set_format (GstVideoEncoder * video_enc, gst_caps_unref (template_caps); + if (GST_VIDEO_INFO_IS_INTERLACED (&state->info)) + g_string_append_printf (encoder->option_string, ":interlaced=%d", TRUE); + else + g_string_append_printf (encoder->option_string, ":interlaced=%d", + encoder->interlaced); + if (!gst_x264_enc_init_encoder (encoder)) return FALSE; @@ -2709,8 +2715,6 @@ gst_x264_enc_set_property (GObject * object, guint prop_id, break; case ARG_INTERLACED: encoder->interlaced = g_value_get_boolean (value); - g_string_append_printf (encoder->option_string, ":interlaced=%d", - encoder->interlaced); break; case ARG_FRAME_PACKING: encoder->frame_packing = g_value_get_enum (value); -- 2.34.1