Code Monkey home page Code Monkey logo

Comments (10)

christoph-heinrich avatar christoph-heinrich commented on June 11, 2024

It's still there on that commit and also on the latest one. Btw that was a local file, but it also happens on streams.

Edit: does not happen on a 2:1 stream (https://www.youtube.com/watch?v=pfM-JUoaOHI)

from thumbfast.

hooke007 avatar hooke007 commented on June 11, 2024

It looks like a filter's crop/pad logic.
For ????x1080(width should be longer) source, set thumb max height to 270 would be fine(no black pad).

from thumbfast.

Zabooby avatar Zabooby commented on June 11, 2024

On 1980x1080 and experiencing the same issue.
Tried changing max height to 270 but it didn't fix it.

from thumbfast.

hooke007 avatar hooke007 commented on June 11, 2024

I'm not sure if it should be a issue because mpv handle the pad in the same logic.

Snipaste_2022-09-21_14-15-00

from thumbfast.

christoph-heinrich avatar christoph-heinrich commented on June 11, 2024

Then the calculated output resolution needs to take that behavior of mpv into account to not end up with padding on the side.
Maybe there is a configuration to tell mpv to not do that (I have never noticed that on any of my windows, so I'll check my config)

Edit: does happen with my config, I just never noticed.

from thumbfast.

hooke007 avatar hooke007 commented on June 11, 2024

Ah I saw the pad here. It looks like intended.

"--vf="..vf_string(filters_all).."scale=w="..effective_w..":h="..effective_h..par..",pad=w="..effective_w..":h="..effective_h..":x=(ow-iw)/2:y=(oh-ih)/2,format=bgra",


edit:

            "--vf="..vf_string(filters_all).."scale=w="..effective_w..":h="..effective_h..",format=bgra",

LGTM

from thumbfast.

po5 avatar po5 commented on June 11, 2024

We add padding if necessary because media files are big liars, the resolution may change in the middle of the file (see discord resize memes).
Since the output is raw bgra, we can't just guess what resolution it really spat out from filesize, so instead we force the output to be a known expected resolution.
Something must be slightly wrong about the x=(ow-iw)/2:y=(oh-ih)/2 formula (this should do padding that keeps the image centered, if padding is needed), I think I introduced the issue when making thumbnails mod2 resolutions because some videos would break.

from thumbfast.

christoph-heinrich avatar christoph-heinrich commented on June 11, 2024

Is it possible to output to something that contains resolution information instead of just bgra? I've tried mpv --of=help but it doesn't output anything for me.

from thumbfast.

tomasklaen avatar tomasklaen commented on June 11, 2024

Afaik you can only use bgra as an overlay image: https://mpv.io/manual/master/#command-interface-overlay-add

from thumbfast.

po5 avatar po5 commented on June 11, 2024

Fat fingered the close issue button (:

mpv only accepts bgra, and we don't have much in the way of cross-process communication, if we want it to work on Windows out of the box it has to be one-way only as it is now.

from thumbfast.

Related Issues (20)

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.