Giter VIP home page Giter VIP logo

Comments (5)

Argon- avatar Argon- commented on August 21, 2024

https://github.com/wm4/mpv-scripts/blob/master/auto-profiles.lua#L20

from mpv-config.

JulianLai avatar JulianLai commented on August 21, 2024

@Argon- It still doesn't explain what math.huge or -math.huge is.

from mpv-config.

Argon- avatar Argon- commented on August 21, 2024

http://lua-users.org/wiki/MathLibraryTutorial

from mpv-config.

JulianLai avatar JulianLai commented on August 21, 2024

@Argon- Why do we put an infinity number there? If I put 0 in that block, it will apply the profile which shouldn't be applied.

It applied 2 profiles here:

[auto_profiles] Applying profile SD 
Playing: /home/laichiaheng/影片/電影&短片/八惡人/The Hateful Eight.mkv
[lavf] Using subtitle charset: utf-16le
 (+) Video --vid=1 (*) 'The.Hateful.Eight.2015.1080p.BluRay.x264.DTS-HD.MA.5.1-RARBG' (h264 1920x704 23.976fps)
     Video --vid=2 [P] 'cover_land.jpg' (mjpeg)
     Video --vid=3 [P] 'small_cover.jpg' (mjpeg)
     Video --vid=4 [P] 'small_cover_land.jpg' (mjpeg)
     Video --vid=5 [P] 'cover.jpg' (mjpeg)
 (+) Audio --aid=1 --alang=eng (*) 'The.Hateful.Eight.2015.1080p.BluRay.x264.DTS-HD.MA.5.1-RARBG' (dts 6ch 48000Hz)
     Subs  --sid=1 --slang=eng (*) 'English-SDH-PGS' (hdmv_pgs_subtitle)
     Subs  --sid=2 --slang=spa 'Spanish-PGS' (hdmv_pgs_subtitle)
 (+) Subs  --sid=3 '.The Hateful Eight.srt' (subrip) (external)
File tags:
 Title: RARBG.COM - The.Hateful.Eight.2015.1080p.BluRay.x264.DTS-HD.MA.5.1-RARBG
AO: [pulse] 48000Hz 5.1(side) 6ch s32
[auto_profiles] Applying profile HDravu 
Using hardware decoding (vaapi-copy).
VO: [opengl] 1920x704 nv12
[vo/opengl] after rendering: OpenGL error INVALID_OPERATION.
[vo/opengl] after rendering: OpenGL error INVALID_OPERATION.
[vo/opengl] after rendering: OpenGL error INVALID_OPERATION.
[vo/opengl] after rendering: OpenGL error INVALID_OPERATION.
AV: 00:00:00 / 02:47:44 (0%) A-V: -0.004 DS: 2.636/1
[osd/libass] fontselect: Using default font family: (Source Sans Pro, 400, 0) -> /usr/share/fonts/noto/NotoSansCJK-DemiLight.ttc, 3, NotoSansCJKtc-DemiLight
[osd/libass] fontselect: Using default font family: (Source Sans Pro, 700, 0) -> /usr/share/fonts/noto/NotoSansCJK-Black.ttc, 3, NotoSansCJKtc-Black
AV: 00:00:02 / 02:47:44 (0%) A-V:  0.003 DS: 2.552/1

My profile:

[UHD30]
profile-desc=cond:get('height', 0) > 1080 and get('container-fps', 0) >24
hwdec=vaapi

[UHD24]
profile-desc=cond:get('height', 0) > 1080 and get('container-fps', 0) <=24
interpolation
tscale=catmull_rom
hwdec=vaapi

[FHDoff]
profile-desc=cond:get('height', 0) <= 1080 and get('height', 0) >=800 and get('container-fps', 0) >= 59
profile=opengl-hq
hwdec=no

[FHDon]
profile-desc=cond:get('height', 0) <= 1080 and get('height', 0) >=800 and get('container-fps', 0) < 59
profile=opengl-hq
hwdec=vaapi-copy

[HDnormal]
profile-desc=cond:get('height', 0) <= 720 and get('height', 0) > 576 and get('container-fps', 0) >= 59
hwdec=vaapi
profile=opengl-hq

[HDravu]
profile-desc=cond:get('height', 0) <= 720 and get('height', 0) > 576 and get('container-fps', 0) < 59
hwdec=vaapi-copy
deband
opengl-shaders='/home/laichiaheng/.config/mpv/shaders/ravu-r3.hook' 

[SD]
profile-desc=cond:get('height', 0) <= 576
deband
hwdec=vaapi-copy
opengl-shaders='/home/laichiaheng/.config/mpv/shaders/ravu-r3.hook'

from mpv-config.

Argon- avatar Argon- commented on August 21, 2024

Why? Well, because I want it to be that way.
When you put a default value that will satisfy the condition, it instantly gets applied. When you do this, you also need an "inverse" profile with inverted conditions that can reverse what an applied profile did (see my 4K and 4K-inverted).

See your [SD] profile. It will always get activated as it's run before the file is loaded. It will set the ravu shader but this is never removed.
Example: you open a file. Profiles are evaluated and your SD is true by default, so it gets applied and its options get set.
Now the file is loaded, file information present and therefore profiles are re-evaluated. Let's assume we have a 4K file with 60fps. Consequently, [UHD30] gets applied. It changes hwdec but deband and opengl-shaders are still set.

from mpv-config.

Related Issues (17)

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.