-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix rotated videos #41
base: master
Are you sure you want to change the base?
Conversation
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 #4 (comment). |
Weird, can you try it in thumbfast with a compatible UI? We do the same thing there and it seems to work. |
This comment was marked as outdated.
This comment was marked as outdated.
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. |
local rotate = mp.get_property_number("video-params/rotate") | ||
if rotate ~= nil and rotate % 180 == 90 then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local rotate = mp.get_property_number("video-params/rotate") | |
if rotate ~= nil and rotate % 180 == 90 then | |
local rotate = mp.get_property_number("video-params/rotate", 0) | |
if rotate % 180 == 90 then |
It's cleaner to have a default and avoid checking for nil
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is indeed what happens with my test file if the thumbnails are generated before the video is rotated
Some insight from thumbfast, if we're missing rotate info on the first run, we queue another check in 0.05s (in effect the next even loop).
This is obviously hacky, it's a leftover of when thumbfast queried properties when needed instead of watching for changes and caching the value.
I need to rewrite this to call info()
within watch_changes()
when video-params/rotate
changes, that way it's no longer racy. Though this logic may not be needed at all anymore as we delay announcing until video-out-params
is available.
We should do a similar thing in mpv_thumbnail_script, return nil
in get_thumbnail_size()
until video-params/rotate
is available (is it guaranteed to eventually exist?). There is already a check for video-dec-params/dw
, video-dec-params/dh
. The issue may go away if we make the check more robust.
Closes #4