]> granicus.if.org Git - handbrake/commitdiff
cropscale: force output pixfmt to YUV420P
authorJohn Stebbins <jstebbins.hb@gmail.com>
Wed, 3 Apr 2019 18:20:30 +0000 (12:20 -0600)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Mon, 8 Apr 2019 13:44:09 +0000 (07:44 -0600)
It appears some color prim/tran/matrix settings result in high bit
depth output of the scale filter.

libhb/cropscale.c

index 38d8560e9612cf93d6a955daf9031645a8c7413d..09af92e09e0d1c31e5336796b63f1e98d6ea8c39 100644 (file)
@@ -139,6 +139,15 @@ static int crop_scale_init(hb_filter_object_t * filter, hb_filter_init_t * init)
     hb_dict_set(avfilter, "scale", avsettings);
     hb_value_array_append(avfilters, avfilter);
 
+    avfilter   = hb_dict_init();
+    avsettings = hb_dict_init();
+
+    // TODO: Support other pix formats
+    // Force output to YUV420P for until other formats are supported
+    hb_dict_set(avsettings, "pix_fmts", hb_value_string("yuv420p"));
+    hb_dict_set(avfilter, "format", avsettings);
+    hb_value_array_append(avfilters, avfilter);
+
     init->crop[0] = top;
     init->crop[1] = bottom;
     init->crop[2] = left;