MediaArea / MediaInfo

Convenient unified display of the most relevant technical and tag data for video and audio files.
https://MediaArea.net/MediaInfo
BSD 2-Clause "Simplified" License
1.33k stars 161 forks source link

MediaInfo doesn't report the correct HDR Format when extracted from .mkv container to .hevc file (missing dolby vision information) #587

Closed jessielw closed 2 years ago

jessielw commented 2 years ago

When test file is in .mkv format HDR format : Dolby Vision, Version 1.0, dvhe.07.06, BL+EL+RPU, Blu-ray compatible / SMPTE ST 2086, HDR10 compatible

When test file is in .hevc format (extracted from the above mkv) HDR format : SMPTE ST 2086, HDR10 compatible

Samples https://www.mediafire.com/file/m70xj085hchbk82/samples.zip/file

JeromeMartinez commented 2 years ago

Dolby Vision data inside the HEVC stream is not documented by Dolby and there is currently no reverse engineering done on that so we rely exclusively on the Matroska headers (which are removed during demux). "Won't fix" status until someone find a way to detect for sure Dolby Vision in raw HEVC.

jessielw commented 2 years ago

Thank you for the quick response. Muxing the same hevc file back to mkv or mp4 does show the proper information.

JeromeMartinez commented 2 years ago

Muxing the same hevc file back to mkv or mp4 does show the proper information.

Normal, you mux a file without Dolby Vision metadata to a MP4 container, and your muxer has the same issue as us (can not decode Dolby Vision in HEVC) so does not fill the right MP4 Dolby Vision metadata.

note that in theory transmuxing from Matroska to MP4 could keep the Dolby Vision metadata but your transmuxing tool must support the copy of Dolby Vision metadata, I don't know such tool yet (the ones I know ignore such metadata, so it is lost).

jessielw commented 2 years ago

How is mkvtoolnix able to properly mux the information from the demuxed or encoded hevc file?

If I demux the hevc from mkv, then remux it back to mkv the proper information is retained.

jessielw commented 2 years ago

Also as of ffmpeg 5.0, ffprobe can now detect the RPUs per frame. I don't know if any of this helps you or not.

quietvoid commented 2 years ago

Dolby Vision data inside the HEVC stream is not documented by Dolby and there is currently no reverse engineering done

As previously mentioned, FFmpeg supports both detecting and decoding the Dolby Vision RPUs within a HEVC stream. It's pretty simple: Dolby decided to use a specific NALU type (62) to carry the data.

Though this should be a feature request to MediaInfoLib, I'm sure there would be a lot of interest for this.

There are also other software capable of doing this, like MKVToolNix.

JeromeMartinez commented 2 years ago

As this is a MediaInfoLib related issue, let's move on the MediaInfolLib corresponding ticket.