fix(render): account for rotation metadata in portrait detection - #137
Open
sidorovanthon wants to merge 2 commits into
Open
fix(render): account for rotation metadata in portrait detection#137sidorovanthon wants to merge 2 commits into
sidorovanthon wants to merge 2 commits into
Conversation
Read display-matrix rotation and legacy rotate tags alongside coded dimensions. Swap dimensions for quarter-turn rotations so ffmpeg's autorotated filter input uses the correct scale axis.
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Ignore plain rotate tags that do not guarantee ffmpeg autorotation and assert that the ffprobe query continues to request display-matrix rotation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Portrait detection currently compares coded width and height only. Phone and camera files commonly store landscape-coded frames plus 90 or 270 degree display rotation. ffmpeg autorotates those frames before filters run, but render.py still selects the landscape scale axis, producing an oversized vertical output.
This edge case was identified by cubic during review of #29.
Fix
Verification
Summary by cubic
Fixes portrait detection to honor display-matrix rotation side data so vertical sources scale on the correct axis. Previously we compared coded dimensions only, treating 90/270° rotated videos as landscape.
ffprobeJSON probe to read width/height andstream_side_data=rotation; ignores plainrotatetags because they do not guarantee autorotation.rotate, reverse orientation, and error handling.Written for commit 4ff8e60. Summary will update on new commits.