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 a property to show the active vf filters #15925

Open
hooke007 opened this issue Feb 20, 2025 · 7 comments
Open

Add a property to show the active vf filters #15925

hooke007 opened this issue Feb 20, 2025 · 7 comments

Comments

@hooke007
Copy link
Contributor

Expected behavior of the wanted feature

The ideal use case:

  • run mpv with --hwdec=auto
  • insert any active vf filter (mpv will enable auto-copy)
  • remove all filters (mpv will switch to auto)

I tried to find a property to make a simple auto-profile/script to make it come true. But the reliable property seems not be exist.
vf is just a simple string. Even though invalid values were set, check vf will return True.

Is it possible to add a property to show the active vf filters (like vo-passes can allow checking the active shader)?

Alternative behavior of the wanted feature

Or other better methods?

Log File

N/A

Sample Files

N/A

@Dudemanguy
Copy link
Member

vf will always return a table. When there are no filters, the table length is zero. There's no clever way to deal with this with using auto profiles currently AFAIK since vf will never be nil. So new functionality would have to be added to it.

@guidocella
Copy link
Contributor

profile-cond=vf[1]

@Dudemanguy
Copy link
Member

Oh yeah that works.

@hooke007
Copy link
Contributor Author

profile-cond=vf[1]

Not perfect. Disabled filters will also be treated as 'active' ones.

@hooke007
Copy link
Contributor Author

Is it possible to add a property to show the active vf filters (like vo-passes can allow checking the active shader)?

Please reopen the issue. Because vf chain can be disabled internally (i.e. filters are disabled by labels or incompatible pixel formats). I wish a property to observe the 'active' filters. Which will be also useful in the script.

@hooke007 hooke007 changed the title automatically set copy mode if hwdec was enabled Add a property to show the active vf filters Feb 21, 2025
@Dudemanguy Dudemanguy reopened this Feb 21, 2025
@guidocella
Copy link
Contributor

guidocella commented Feb 21, 2025

profile-cond=(function() for _, filter in pairs(vf) do if filter.enabled then return true end end end)()

@hooke007
Copy link
Contributor Author

Seems to be a workaround.

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

No branches or pull requests

3 participants