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

Dolby Vision no longer works #571

Closed
UnknownCoder807 opened this issue Oct 7, 2023 · 22 comments
Closed

Dolby Vision no longer works #571

UnknownCoder807 opened this issue Oct 7, 2023 · 22 comments

Comments

@UnknownCoder807
Copy link

Since the change to the HDR/SDR detection code, Dolby Vision is no longer correctly detected on tvOS.

I don't have a DV Tele or any DV content so I can't test but I am getting multiple reports.

@kingslay
Copy link
Owner

kingslay commented Oct 7, 2023

那把KSOptions.displayCriteriaMatchingEnabled 设置为false是不是就不会有问题了

@UnknownCoder807
Copy link
Author

If I disable that setting then no video will be detected as HDR/DV.

Previously both HDR and DV was detected perfectly. Now only HDR is.

@kingslay
Copy link
Owner

kingslay commented Oct 7, 2023

重载的preferredDisplayCriteria 方法的实现方法你是怎么写的呢?反馈不能显示DV的用户是用tvOS 16还是tvOS17呢?

@UnknownCoder807
Copy link
Author

UnknownCoder807 commented Oct 7, 2023

I use the exact same code in the override as the function is. Except I added an if statement to check if user has come from live or vod - so I can disable hdr on the fly. I can’t post code as I am away from computer.

Dolby vision is detected as HDR. Using tvOS 17

@kingslay
Copy link
Owner

kingslay commented Oct 7, 2023

那可能是tvOS 17的方法判断不准,所以不要用
if #available(tvOS 17.0, *) {
if let formatDescription = track.formatDescription {
return AVDisplayCriteria(refreshRate: refreshRate, formatDescription: formatDescription)
} else {
return nil
}
}

还是继续用
let videoDynamicRange = track.dynamicRange(self).rawValue
return AVDisplayCriteria(refreshRate: refreshRate, videoDynamicRange: videoDynamicRange) 来判断吧

@cdguy
Copy link

cdguy commented Oct 7, 2023

since your commit about dynamic range 485f995 all DV content are forced to HDR

@cdguy
Copy link

cdguy commented Oct 7, 2023

sorry @kingslay the issue started after this discussion:
#563

the "old code" would work perfectly

@cdguy
Copy link

cdguy commented Oct 7, 2023

you can also have a look at this one too @kingslay

4c27f4c

@kingslay
Copy link
Owner

kingslay commented Oct 7, 2023

那就是AVDisplayCriteria(refreshRate: refreshRate, formatDescription: formatDescription) 这个方法是不支持DV的。那我先默认不开启AVDisplayCriteria(refreshRate: refreshRate, formatDescription: formatDescription)

@cdguy
Copy link

cdguy commented Oct 7, 2023

thank you I will try,

also can you please update the testflight tracy player?

thank you

@kingslay

@UnknownCoder807
Copy link
Author

UnknownCoder807 commented Oct 7, 2023

I don't know why, but since you renamed the settings to toggle HDR/SDR my code no longer works.

It probably never worked before, because you were setting displayCriteriaMatchingEnabled to true and now you set to false.

I set

myOptions.contentMatchingLive = true
KSOptions.displayCriteriaFormatDescriptionEnabled = true

and inside my myOptions() class, displayCriteriaFormatDescriptionEnabled is always false

public class meOptions: KSOptions {
    var contentMatchingLive = false
    
    #if os(tvOS)
    override open func preferredDisplayCriteria(track: some MediaPlayerTrack) -> AVDisplayCriteria? {
            if contentMatchingLive {
                let refreshRate = track.nominalFrameRate
                if KSOptions.displayCriteriaFormatDescriptionEnabled, let formatDescription = track.formatDescription, #available(tvOS 17.0, *) {
                    return AVDisplayCriteria(refreshRate: refreshRate, formatDescription: formatDescription)
                }
        }
        
        return nil
    }
}

@kingslay
Copy link
Owner

kingslay commented Oct 7, 2023

你看我最新的提交 我改了 你试下

@UnknownCoder807
Copy link
Author

Already using the latest code.

No matter where I set displayCriteriaFormatDescriptionEnabled to true, it is always false in the override for the display criteria.

@kingslay
Copy link
Owner

kingslay commented Oct 7, 2023

displayCriteriaFormatDescriptionEnabled 要设置为false。tvOS17那个新的api是不兼容dv格式的。所以还是要用老的方式来设置

