Coder Social home page Coder Social logo

mpv-scripts's People

Contributors

ashyni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mpv-scripts's Issues

Is it possible to switch the crop instantly?

For a show like Everything Everywhere All At Once with frequent aspect ratio switches, the zoom changing not being instant can be quite disconcerting. I can change the configuration to the point of switching after 1 frame, but I would love for there to be a way to do it instantly.

Problem with HEVC 10bit videos and strange lua error

First of all, thanks for your work. This script is really shaping up to be amazing.

Unfortunately, I'm having a couple of issues.
The first one is this:

image

I noticed it seems to happen whenever I start mpv in a paused state, which is how I always do it.
Deleting lines 513, 514 and 516 allows me to proceed, but I'm not sure what's going on here.

The other issue is related to HEVC 10bit video files. This "loop" happens when playing such files:

image

The formats keep changing during the entire playback. This causes some heavy stutter on my machine, specially if I'm using vapoursynth filters.

I'm not sure if anything can be done about this, but if you want to test for yourself, the HEVC 10bit video I used is "jellyfish-90-mbps-hd-hevc-10bit.mkv" from this page: https://jell.yfish.us/

Difficulty to validate odd meta (e.g. height moving back and forth from 816 to 818 regularly)

Hi, and let me say first, thanks for the great script. It certainly makes watching the Nolan Batman films significantly more enjoyable. I'd like to use it all the time, but unfortunately, it's failing for me on seemingly random files, no matter what options I change, even though the "traditional" autocrop.lua script seems to handle them fine. When I say failing, I mean that the script runs - I can see that in the stats screen - but it doesn't do anything, no matter how long or wait, skip around, or toggle it off and on. Changing modes doesn't help either, nor do turning off the "reset" or "skip" options, though I admit my understanding of those is less than minimal. I tried activating debug mode, but I couldn't figure out where to find the debug info; I'd be glad to provide it if you could tell me where it is.

