Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better HDR detection for HDR, HDR10, HDR10+, DoVI etc #4844

Closed
EnorMOZ opened this issue Aug 10, 2020 · 11 comments · Fixed by #6865
Closed

Better HDR detection for HDR, HDR10, HDR10+, DoVI etc #4844

EnorMOZ opened this issue Aug 10, 2020 · 11 comments · Fixed by #6865
Assignees
Labels
Area: Scanning Issue is related to media file scanning Type: Feature Request Issue is a feature request.
Milestone

Comments

@EnorMOZ
Copy link
Contributor

EnorMOZ commented Aug 10, 2020

Radarr currently only detects HDR. Ideally it should detect the various HDR formats via mediainfo.
Some examples of HDR mediainfo metadata that be used for HDR, HDR10, HDR10+, DoVI etc

https://pastebin.com/0mzWnMAv

AB#826

@EnorMOZ EnorMOZ added the Type: Feature Request Issue is a feature request. label Aug 10, 2020
@Garnaal1337
Copy link

This will become increasingly important I believe since MKV has fairly recently added support for Dolby Vision. Another thing to note is that streaming content seems to use Dolby Vision profile 5 while UHD Blu-Ray uses profile 7 (which Plex supports). The latest version of MediaInfo (20.09) supports detection of Dolby Vision metadata.
https://makemkv.com/forum/viewtopic.php?f=12&t=22513&start=120
https://mediaarea.net/MediaInfo/ChangeLog

Also, I'm not sure how HDR is detected at the moment, but it seems like Radarr is looking at the color primaries and the transfer characteristics, but not the HDR format stated by MediaInfo. I do seem to have content that does not have HDR format in MediaInfo but should be HDR and has transfer characteristic PQ. It is very possible that this is Dolby Vision HDR that has been created as an MKV before support for Dolby Vision was added, explaining why it also doesn't have HDR10 as HDR format. Eventually, it would also be nice if the renaming function could use the actual MediaInfo reported HDR type to support upgrading HDR 10 to Dolby Vision with custom formats as Dolby Vision gets more common.

@Garnaal1337
Copy link

This seems to have been attempted before by https://github.com/Radarr/Radarr/pull/3959/files, however, I'm unsure if MediaInfo contained HDR_Format at that point in time and I am sure it wasn't able to detect Dolby Vision in MKV files. I've tried playing with this but I haven't gotten anywhere yet. For those interesting in this, please note that you need to have used MakeMKV 1.15.3 to properly have the Dolby Vision metadata added. Here is an example output of the video from MediaInfo 20.09 and a file created with MakeMKV 1.15.3.

