From: Steinar H. Gunderson Date: Sun, 1 Nov 2015 14:53:11 +0000 (+0100) Subject: Make output full-range, which seems to fix the issues with (at least) MPlayer/VLC... X-Git-Tag: 1.0.0~186 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=f39a8c954aec316e8654fc1ed414d9b1dce9cb7e Make output full-range, which seems to fix the issues with (at least) MPlayer/VLC rendering the colors too muted. Somehow the flag seems to get ignored, or else I am not setting it properly. --- diff --git a/h264encode.cpp b/h264encode.cpp index d63fe89..eb6faf3 100644 --- a/h264encode.cpp +++ b/h264encode.cpp @@ -343,7 +343,7 @@ static void sps_rbsp(bitstream *bs) bitstream_put_ui(bs, 1, 1); /* video_signal_type_present_flag */ { bitstream_put_ui(bs, 5, 3); /* video_format (5 = Unspecified) */ - bitstream_put_ui(bs, 0, 1); /* video_full_range_flag */ + bitstream_put_ui(bs, 1, 1); /* video_full_range_flag */ bitstream_put_ui(bs, 1, 1); /* colour_description_present_flag */ { bitstream_put_ui(bs, 1, 8); /* colour_primaries (1 = BT.709) */ diff --git a/httpd.cpp b/httpd.cpp index de0af8e..3beff80 100644 --- a/httpd.cpp +++ b/httpd.cpp @@ -96,7 +96,7 @@ HTTPD::Mux::Mux(AVFormatContext *avctx, int width, int height) avstream_video->codec->color_primaries = AVCOL_PRI_BT709; // RGB colorspace (inout_format.color_space). avstream_video->codec->color_trc = AVCOL_TRC_BT709; // Gamma curve (inout_format.gamma_curve). avstream_video->codec->colorspace = AVCOL_SPC_BT709; // YUV colorspace (output_ycbcr_format.luma_coefficients). - avstream_video->codec->color_range = AVCOL_RANGE_MPEG; // Full vs. limited range (output_ycbcr_format.full_range). + avstream_video->codec->color_range = AVCOL_RANGE_JPEG; // Full vs. limited range (output_ycbcr_format.full_range). avstream_video->codec->chroma_sample_location = AVCHROMA_LOC_LEFT; // Chroma sample location. See chroma_offset_0[] in Mixer::subsample_chroma(). avstream_video->codec->field_order = AV_FIELD_PROGRESSIVE; diff --git a/theme.cpp b/theme.cpp index 56d5f84..5573c55 100644 --- a/theme.cpp +++ b/theme.cpp @@ -136,7 +136,7 @@ int EffectChain_finalize(lua_State* L) output_ycbcr_format.chroma_subsampling_x = 1; output_ycbcr_format.chroma_subsampling_y = 1; output_ycbcr_format.luma_coefficients = YCBCR_REC_709; - output_ycbcr_format.full_range = false; + output_ycbcr_format.full_range = true; output_ycbcr_format.num_levels = 256; chain->add_ycbcr_output(inout_format, OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED, output_ycbcr_format, YCBCR_OUTPUT_SPLIT_Y_AND_CBCR);