occivink / mpv-scripts

Various scripts for mpv
The Unlicense
417 stars 38 forks source link

blur edges failes due to `video_aspect (a nil value)` #73

Closed kars0n777 closed 8 months ago

kars0n777 commented 8 months ago

mpv verison 0.37.0 artix linux 6.6.2-zen1-1-zen

mpv fails to run blur edges when i activate it or when it automatically runs in fullscreen.

this is the error:

[blur_edges] Lua error: /home/karson777/.config/mpv/scripts/blur-edges.lua:44: attempt to perform arithmetic on local 'video_aspect' (a nil value)

kars0n777 commented 8 months ago

I even got the same error when running mpv --no-config --script=~/.config/mpv/scripts/blur-edges.lua Serial\ Experiments\ Lain\ -\ S01E01.mkv

dexeonify commented 8 months ago

At line 41, change video-aspect to video-aspect-override:

function set_blur()
    if applied then return end
    if not mp.get_property("video-out-params") then return end
    if opts.only_fullscreen and not mp.get_property_bool("fullscreen") then return end
-   local video_aspect = mp.get_property_number("video-aspect")
+   local video_aspect = mp.get_property_number("video-aspect-override")
    local ww, wh = mp.get_osd_size()
kars0n777 commented 8 months ago

That worked! Thank you. Can someone make a pull request for this? Since it's still just video-aspect in the main branch.