Skip to content

Commit

Permalink
fix incorrect color using libx264rgb
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed May 31, 2020
1 parent d03576d commit c6b8c90
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/modules/avformat/consumer_avformat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,11 @@ static int open_video( mlt_properties properties, AVFormatContext *oc, AVStream
video_enc->pix_fmt = codec->pix_fmts[ 0 ];
}

const AVPixFmtDescriptor* srcDesc = av_pix_fmt_desc_get(video_enc->pix_fmt);
if (srcDesc->flags & AV_PIX_FMT_FLAG_RGB) {
st->codec->colorspace = AVCOL_SPC_RGB;
}

int result = codec && avcodec_open2( video_enc, codec, NULL ) >= 0;

return result;
Expand Down

0 comments on commit c6b8c90

Please sign in to comment.