Coder Social home page Coder Social logo

Comments (7)

Ashyni avatar Ashyni commented on August 24, 2024

Hello, one thing to try quickly, would be to set deviation = 0, keep the rest with the default values, but the log will help to be sure what going on.

Edit mpv.conf :
log-file=C:\Users\<username>\AppData\Roaming\mpv\mpv.log -- Or any path you can find easily

Post me the log here or on pastebin, i'll take a look.

You can watch the log in realtime in powershell with Get-Content C:\Users\<username>\AppData\Roaming\mpv\mpv.log -Wait | Select-String -Pattern "\[dynamic_crop\]".

I also use FSRCNNX, KrigBilateral, SSSR, SSD with vulkan API, it's not an issue.

from mpv-scripts.

FitzWM avatar FitzWM commented on August 24, 2024

Thanks for the quick reply! I tried adding the script-opts-append=autocrop-deviation=0 option to mpv.conf, but it didn't seem to help, unfortunately. I've attached five files:

  • One mpv.log each for Kingdom of Heaven and Zombieland, with only dynamic-crop.lua installed (all defaults, except deviation=0)
  • Another set of mpv.logs with both dynamic-crop.lua and autocrop.lua, which I've modified not to auto-load and to use K as the shortcut, rather than C. I thought this might help figure out what's being done differently between the two scripts. I waited enough time for dyanmic-crop to have a chance to do its thing, and then ran autocrop manually, which worked for both movies. This is my current stopgap solution - using dynamic-crop most of the time and filling in with manual autocrop when it doesn't work.
  • My mpv.conf, just in case some option or other is causing problems

Just let me know if there's anything else I can do to help diagnose the issue.

kingdom-of-heaven.log
kingdom-of-heaven-autocrop.log
zombieland.log
zombieland-autocrop.log
mpv.conf.txt

from mpv-scripts.

Ashyni avatar Ashyni commented on August 24, 2024

I have updated the documentation,

script-opts-append=autocrop-deviation=0

should be script-opts-append=<script_name>-<option>=<value>, e.g. script-opts-append=dynamic_crop-deviation=0, but it's not the issue anyway.

From the logs, with option debug=true (apparently), the collected meta found for Kingdom of Heaven

w=1920:h=822:x=0:y=126 | offX=0 offY=-3 | detected_total=8.05 ratio=nil -- 2,3357 compare to 1920/2.35=817+-1 (816 or 818 to match)
w=1920:h=820:x=0:y=128 | offX=0 offY=-2 | detected_total=1.752 ratio=nil 
w=1920:h=822:x=0:y=128 | offX=0 offY=-1 | detected_total=5.258 ratio=nil -- 2,3357
w=1920:h=824:x=0:y=126 | offX=0 offY=-2 | detected_total=0.917 ratio=nil 

and for Zombieland,

w=3840:h=1606:x=0:y=276 | offX=0 offY=-1 | detected_total=0.248 ratio=true 
w=3840:h=1608:x=0:y=276 | offX=0 offY=0 | detected_total=0.417 ratio=true 
w=3840:h=1604:x=0:y=278 | offX=0 offY=0 | detected_total=15.727 ratio=nil -- 2.39401 compare to 3840/2.39=1606.69+-1 (1606 or 1608 to match)
w=3840:h=1606:x=0:y=278 | offX=0 offY=1 | detected_total=0.835 ratio=true 

This show me that the collected meta is not match as known ratio, that's why the script doesn't approve the crop in 5sec (+1sec allowed to deviate) but should eventually be able to be approved as a fallback after 20sec (+1) in a stable light scene (which can be harder to get, but pass eventually).

I will work on something to get more tolerance on this, in the meantime you can adjust the list of ratios or reduce new_fallback_timer and increase deviation to 2 or 3 sec, e.g.
script-opts-append=dynamic_crop-new_fallback_timer=15, don't go to low, or you will end up with false positive crop
script-opts-append=dynamic_crop-deviation=2
script-opts-append=dynamic_crop-ratios={2.4, 2.394, 2.39, 2.35, 2.335, 2.2, 2, 1.85, 16 / 9, 5 / 3, 1.5, 4 / 3, 1.25, 9 / 16} -- doesn't work, i'm going to alter the format

from mpv-scripts.

FitzWM avatar FitzWM commented on August 24, 2024

OK, so good news and bad news. The good news is that simply adding the additional ratios seems to have solved the problem for Kingdom of Heaven, Zombieland, and Pirates of the Caribbean, in addition to the freshly merged Return of the King I just made. The bad news is that Kingdom of Heaven and Paprika continue to cause issues, even when I also added 2.347 to the list (basing that off the 1920x818 dimensions arrived at by autocrop for Kingdom). Oddly, as you said, both Kingdom and Paprika will eventually crop correctly once they hit that fallback of 20 seconds, or 15 if you edit. Can I ask what is done differently at that point that makes it work properly?

Also, I found that adding the options via script-opts-append in mpv.conf caused dynamic-crop to crash upon starting any file, but simply editing the options in the script itself worked fine. No idea why, but I thought I'd report it.

Edit: Even modifying the other parameters doesn't get those two to work properly. Very strange.

from mpv-scripts.

Ashyni avatar Ashyni commented on August 24, 2024

Hello, multiple change that will help with your case have been made, give it a try.

Can I ask what is done differently at that point that makes it work properly?

Simple, new_known_ratio_timer is checked with the list of ratios and new_fallback_timer without it (all stable collected meta long enough)

I recommend avoiding added more ratio to the default list, to reduce the chance of a false positive cropping, and give time to the script to approve the first change of ratio.

You can speed up your test with ], reset with backspace.

Thanks for all the feedback.

Edit: bug fix in the meantime, be sure you have the latest version.

from mpv-scripts.

FitzWM avatar FitzWM commented on August 24, 2024

Hey, apologies for the late response. The fixes really seem to have helped! All but one of the movies I've tested now work as expected without further tweaking. Kingdom of Heaven, though, for whatever reason, simply refuses to crop normally, requiring the full new_fallback_timer period to expire before it will, finally, crop perfectly correctly. Maybe it's just something weird with that one file? In any case, everything else, across a few different aspect ratios and resolutions, seems to be working, so that's great! And I can always threaten the stubborn few with Handbrake...

from mpv-scripts.

Ashyni avatar Ashyni commented on August 24, 2024

The log that you gave me for Kingdom of Heaven, show a 2.3357 aspect ratio, but the fallback timer is here for that.

You should try Interstellar with this script, it's a case of use where it shines.

I consider this case closed, Happy Video !

from mpv-scripts.

Related Issues (16)

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.