Skip to content

Can I get the settings for a specific filter in a lua script? #16389

Answered by verygoodlee
Rabcor asked this question in Q&A
Discussion options

You must be logged in to vote

mpv/DOCS/man/vf.rst

Lines 15 to 17 in 1d1535f

Before the filter name, a label can be specified with ``@name:``, where
name is an arbitrary user-given name, which identifies the filter. This
is only needed if you want to toggle the filter at runtime.

KEY  vf toggle @yourlabel:crop=100:100:0:0

for _, f in ipairs(mp.get_property_native('vf', {})) do
    if f.label == 'yourlabel' and f.name == 'crop' then
        print(f.params['@0']) -- 100
        print(f.params['@1']) -- 100
        print(f.params['@2']) -- 0
        print(f.params['@3']) -- 0
    end
end

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
3 replies
@Rabcor
Comment options

@verygoodlee
Comment options

Answer selected by Rabcor
@Rabcor
Comment options

Comment options

You must be logged in to vote
3 replies
@Rabcor
Comment options

@guidocella
Comment options

@Rabcor
Comment options

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