Skip to content

Commit

Permalink
transcoding: add pixfmt constraints to ouput in filter chain
Browse files Browse the repository at this point in the history
fixes color distortion with the intel qsv encoder as reported
by lsd on irc.
  • Loading branch information
mlauss2 authored and perexg committed Nov 4, 2015
1 parent be3bb7c commit 3cbee55
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/plumbing/transcoding.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3cbee55

Please sign in to comment.