marzzzello / mpv_thumbnail_script

A Lua script to show preview thumbnails in mpv's OSC seekbar, sans external dependencies (fork)
GNU General Public License v3.0
270 stars 20 forks source link

Fix rotated videos #41

Open po5 opened 1 year ago

po5 commented 1 year ago

Closes #4

NicolaSmaniotto commented 1 year ago

This does not solve the issue for me, the thumbnail has the correct aspect ratio, but the image is still glitched.

Here is the result with the video in https://github.com/marzzzello/mpv_thumbnail_script/issues/4#issuecomment-992027155.

Screenshot_20230713_121649

po5 commented 1 year ago

Weird, can you try it in thumbfast with a compatible UI? We do the same thing there and it seems to work.
Let me know if the PR is badly implemented or if thumbfast's fix itself is not sufficient.

NicolaSmaniotto commented 1 year ago

It works with thumbfast (vanilla osc).

Screenshot_20230715_114412

I'm confused, also because the PR does fix the issue in some cases.

Here is a test I made https://github.com/marzzzello/mpv_thumbnail_script/assets/22083075/4f1d577c-de84-4617-b0dc-977c8e68944d Here are the results: Thumbnail from the landscape file, opening the landscape file: ![Screenshot_20230715_121322](https://github.com/marzzzello/mpv_thumbnail_script/assets/22083075/b68f906e-6560-4176-8f62-f45b23fa25c0) Thumbnail from the landscape file, opening the portrait file: ![Screenshot_20230715_121523](https://github.com/marzzzello/mpv_thumbnail_script/assets/22083075/5222167d-cd4f-4097-b1a4-7c1035dfaa71) Thumbnail from the portrait file, opening the portrait file: ![Screenshot_20230715_21704](https://github.com/marzzzello/mpv_thumbnail_script/assets/22083075/a553a98f-bcc2-4e9a-a3ca-a79f402b2b7d) Thumbnail from the portrait file, opening the landscape file: ![Screenshot_20230715_121755](https://github.com/marzzzello/mpv_thumbnail_script/assets/22083075/4ea6233a-adcc-4432-8f11-26f342f0e3e0)

The "glitched" effect looks like the thumbnails are generated for the landscape video, but then to represent them the rows are wrapped around to match the portrait video width. This is indeed what happens with my test file if the thumbnails are generated before the video is rotated, then they are shown as alternating white/grey rows.

NicolaSmaniotto commented 1 year ago

In any case, even if I'd like to investigate this further, it solves the issue sometimes and it's still a good enough reason to merge.

NicolaSmaniotto commented 1 year ago

I was wrong, the test video I made created thumbnails that were too regular and hid the glitches. Here is another, the problem is still present:

New test file https://github.com/marzzzello/mpv_thumbnail_script/assets/22083075/d2f517cb-702b-4474-a6db-b200d7e35e66 Generated thumbnail: ![image](https://github.com/marzzzello/mpv_thumbnail_script/assets/22083075/655a6398-c44a-448b-9037-830b10383da4)