{
"@type": "Video",
"StreamOrder": "0",
"ID": "1",
"OriginalSourceMedium_ID": "4113",
"UniqueID": "1",
"Format": "HEVC",
"Format_Profile": "Main 10",
"Format_Level": "5.1",
"Format_Tier": "High",
"HDR_Format": "Dolby Vision / SMPTE ST 2094 App 4",
"HDR_Format_Version": "1.0 / 1",
"HDR_Format_Profile": "dvhe.07 / ",
"HDR_Format_Level": "06 / ",
"HDR_Format_Settings": "BL+EL+RPU / ",
"HDR_Format_Compatibility": "Blu-ray / HDR10+ Profile A / HDR10",
"CodecID": "V_MPEGH/ISO/HEVC",
"Duration": "7317.310000000",
"BitRate": "43497141",
"Width": "3840",
"Height": "2160",
"Sampled_Width": "3840",
"Sampled_Height": "2160",
"PixelAspectRatio": "1.000",
"DisplayAspectRatio": "1.778",
"FrameRate_Mode": "CFR",
"FrameRate": "23.976",
"FrameCount": "175440",
"ColorSpace": "YUV",
"ChromaSubsampling": "4:2:0",
"ChromaSubsampling_Position": "Type 2",
"BitDepth": "10",
"Delay": "0.000",
"StreamSize": "39785258524",
"Language": "en",
"Default": "No",
"Forced": "No",
"colour_description_present": "Yes",
"colour_description_present_Source": "Stream",
"colour_range": "Limited",
"colour_range_Source": "Stream",
"colour_primaries": "BT.2020",
"colour_primaries_Source": "Stream",
"transfer_characteristics": "PQ",
"transfer_characteristics_Source": "Stream",
"matrix_coefficients": "BT.2020 non-constant",
"matrix_coefficients_Source": "Stream",
"MasteringDisplay_ColorPrimaries": "Display P3",
"MasteringDisplay_ColorPrimaries_Source": "Stream",
"MasteringDisplay_Luminance": "min: 0.0001 cd/m2, max: 1000 cd/m2",
"MasteringDisplay_Luminance_Source": "Stream",
"MaxCLL": "285 cd/m2",
"MaxCLL_Source": "Stream",
"MaxFALL": "63 cd/m2",
"MaxFALL_Source": "Stream",
"extra": {
"OriginalSourceMedium": "Blu-ray"
}

@Qstick I've tried adding VideoHDRFormat = mediaInfo.Get(StreamKind.Video, 0, "HDR_Format"), to VideoFIleInfoReader.cs and public string VideoHDRFormat { get; set; } to MediaInfoModel.cs and called that in the HDR section of MediaInfoFormatter.cs. However, I get an error that no value is returned. I've tried updating the MediaInfo.dll but that has not done much for me. Would you know how this can best be integrated? I can continue looking at this tomorrow but any help or tips are greatly appreciated.

@bakerboy448 bakerboy448 added this to the 3.X milestone Nov 14, 2020
@Qstick
Copy link
Member

Qstick commented Nov 18, 2020

@Garnaal1337 you are on the right track, You can take a look at my PR for audio channels where I add MI properties for a general layout. Hop on discord if you want to talk about it more when you have time to work on it.

@raymondtrueman
Copy link

@bakerboy448 I just added a new request for this on #5825 before I found out that there was this request already open. How is the progress going on it? I'm here if you would like someone to bounce some ideas off of

@bakerboy448
Copy link
Contributor

@raymondtrueman nothing on this issue indicates I'm working on it...simply was doing some tag cleanup.

But it's currently in the backlog given no PR or other active work on it

@raymondtrueman
Copy link

@bakerboy448 Sorry I mentioned the wrong person. I meant to tag @Garnaal1337
Hopefully this will get some attention at some point. Its becoming more and more important for new movie releases

@stale
Copy link

stale bot commented Jun 26, 2021

This issue has been automatically marked as stale because it has not had recent activity. Please verify that this is still an issue with the latest version of Radarr and report back. Otherwise this issue will be closed.

@stale stale bot added the stale label Jun 26, 2021
@bakerboy448 bakerboy448 added todo and removed stale labels Jun 26, 2021
@chrisallen
Copy link
Contributor

With the current WIP ffprobe branch having support for DoVi configuration record being read from MKV files (cba602f) Perhaps now is the time to discuss how this could be used in the naming tokens.

Here are some initial suggestions I had;

{MediaInfo VideoDynamicRange} = HDR -or- DoVi -or- HDR+DoVi (both values present = DoVi movies with HDR10 fallback for non-DoVi TVs)

{MediaInfo VideoDynamicRangeFull} = HDR+DoVi 5.0 ( 5 = dv_profile / 0 = dv_bl_signal_compatibility_id as per https://www.diversifiedvideosolutions.com/Dolby_Vision/Dolby_Vision_profiles_and_levels-Dolby_Laboratories.pdf)

The thinking behind having the DoVi profile info there will help people who have devices that do not support particular DoVi profiles.

@Qstick Qstick modified the milestones: v4.0, v4.X Nov 1, 2021
@bakerboy448
Copy link
Contributor

bakerboy448 commented Dec 8, 2021

@ta264 did we tackle this with ffprobe?
f0f8a4f

@rg9400 perhaps you know?

@merc1031
Copy link

Just wanted to link here the PR that added this just recently to Sonarr. Sonarr/Sonarr#4765
After using a container with a proper version of mediainfo(see Sonarr/Sonarr#4794) this worked for me in Sonarr's case (understanding Sonarr and Radarr's code is not the same).

@bakerboy448
Copy link
Contributor

bakerboy448 commented Dec 14, 2021

@merc1031 MediaInfo is no longer used and has been torn out. Hopefully Sonarr goes the same way eventually

I think the linked commit either ended up adding this; if not it seems like it would not be difficult to do

f0f8a4f#diff-ab098d913eba59ae86e991b671037d3bd5ab23cbe3d77bba114fdcdd40fe5c0dR3

f0f8a4f#diff-82d5d55b78957ecd2db81d0a9e398c5ae8e5b89bbbf92c8a8b307a987a0546e0R16

looks like we don't expose the Type in renaming, but we do detected it from a skim of the code

related to #6789

@bakerboy448 bakerboy448 self-assigned this Dec 24, 2021
@bakerboy448 bakerboy448 added the Area: Scanning Issue is related to media file scanning label Dec 24, 2021
bakerboy448 added a commit that referenced this issue Dec 26, 2021
…tect HDR Type New: Display HDR Type in File Media Info Modal

Based on Sonarr 7b694ea

Closes #6789
Fixes #4844

Co-authored-by: ta264 <ta264@users.noreply.github.com>
bakerboy448 added a commit that referenced this issue Dec 26, 2021
New: Detect HDR Type
New: Display HDR Type in File Media Info Modal

Based on Sonarr 7b694ea

Closes #6789
Fixes #4844

Co-authored-by: ta264 <ta264@users.noreply.github.com>
bakerboy448 added a commit that referenced this issue Dec 26, 2021
New: Detect HDR Type
New: Display HDR Type in File Media Info Modal

Based on Sonarr 7b694ea

Closes #6789
Fixes #4844

Co-authored-by: ta264 <ta264@users.noreply.github.com>
bakerboy448 added a commit that referenced this issue Dec 26, 2021
New: Detect HDR Type
New: Display HDR Type in File Media Info Modal

Based on Sonarr 7b694ea

Closes #6789
Fixes #4844

Co-authored-by: ta264 <ta264@users.noreply.github.com>
Co-authored-by: Qstick <qstick@gmail.com>
bakerboy448 added a commit that referenced this issue Dec 27, 2021
New: Detect HDR Type
New: Display HDR Type in File Media Info Modal

Based on Sonarr 7b694ea

Closes #6789
Fixes #4844

Co-authored-by: ta264 <ta264@users.noreply.github.com>
Co-authored-by: Qstick <qstick@gmail.com>
Qstick added a commit that referenced this issue Dec 29, 2021
New: Detect HDR Type
New: Display HDR Type in File Media Info Modal

Based on Sonarr 7b694ea

Closes #6789
Fixes #4844

Co-authored-by: ta264 <ta264@users.noreply.github.com>
Co-authored-by: Qstick <qstick@gmail.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: Scanning Issue is related to media file scanning Type: Feature Request Issue is a feature request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants