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

Add new VideoRangeTypes to fully support DoVi on webOS #10469

Merged
merged 24 commits into from
Mar 23, 2024

Conversation

viktory36
Copy link
Contributor

This commit adds two new values to the VideoRangeType enum to talk about media that have both DOVI and HDR10 or HLG data (DoVi Profile 8) to enable Dolby Vision playback on those browsers.

Changes
Introduced DOVI_with_HDR10_Fallback and DOVI_with_HLG_Fallback VideoRangeType enums, and added references to these new types wherever I found VideoRangeType.HDR10 / HLG.
MediaStream.cs will now test both of it's HDR10/HLG and DOVI conditions before returning the video range type.

Issues
Addresses #10468

@viktory36
Copy link
Contributor Author

The build pipeline does not like the name DOVI_with_HDR10_Fallback as they have underscores. Do you have other suggestions for the enum name?

/home/vsts/work/1/s/Jellyfin.Data/Enums/VideoRangeType.cs(36,5): error CA1707: Remove the underscores from member name Jellyfin.Data.Enums.VideoRangeType.DOVI_with_HDR10_Fallback (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1707) [/home/vsts/work/1/s/Jellyfin.Data/Jellyfin.Data.csproj] /home/vsts/work/1/s/Jellyfin.Data/Enums/VideoRangeType.cs(41,5): error CA1707: Remove the underscores from member name Jellyfin.Data.Enums.VideoRangeType.DOVI_with_HLG_Fallback (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1707) [/home/vsts/work/1/s/Jellyfin.Data/Jellyfin.Data.csproj]

@viktory36 viktory36 changed the title Support dovi hdr fallback Add new VideoRangeTypes to fully support DoVi on webOS Oct 30, 2023
@crobibero
Copy link
Member

crobibero commented Oct 30, 2023

The build pipeline does not like the name DOVI_with_HDR10_Fallback as they have underscores. Do you have other suggestions for the enum name?

Maybe just DOVIHDR10 and DOVIHLG?

it's more difficult since both are acronyms..

@viktory36
Copy link
Contributor Author

viktory36 commented Oct 31, 2023

The build pipeline does not like the name DOVI_with_HDR10_Fallback as they have underscores. Do you have other suggestions for the enum name?

Maybe just DOVIHDR10 and DOVIHLG?

it's more difficult since both are acronyms..

Yup. I was thinking more of what the end user might see - if they navigate over to the playback info screen and find "DOVIHDR10" or "DOVIProfile8" I think that would be more confusing than the current.

DOVIwithHDR10
DOVIwithHLG

DoViHDR10
DoViHLG

DolbyVisionWithHDR10Fallback

I think I like this last one DolbyVisionWithHDR10Fallback the most - don't want to mislead any users into thinking they're seeing DOVI when it's HDR.

Would you be opposed to disabling this warning CA1707? Would throwing that into the jellyfin.ruleset work for the build pipeline to pass?

@viktory36
Copy link
Contributor Author

Changed it to DolbyVisionWithHDR10Fallback. The only failing check now also failed for the initial PR introducing VideoRangeType enums. Not sure what needs to change to correct that.

I also reverted the "Dont assume HLG/HDR10 tonemapper can support DOVI+HLG/HDR10" commit - it makes sense that if the DOVI+HDR10 media were previously reported as HDR10 and had no issues with any HwTonemap, the new range types representing this media should fall in the same bucket.

@viktory36
Copy link
Contributor Author

Dear @nyanmisaka , please let me know your thoughts on this?

@JPVenson JPVenson added good first issue Good for newcomers backend Related to the server backend feature Adding a new feature, or substantial improvements on existing functionality awaiting-feedback The PR is awaiting specific feedback from a contributor; blocked until satisfied labels Nov 30, 2023
Jellyfin.Data/Enums/VideoRangeType.cs Outdated Show resolved Hide resolved
MediaBrowser.Model/Entities/MediaStream.cs Outdated Show resolved Hide resolved
@GeorgeH005
Copy link
Contributor

