From: Manuel Lauss Date: Wed, 4 Nov 2015 12:16:29 +0000 (+0100) Subject: transcoding: add pixfmt constraints to ouput in filter chain X-Git-Tag: v4.2.1~1673 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3cbee558d2caf1e36dfc276095a2873d10ba4c51;p=thirdparty%2Ftvheadend.git transcoding: add pixfmt constraints to ouput in filter chain fixes color distortion with the intel qsv encoder as reported by lsd on irc. --- diff --git a/src/plumbing/transcoding.c b/src/plumbing/transcoding.c index 6decde3ea..55c0f9259 100644 --- a/src/plumbing/transcoding.c +++ b/src/plumbing/transcoding.c @@ -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;