Here's a test, to see how things are handled. If there's a mistake in my processing or command lines, feel free to correct me. The video footage is taken from
Tompa's 101% run of Donkey Kong Country.
First up, here's the control video. The AVISynth portion was based on the encoding package, albeit modified to be shorter for testing purposes. The x264 command line is taken directly from the package, unmodified:
Watch on Youtube
Language: avisynth
AVISource("input.avi")
PointResize(2880,2160)
ConvertToYV24(chromaresample="point", matrix="Rec709")
ConvertToYV12(chromaresample="lanczos", matrix="Rec709")
Language: batch
"./programs/avs2pipemod" -wav encode.avs | "./programs/venc" -q10 - "./temp/audio.ogg"
"./programs/avs2pipemod" -y4mp encode.avs | "./programs/x264_x64" --qp 5 -b 0 --keyint infinite --output "./temp/video_youtube_control.mkv" --demuxer y4m -
"./programs/mkvmerge" -o "./output/encode_youtube_control.mkv" --compression -1:none "./temp/video_youtube_control.mkv" "./temp/audio.ogg"
Next, the new test video. Modifications have been made to both the script and command lines accordingly:
Watch on Youtube
Language: avisynth
AVISource("input.avi")
PointResize(2880,2160)
ConvertToYV24(chromaresample="point", matrix="Rec2020")
Language: batch
"./programs/avs2pipemod" -wav encode.avs | "./programs/venc" -q10 - "./temp/audio.ogg"
"./programs/avs2pipemod" -y4mp encode.avs | "./programs/x264-10_x64" --qp 5 -b 0 --keyint infinite --output "./temp/video_youtube_test.mkv" --colormatrix bt2020nc --output-csp i444 --demuxer y4m -
"./programs/mkvmerge" -o "./output/encode_youtube_test.mkv" --compression -1:none "./temp/video_youtube_test.mkv" "./temp/audio.ogg"
Next, we have the same file, remuxed using Youtube's HDR metadata tool (which is just a modified mkvmerge). All the following settings may not be necessary, nor may they accurately represent our video data, but for testing's sake I followed their example as it was written:
Watch on Youtubemkvmerge -o encode_youtube_metadata.mkv --colour-matrix 0:9 --colour-range 0:1 --colour-transfer-characteristics 0:16 --colour-primaries 0:9 --max-content-light 0:1000 --max-frame-light 0:300 --max-luminance 0:1000 --min-luminance 0:0.01 --chromaticity-coordinates 0:0.68,0.32,0.265,0.690,0.15,0.06 --white-colour-coordinates 0:0.3127,0.3290 encode_youtube_test.mkv
Finally, we have the input video for reference:
Download via Mediafire
I'm not sure if the metadata carried over correctly in to Youtube's processing, so if there are any discrepancies it could be related to that. I'm also not sure if we should have been specifying Rec709 in the metadata for HD this whole time.
Edit: It looks like (as feos pointed out to me in IRC) that it has only detected Rec709 in all cases. This could be an issue with processing that resolves over time, but likely I did something wrong or perhaps it doesn't support this particular method.
Edit 2: On the chance it's Youtube's processing,
here's an alternate version.