GeorgeH005 commented Mar 13, 2024

@nyanmisaka I have some changes locally that implement the suggestions above, but I can't push to the pull request branch. Should I open a new pull request, as the author seems inactive? @viktory36 I think there is an option to permit that, if you would be so kind as to enable it.

@nyanmisaka
Copy link
Member

@nyanmisaka I have some changes locally that implement the suggestions above, but I can't push to the pull request branch. Should I open a new pull request, as the author seems inactive? @viktory36 I think there is an option to permit that, if you would be so kind as to enable it.

If the OP still doesn't respond, you can make your branch based on his commits and open a new PR.

@viktory36
Copy link
Contributor Author

Hey @GeorgeH005, I've enabled "allow edits by maintainers" to this PR, and added you as a collaborator to my fork if direct commits to the pr doesn't work.
If that's still not enough to be able to add a commit to this PR, please feel free to raise another.

Thanks and excited to have this on main!

@GeorgeH005
Copy link
Contributor

GeorgeH005 commented Mar 13, 2024

@viktory36 Thank you very much!

@GeorgeH005 GeorgeH005 force-pushed the support-dovi-hdr-fallback branch from c786ff2 to 4780d22 Compare March 13, 2024 17:40
@GeorgeH005
Copy link
Contributor

I pushed the changes and rebased with upstream master. I have a suspicion that more changes are needed, but I am not familiar enough with the codebase to judge that. I will try my best but any guidance is appreciated!

@GeorgeH005 GeorgeH005 force-pushed the support-dovi-hdr-fallback branch from 5fa958b to bbd9628 Compare March 13, 2024 18:40
@GeorgeH005
Copy link
Contributor

@nyanmisaka I know I have bothered you enough today, but I would like your opinion on this, whenever possible. Thanks!

Copy link
Member

@nyanmisaka nyanmisaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When everything is resolved, this should be merged after the relevant changes in jellyfin-web are merged. Merging this one alone will cause regression.

@GeorgeH005
Copy link
Contributor

I will take a look at them when I have some time. I have made some changes on jellyfin-web but I haven't opened a pull request yet.

@viktory36
Copy link
Contributor Author

@GeorgeH005 , there's a PR open for web here with an open review comment: jellyfin/jellyfin-web#4916

Let me take care of that one

@GeorgeH005
Copy link
Contributor

GeorgeH005 commented Mar 14, 2024

@viktory36 I'll be sure to check out your work when I complete this. Thanks for helping!

@GeorgeH005
Copy link
Contributor

GeorgeH005 commented Mar 15, 2024

Done! @viktory36 You may want to add yourself to the CONTRIBUTORS file.

@GeorgeH005 GeorgeH005 force-pushed the support-dovi-hdr-fallback branch from 855b351 to 99d5110 Compare March 15, 2024 23:50
@GeorgeH005
Copy link
Contributor

@nyanmisaka Done!

@nyanmisaka
Copy link
Member

Just want to double check, have you also tested these PRs on real webOS hardware and Chrome with fMP4-HLS enabled?

@GeorgeH005
Copy link
Contributor

@nyanmisaka I have on an LG C3 (webOS 23) and Dolby Vision is triggered as expected (with the patched jellyfin-web ofc), and Safari, with at least some sort of HDR going on for sure. I will test Google Chrome now.

@GeorgeH005
Copy link
Contributor

GeorgeH005 commented Mar 18, 2024

I should note that the file was already a Profile 8.1 mp4 manually tagged as dvh1 via ffmpeg6. Haven't tested the remuxing that should happen when jellyfin/jellyfin-web#4916 is applied. I do not think that it triggered on a separate hev1 mp4 file on the LG via jellyfin, but it did using the same file via its built in media player. But that could be an error with the remuxing parameters on my part

@GeorgeH005
Copy link
Contributor

GeorgeH005 commented Mar 18, 2024

