Giter Club home page Giter Club logo

Comments (22)

kingslay avatar kingslay commented on June 20, 2024

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

from ksplayer.

UnknownCoder807 avatar UnknownCoder807 commented on June 20, 2024

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.

from ksplayer.

kingslay avatar kingslay commented on June 20, 2024

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

from ksplayer.

UnknownCoder807 avatar UnknownCoder807 commented on June 20, 2024

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

from ksplayer.

kingslay avatar kingslay commented on June 20, 2024

那可能是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) 来判断吧

from ksplayer.

cdguy avatar cdguy commented on June 20, 2024

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

from ksplayer.

cdguy avatar cdguy commented on June 20, 2024

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

the "old code" would work perfectly

from ksplayer.

cdguy avatar cdguy commented on June 20, 2024

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

4c27f4c

from ksplayer.

kingslay avatar kingslay commented on June 20, 2024

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

from ksplayer.

cdguy avatar cdguy commented on June 20, 2024

thank you I will try,

also can you please update the testflight tracy player?

thank you

@kingslay

from ksplayer.

UnknownCoder807 avatar UnknownCoder807 commented on June 20, 2024

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
    }
}

from ksplayer.

kingslay avatar kingslay commented on June 20, 2024

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

from ksplayer.

UnknownCoder807 avatar UnknownCoder807 commented on June 20, 2024

Already using the latest code.

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

from ksplayer.

kingslay avatar kingslay commented on June 20, 2024

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

from ksplayer.

UnknownCoder807 avatar UnknownCoder807 commented on June 20, 2024

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.

from ksplayer.

kingslay avatar kingslay commented on June 20, 2024

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

from ksplayer.

UnknownCoder807 avatar UnknownCoder807 commented on June 20, 2024

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

from ksplayer.

edge261 avatar edge261 commented on June 20, 2024

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

from ksplayer.

kingslay avatar kingslay commented on June 20, 2024

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的视频小片段吗?我看下是否有一些视频属性可以把这三个区分开。

from ksplayer.

edge261 avatar edge261 commented on June 20, 2024

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

from ksplayer.

kingslay avatar kingslay commented on June 20, 2024

@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
这样是符合预期的吧。

from ksplayer.

edge261 avatar edge261 commented on June 20, 2024

@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.

from ksplayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.