]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
transcoding: add pixfmt constraints to ouput in filter chain
authorManuel Lauss <manuel.lauss@gmail.com>
Wed, 4 Nov 2015 12:16:29 +0000 (13:16 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 4 Nov 2015 13:51:09 +0000 (14:51 +0100)
fixes color distortion with the intel qsv encoder as reported
by lsd on irc.

src/plumbing/transcoding.c

index 6decde3eac2f1486dec9c5a3f07abe4f39bfbe8d..55c0f92599e2a33868e13a53fa905aed27569d08 100644 (file)
@@ -1035,6 +1035,7 @@ create_video_filter(video_stream_t *vs, transcoder_t *t,
 {
   AVFilterInOut *flt_inputs, *flt_outputs;
   AVFilter *flt_bufsrc, *flt_bufsink;
+  enum AVPixelFormat pix_fmts[] = { 0, AV_PIX_FMT_NONE };
   char opt[128];
   int err;
 
@@ -1088,6 +1089,15 @@ create_video_filter(video_stream_t *vs, transcoder_t *t,
     goto out_err;
   }
 
+  pix_fmts[0] = octx->pix_fmt;
+  err = av_opt_set_int_list(vs->flt_bufsinkctx, "pix_fmts", pix_fmts,
+                            AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN);
+  if (err < 0) {
+    tvherror("transcode", "%08X: fltchain cannot set output pixfmt",
+             shortid(t));
+    goto out_err;
+  }
+
   flt_outputs->name = av_strdup("in");
   flt_outputs->filter_ctx = vs->flt_bufsrcctx;
   flt_outputs->pad_idx = 0;