The hev1 mp4 might be something to look into. When converting that I did not specify a "-tag:v:0 hev1" argument I just did a "-i 12345.mkv -c:v copy -c:a copy -sn 12345.mp4". Given that the checks in MediaStream.cs are not solely based on codec tags but also on what I presume is MediaInfo output, our code should not be the problem. I just find it curious that it did trigger when using the TV's built in media player with a usb drive.

@GeorgeH005
Copy link
Contributor

GeorgeH005 commented Mar 18, 2024

@nyanmisaka Any insight is appreciated

@nyanmisaka
Copy link
Member

The hev1 mp4 might be something to look into. When converting that I did not specify a "-tag:v:0 hev1" argument I just did a "-i 12345.mkv -c:v copy -c:a copy -sn 12345.mp4".

Are the source files mentioned here DV P8? What results did you expect?

@GeorgeH005
Copy link
Contributor

GeorgeH005 commented Mar 18, 2024

The source file was an mkv with Dolby Vision Profile 8 but I did not specify a tag when converting the file, so it might have been my fault

@GeorgeH005
Copy link
Contributor

@nyanmisaka Will post the Chrome results in a bit, didn't have the time. The takeaway from the above should be that a correctly formatted Profile 8 file plays just fine on a Dolby Vision capable player, which is an improvement

@viktory36
Copy link
Contributor Author

@GeorgeH005 nitpicked on the DOVIWithSDR enum description a little bit =] I reasoned SDR can commonly appear in 8bit or 10bit color depth, and if DV will be at 10bit depth, then (8bit / 10bit) is a fair statement to make -- though I haven't found a file that has DV with 8bit SDR fallback happening on the same media.

@nyanmisaka
Copy link
Member

The source file was an mkv with Dolby Vision Profile 8 but I did not specify a tag when converting the file, so it might have been my fault

ffmpeg only passes DV metadata from demuxer to muxer when -strict -2 is used.

@GeorgeH005
Copy link
Contributor

I think that I did specify that, but I will run the test again just to be sure.

@GeorgeH005
Copy link
Contributor

GeorgeH005 commented Mar 18, 2024

@nyanmisaka Regardless here is the Chrome DevTools Media page on an HDR capable client.

Screenshot 2024-03-18 at 6 26 59 PM

This seems correct and the colors are as expected.

Again, this is a dvh1 tagged Profile8.1 mp4 file confirmed to work both via the built in LG media player, and via the patched jellyfin build on a DV supporting TV

Copy link
Member

@nyanmisaka nyanmisaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I think this is good to go. The web side fixes should be merged first.

Considering this actually fixes Dolby Vision playback on webOS, IMO this isn't a new feature.

@nyanmisaka nyanmisaka requested a review from a team March 18, 2024 16:35
@GeorgeH005
Copy link
Contributor

GeorgeH005 commented Mar 18, 2024

Considering this actually fixes Dolby Vision playback on webOS, IMO this isn't a new feature.

@nyanmisaka Possibly but it is an improvement!

@GeorgeH005
Copy link
Contributor

Then I think this is good to go. The web side fixes should be merged first.

Agreed

@GeorgeH005
Copy link
Contributor

@nyanmisaka The jellyfin-web team believes this should be merged before theirs.

@nyanmisaka
Copy link
Member

nyanmisaka commented Mar 23, 2024

@nyanmisaka The jellyfin-web team believes this should be merged before theirs.

1. jellyfin/jellyfin-web#4916
2. #10469
3. jellyfin/jellyfin-web#5282

All right. Let's merge this first. cc @crobibero

@crobibero crobibero merged commit 3bbb57e into jellyfin:master Mar 23, 2024
11 of 12 checks passed
@GeorgeH005 GeorgeH005 deleted the support-dovi-hdr-fallback branch March 23, 2024 16:41
SourSulfur pushed a commit to SourSulfur/jellyfin that referenced this pull request Apr 19, 2024
SourSulfur pushed a commit to SourSulfur/jellyfin that referenced this pull request Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-feedback The PR is awaiting specific feedback from a contributor; blocked until satisfied backend Related to the server backend feature Adding a new feature, or substantial improvements on existing functionality good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants