Skip to content

need help with lua script (dynamic hdr-peak-percentile) #16290

Answered by hooke007
geextahslex asked this question in Q&A
Discussion options

You must be logged in to vote
local function check(name, value)
    if value == nil then
        return
    end

    if value >= 0.7 and value < 1 then
        mp.set_property("hdr-peak-percentile", "99.8")
    elseif value >= 0.3 and value < 0.7 then
        mp.set_property("hdr-peak-percentile", "99.9")
    else
        mp.set_property("hdr-peak-percentile", "100")
    end
end

mp.observe_property("video-out-params/avg-pq-y", "native", check)

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
4 replies
@geextahslex
Comment options

@kasper93
Comment options

@geextahslex
Comment options

@geextahslex
Comment options

Comment options

You must be logged in to vote
4 replies
@hooke007
Comment options

@geextahslex
Comment options

@hooke007
Comment options

Answer selected by geextahslex
@geextahslex
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants