From eedf61e845d7f5aab0ec8ce79efd19d6bfe686f2 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 7 Aug 2017 21:31:26 +0200 Subject: [PATCH] Specify sRGB transfer characteristics in the H.264 files (added in newer versions of H.264). --- mux.cpp | 2 +- quicksync_encoder.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mux.cpp b/mux.cpp index f52f795..cfe38b6 100644 --- a/mux.cpp +++ b/mux.cpp @@ -75,7 +75,7 @@ Mux::Mux(AVFormatContext *avctx, int width, int height, Codec video_codec, const // Note that there's no way to change this per-frame as the H.264 stream // would like to be able to. avstream_video->codecpar->color_primaries = AVCOL_PRI_BT709; // RGB colorspace (inout_format.color_space). - avstream_video->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED; // Gamma curve (inout_format.gamma_curve). + avstream_video->codecpar->color_trc = AVCOL_TRC_IEC61966_2_1; // Gamma curve (inout_format.gamma_curve). // YUV colorspace (output_ycbcr_format.luma_coefficients). if (global_flags.ycbcr_rec709_coefficients) { avstream_video->codecpar->color_space = AVCOL_SPC_BT709; diff --git a/quicksync_encoder.cpp b/quicksync_encoder.cpp index b288fa6..0c40a26 100644 --- a/quicksync_encoder.cpp +++ b/quicksync_encoder.cpp @@ -336,7 +336,7 @@ void QuickSyncEncoderImpl::sps_rbsp(YCbCrLumaCoefficients ycbcr_coefficients, bi bitstream_put_ui(bs, 1, 1); /* colour_description_present_flag */ { bitstream_put_ui(bs, 1, 8); /* colour_primaries (1 = BT.709) */ - bitstream_put_ui(bs, 2, 8); /* transfer_characteristics (2 = unspecified, since we use sRGB) */ + bitstream_put_ui(bs, 13, 8); /* transfer_characteristics (13 = sRGB) */ if (ycbcr_coefficients == YCBCR_REC_709) { bitstream_put_ui(bs, 1, 8); /* matrix_coefficients (1 = BT.709) */ } else { -- 2.39.2