YouTubeHDR / hdr_metadata

159 stars 38 forks source link

mkvmerge.exe is missing for Windows 64bit #1

Closed zmarty closed 7 years ago

zmarty commented 7 years ago

mkvmerge.exe is missing from this repo for Windows 64bit

I am not sure what is the difference between the mkvmerge.exe that is supposed to be here and the one I downloaded from MKVToolNix.

I have an H.264 HDR video that I exported from Davinci Resolve. As expected, it looks washed out when played on an SDR screen.

I used mkvmerge.exe from MKVToolNix:

mkvmerge.exe ^
  -o ProjectOutput.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 ^
  ProjectInput.mov

Then I uploaded ProjectOutput.mkv to YouTube.

Unfortunately YouTube did not detect it as HDR, as far as I can tell, since the HDR to SDR conversion did not seem to trigger. Here is the video: https://www.youtube.com/watch?v=uuXxGgZROtY&feature=youtu.be

Output from the MKVToolNix version of mkvinfo.exe:

+ EBML head
|+ EBML version: 1
|+ EBML read version: 1
|+ EBML maximum ID length: 4
|+ EBML maximum size length: 8
|+ Doc type: matroska
|+ Doc type version: 4
|+ Doc type read version: 2
+ Segment, size 598170044
|+ Seek head (subentries will be skipped)
|+ EbmlVoid (size: 4027)
|+ Segment information
| + Timecode scale: 1000000
| + Muxing application: libebml v1.3.4 + libmatroska v1.4.5
| + Writing application: mkvmerge v9.5.0 ('Quiet Fire') 64bit
| + Duration: 29.113s (00:00:29.113)
| + Date: Tue Nov 08 05:46:45 2016 UTC
| + Segment UID: 0xa3 0xc4 0xa6 0x3f 0x56 0x44 0x25 0xed 0x82 0xd5 0x98 0xd7 0xa3 0xa7 0x46 0x94
|+ Segment tracks
| + A track
|  + Track number: 1 (track ID for mkvmerge & mkvextract: 0)
|  + Track UID: 11399832362612848259
|  + Track type: video
|  + Lacing flag: 0
|  + MinCache: 1
|  + Codec ID: V_MPEG4/ISO/AVC
|  + CodecPrivate, length 39 (h.264 profile: Main @L5.1)
|  + Default duration: 41.708ms (23.976 frames/fields per second for a video track)
|  + Language: und
|  + Video track
|   + Pixel width: 3840
|   + Pixel height: 2160
|   + Display width: 3840
|   + Display height: 2160
|   + Video colour information
|    + Colour matrix: 9
|    + Colour range: 1
|    + Colour transfer: 16
|    + Colour primaries: 9
|    + Max content light: 1000
|    + Max frame light: 300
|    + Video colour mastering metadata
|     + Red colour coordinate x: 0.68
|     + Red colour coordinate y: 0.32
|     + Green colour coordinate x: 0.265
|     + Green colour coordinate y: 0.69
|     + Blue colour coordinate x: 0.15
|     + Blue colour coordinate y: 0.06
|     + White colour coordinate x: 0.3127
|     + White colour coordinate y: 0.329
|     + Max luminance: 1000
|     + Min luminance: 0.01
|+ EbmlVoid (size: 1060)
|+ Cluster

Output from YouTube version of mkvinfo.exe:

+ EBML head
|+ EBML version: 1
|+ EBML read version: 1
|+ EBML maximum ID length: 4
|+ EBML maximum size length: 8
|+ Doc type: matroska
|+ Doc type version: 4
|+ Doc type read version: 2
+ Segment, size 598170044
|+ Seek head (subentries will be skipped)
|+ EbmlVoid (size: 4027)
|+ Segment information
| + Timecode scale: 1000000
| + Muxing application: libebml v1.3.4 + libmatroska v1.4.5
| + Writing application: mkvmerge v9.5.0 ('Quiet Fire') 64bit
| + Duration: 29.113s (00:00:29.113)
| + Date: Tue Nov 08 05:46:45 2016 UTC
| + Segment UID: 0xa3 0xc4 0xa6 0x3f 0x56 0x44 0x25 0xed 0x82 0xd5 0x98 0xd7 0xa3 0xa7 0x46 0x94
|+ Segment tracks
| + A track
|  + Track number: 1 (track ID for mkvmerge & mkvextract: 0)
|  + Track UID: 11399832362612848259
|  + Track type: video
|  + Lacing flag: 0
|  + MinCache: 1
|  + Codec ID: V_MPEG4/ISO/AVC
|  + CodecPrivate, length 39 (h.264 profile: Main @L5.1)
|  + Default duration: 41.708ms (23.976 frames/fields per second for a video track)
|  + Language: und
|  + Video track
|   + Pixel width: 3840
|   + Pixel height: 2160
|   + Display width: 3840
|   + Display height: 2160
|   + Video colour information
|    + Colour matrix: 9
|    + Colour range: 1
|    + Colour transfer: 16
|    + Colour primaries: 9
|    + Max content light: 1000
|    + Max frame light: 300
|    + Video colour mastering metadata
|     + Red colour coordinate x: 0.68
|     + Red colour coordinate y: 0.32
|     + Green colour coordinate x: 0.265
|     + Green colour coordinate y: 0.69
|     + Blue colour coordinate x: 0.15
|     + Blue colour coordinate y: 0.06
|     + White colour coordinate x: 0.3127
|     + White colour coordinate y: 0.329
|     + Max luminance: 1000
|     + Min luminance: 0.01
|+ EbmlVoid (size: 1060)
|+ Cluster
ph0b commented 7 years ago

Hi,

good question on mkvtoolnix... I've used mkvmerge from it today to upload a HDR video with VP9.2 codec and it worked fine. Maybe there are some differences when using other codecs.

I confirm no HDR treatment has happened to your uploaded video. Are you sure your video was in a supported 10 or 12bit codec? according to the documentation: https://support.google.com/youtube/answer/7126552?hl=en it can be VP9 profile 2, h264 10-bit, ProRes 422/444, or DNxHR HQX.

YouTubeHDR commented 7 years ago

Hi, zmarty I had a look at the bitstream you uploaded. It seems you uploaded a 8bit H264 bitstream. To trigger the HDR-SDR conversion, you have to wrap a 10bit stream in mkv.

Thanks for pointing out the issue with the binary. It is the same as mkvtoolnix. I will replace mkvextract with mkvmerge.

zmarty commented 7 years ago

Thank you. The problem was indeed the type of video (8 bit H.264 instead of 10 bit H.264).

Suggestion: Some sort of warning or notification would be useful (if somebody uploads an mkv with HDR metadata but with an unsupported video format)/

I switched to using DNxHR HQX + mkvmerge and it worked. I am however facing a couple of other issues I will opening bugs about.