The really annoying thing (since I'd like to provide a more useful bug report) is that there doesn't seem to be anything tying the "problem files" together. A few examples:

  • Kingdom of Heaven: Director's Cut - MakeMKV rip, x264, 1920x1080 video, actual 2.39:1 aspect ratio
  • Paprika - MakeMKV rip, MPEG-2, 1920x0180 video, actual 1:85:1 aspect ratio
  • Pirates of the Carribbean - MakeMKV rip, x264, 1920x1080 video, actual 2.39:1 aspect ratio
  • Zombieland - Handbrake encode, x264, 3840x2160 video, actual 2.39:1 aspect ratio

There are a couple others, but those are the ones I can recall right now. What's weird is that I have dozens of movies with exactly the same specs that all work just fine with your script. I can't figure out what the issue is. Obviously, the problem goes away if I run them through Handbrake and crop them, but that rather defeats the point of an autocrop script.

Anyway, thanks again, and I hope things are going well for you.

Edit: Forgot to add my specs.

  • Windows 10 Pro 21H1
  • mpv build mpv 0.33.0-177-gfd8c673cfc (x64)
  • AMD Ryzen 5800X CPU w/ 32 GB DDR4-3600c16 RAM
  • NVIDIA GTX 1080 Ti GPU (Driver version 471.11)
  • AOC AGON 34" 3440x1440 G-SYNC monitor
  • Latest version of the script, which I downloaded just a few days ago

I typically use the vulkan API and winvk context, along with the FSRCNNX and SSIMDownscaler shaders. I've tried turning all my shaders off, though, as well as changed to various APIs, but no luck.

Smooth transitions

I'm not sure if possible but would be nice if the transitions were less abrupt when cropping the black bars. Especially for movies like The Dark Knight that have a dynamic aspect ratio, having a smooth cropping operation would be easier on the eyes i.e. when film goes 16:9 => 21:9 the video enlarges gradually

The script of dynamic-crop.lua has incorrect crops on some video scenes.

Setup:

Additional context
Only use dynamic-crop.lua to test.

Describe the bug

  1. In videos with fast changing black bars, the script sometimes can't recognize the changes of black bars in time, so as to cancel the vf filter.
  2. In videos with normal upper and lower black bars, scripts sometimes incorrectly crop the video, causing the video to move down.

Expected behavior
The script can handle these video scenes correctly

Screenshots
For the first scene:

For the second scene:

These are test video: https://1drv.ms/u/s!ArMFy8JIhLKH51msuqyLi4q0xIjf?e=vSYLXg
The first bug appeared in the video of crop1.mkv at 00:01:13.167.
The second bug appears after 00:00:50.509 in the video of crop2.mkv.

Cropping a Dolby Vision video breaks tone mapping

Setup (please complete the following information):

  • OS: Windows 11 22H2
  • Player: mpv
  • Player Version: 0.35.0-210-ge439ddc0
  • Video Quality: 1080p HEVC Dolby Vision Profile 5

Describe the bug
This is a very specific use case and is definitely not common, but I figured I'd mention it here anyway. While the dynamic crop script does work perfectly in cropping black bars, if the video needs tone mapping of any kind, such as with vo=gpu-next and target-colorspace-hint=yes, this script makes it no longer possible. I'm assuming this is due to the fact that its using LAV filters to determine the black bars, and the images the filters are grabbing are not tone mapped.

I've tried using vf-append or vf-pre to add the correct tone mapping filters back to the video after cropping, but that did not work either.

dynamic-crop.lua script causes OSD to bug out in fullscreen

Setup (please complete the following information):

  • OS: Windows 7 Build 7601 Service Pack 1
  • Player: mpv
  • Player Version: v0.36.0
  • Video Quality: 1080pH.264 /2160p HDR H265 or any song, doesn't matter

Additional context
MPV config:
script="C:\Program Files\MPV\scr\dynamic-crop.lua"
hwdec=no
vo=gpu-next

Log file

output.txt

Describe the bug
When you go fullscreen, the OSD bugs out, pulsates/flickers. OSD doesn't disappear after time, it displays all the time.

Expected behavior
After fullscreen, OSD acts as usual, don't bug out, and disappear after 2 seconds.

Screenshots
dfdf

Doesn't work with the YouTube playlist URL

Setup (please complete the following information):

  • OS: Arch Linux
  • Player: mpv
  • Player Version: 0.35.1

Additional context
No additional mpv configuration.

Describe the bug
It works with local files.
It works with YouTube video URLs.
It works with the m3u files that contain YouTube URLs.

But it doesn't work with the YouTube playlist URL.

Example: https://www.youtube.com/playlist?list=PLWtysTkuEQDPfEJtInFvAU7zgMiYLXSRq

[dynamic_crop]
[dynamic_crop] stack traceback:
[dynamic_crop]  /home/user/.config/mpv/scripts/dynamic-crop.lua:733: in function 'handler'
[dynamic_crop]  mp.defaults:510: in function 'call_event_handlers'
[dynamic_crop]  mp.defaults:552: in function 'dispatch_events'
[dynamic_crop]  mp.defaults:503: in function <mp.defaults:502>
[dynamic_crop]  [C]: at 0x558d230d75e0
[dynamic_crop]  [C]: at 0x558d230d7aa0
[dynamic_crop] Lua error: /home/user/.config/mpv/scripts/dynamic-crop.lua:157: attempt to index field 'stats' (a nil value)
Playing: https://www.youtube.com/watch?v=6Ejga4kJUts
 (+) Video --vid=1 (*) (vp9 3840x2160 24.000fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)

Breakage in "insert_cropdetect_filter" function, "::insert::" label not recognised.

Setup (please complete the following information):

  • OS: Gentoo Linux
  • Player: mpv
  • Player Version: 0.34.1
  • (Lua Version: 5.4.4-r103)

Describe the bug
Script fails to start due to a Lua error:

[dynamic_crop]
[dynamic_crop] stack traceback:
[dynamic_crop] 	[C]: ?
[dynamic_crop] 	[C]: ?
[dynamic_crop] Lua error: [string "/home/houston/.config/mpv/scripts/dynamic-crop.lua"]:117: unexpected symbol near ':'

If there's any more specific environment information you need, I can provide it. I don't believe I've changed any of the config options from their defaults.

Black screen in middle of movie (i.e. announcing new chapter with white text) and jellyfin goes beserk.

Hey, great script so far, but not bug free.

I'm watching 4K movies with friends (Syncplay) through my own server, using official jellyfin media player, and when a black screen i.e. occurs in middle of movie the player becomes extremely laggy and it takes a minute or more to 'catch up' and resync, unless done manually.

Not sure if this is a known issue, but potentially solvable by just detecting the proper aspect ratio/cropping and no longer change anything after the initial 'initialization'.

I don't think that is an ideal solution though as it wouldn't be the first time a movie or serie changes aspect ratios, also it could give false positives on initial analysis.

Question on use with Anamorphic Lens

If I want this script to crop and stretch scope movies (2.39 / 2.35) but ignore everything else would I just change this line?

ratios = "24/9 2.4 2.39 2.35 2.2 2 1.85 16/9 5/3 1.5 4/3 1.25 9/16"

change to -

ratios = "2.4 2.39 2.35 2.2",

Will this now ignore 1.78 / 1.85?

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.