@UnknownCoder807
Copy link
Author

ok, I understand about DV. but toggling HDR/SDR switching via the old displayCriteriaMatchingEnabled switch you added worked 100%. You have renamed it to displayCriteriaFormatDescriptionEnabled and set it to false by default.

It is not possible to set this to true. In the preferredDisplayCriteria(track: some MediaPlayerTrack) -> AVDisplayCriteria? function it is always false. it can't be changed to true.

This affects normal HDR as well. there is no switching possible now because displayCriteriaFormatDescriptionEnabled cannot be set to true, ever.

@kingslay
Copy link
Owner

kingslay commented Oct 7, 2023

跟这个开关没有关系。你只要改成用 AVDisplayCriteria(refreshRate: refreshRate, videoDynamicRange: videoDynamicRange) 这个初始化方法来创建 AVDisplayCriteria。 你重载的方法里面 甚至可以不用判断那个开关。 现在的问题是tvos17新的api初始化方法是有问题的话 所以我们要用之前老的初始化方法。 我还保留这个开关是期待后续Apple可以修复这个问题 然后到时就可以把这个开关打开了。

@UnknownCoder807
Copy link
Author

ok, thanks for the information. I will use the other code and this should solve dolby vision?

@edge261
Copy link

edge261 commented Oct 7, 2023

Now this opens again a problem I thought was solved but was a bug instead:

many HDR streams use HLG instead of HDR10, and this code output Dolby Vision.

Thing is, in tvOS, HDR HLG is supposed to be output as HDR10, not Dolby Vision.

https://community.firecore.com/t/hlg-on-3rd-gen-atv-4k/39538/16
https://www.flatpanelshd.com/review.php?subaction=showfull&id=1668063491

@kingslay
Copy link
Owner

kingslay commented Oct 8, 2023

Now this opens again a problem I thought was solved but was a bug instead:

many HDR streams use HLG instead of HDR10, and this code output Dolby Vision.

Thing is, in tvOS, HDR HLG is supposed to be output as HDR10, not Dolby Vision.

https://community.firecore.com/t/hlg-on-3rd-gen-atv-4k/39538/16 https://www.flatpanelshd.com/review.php?subaction=showfull&id=1668063491

你是否可以提供下对应的HDR 、HDR10、 Dolby Vision的视频小片段吗?我看下是否有一些视频属性可以把这三个区分开。

@edge261
Copy link

edge261 commented Oct 8, 2023

Now this opens again a problem I thought was solved but was a bug instead:
many HDR streams use HLG instead of HDR10, and this code output Dolby Vision.
Thing is, in tvOS, HDR HLG is supposed to be output as HDR10, not Dolby Vision.
https://community.firecore.com/t/hlg-on-3rd-gen-atv-4k/39538/16 https://www.flatpanelshd.com/review.php?subaction=showfull&id=1668063491

Can you provide video clips corresponding to HDR, HDR10, and Dolby Vision? I'll see if there are some video attributes that distinguish these three.

Sure thing.

HLG HDR: https://4kmedia.org/travelxp-4k-hdr-hlg-sample/
HDR10: https://4kmedia.org/life-untouched-hdr-uhd-4k-demo/
HDR10+: https://ff.de/hdr10plus-metadata-test/
Dolby Vision: https://4kmedia.org/lg-earth-dolby-vision-uhd-4k-demo/

Also, here's more info about the attributes for HLG HDR videos: http://forum.doom9.org/archive/index.php/t-175533.html

basically, for HLG HDR you must check for the transfer characteristics.

edit: added hdr10+ sample

@kingslay
Copy link
Owner

kingslay commented Oct 8, 2023

@edge261 我试了下
HLG HDR: https://4kmedia.org/travelxp-4k-hdr-hlg-sample/ 识别为 HLG
HDR10: https://4kmedia.org/life-untouched-hdr-uhd-4k-demo/ 识别为HDR10
HDR10+: https://ff.de/hdr10plus-metadata-test/。 识别为HDR10
Dolby Vision: https://4kmedia.org/lg-earth-dolby-vision-uhd-4k-demo/ 识别为dolbyVision
这样是符合预期的吧。

@edge261
Copy link

edge261 commented Oct 8, 2023

@kingslay then why the HLG streams i'm testing are triggering Dolby Vision on my TV instead of the standard HDR10 mode?

I can send you in a email the link of the stream I'm trying to watch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants