-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Inconsistent dwidth,dheight with EXIF orientation and video-rotate=n #15476
Comments
Try with EDIT: Also I think 0 rotation on |
no difference with gpu-next |
In this case it is expected behavior, target video out is not rotated. Video was rotated during rendering. |
I would like to point out that metadata-based rotation and 'manual' rotation are inherently coupled because of how the
If I wanted to work-around the issue by reading the exif metadata and performing the arithmetic myself, I can't — there's no way to "ignore exif rotation, and rotate This is why I believe it's important for the |
The final image dimensions are in |
|
You can set rotate value to negate any metadata rotation and arrive at your expected rotation. You can also override rotation metadata with |
That only works in cases where I want a different angle than what is specified in metadata.
I will check this out, thanks. |
You can calculate it yourself by adding metadata and custom rotation.
It's not a separate step, unscaled rotated image doesn't exist and therefore there is no poperies like that. You can easily calculate it yourself. |
are you implying that there's nothing wrong with the current behaviour? |
I'm not implying. I'm saying it is correct. unrotated video with rotation metadata:
rotated video. width/height has been transformed according to rotate value, rotate value is now 0, because it was already applied to the video:
rotate metadata is saying how video should be displayed, not how it was rotated. Imagine you do rotation in filter, the value of rotate has to be updated so it is not applied again by next step in pipeline. |
I strongly disagree, I think I've made a compelling case as to why the current behaviour isn't appropriate. |
VO like gpu/gpu-next does support rotation only in 90 degrees steps. If rotation value is not a multiple of 90, the rotation filter will be inserted instead. That's why you see already rotated parameters in The difference is where the rotation is applied, In other words, if you want to see video params before and after rotate you can compare
I see where you coming from, but all information is there, on each step of processing. Could you reiterate what information do you need, we can think how to obtain it correctly for your use-case. |
It seems I had the wrong impression: the issue has nothing to do with exif vs. 90° rotation being treated as a special case is somewhat understandable, |
Edit: this initial report was written under the assumption that the 'source' of rotation was changing the way the dwidth/dheight values were calculated. However that turned out to be wrong — the real reason is whether the rotation angle is a multiple of 90.
mpv Information
Other Information
The issue is essentially that
video-out-params/dw|dh|rotate
is calculated differently depending on whether--video-rotate=n
is used, when the file also includes EXIF rotation.There doesn't seem to be a way to reliably read the post-rotation unscaled video dimensions, irrespective of whether rotation originates from metadata,
video-rotate
or both.Reproduction Steps
Landscape_8.jpg
):video-*-params
values:video-rotate
option:video-*-params
values:Expected Behavior
At least one set of params should provide the total rotation amount and unscaled video dimensions (accounting for rotation).
Actual Behavior
with
--video-rotate=0
:The rotation values are consistent but none of the width values take rotation into account.
with
--video-rotate=1
:In
video-out-params
the width does account for rotation, however therotate
value is lost for some reason.Log File
output.txt
Sample Files
I carefully read all instruction and confirm that I did the following:
--log-file=output.txt
.The text was updated successfully, but these errors were encountered: