Improve vertical footage workflow#53
Open
philmodin wants to merge 1 commit into
Open
Conversation
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.
Summary
frame_rotationon gyroflow-core soset_output_size()uses portrait reference dimensions (no cropping/scaling)Problem
Vertical footage in DaVinci Resolve requires a cumbersome workaround: users must clear the clip's rotation attribute (undoing the NLE's pre-rotation), then configure
video_rotationin Gyroflow to compensate. This is cumbersome, unintuitive, and is not ideal having sideways preview thumbnails in the timeline.The root cause: the plugin had no way to tell gyroflow-core "the host already rotated this frame" — it could only set
video_rotationwhich conflated gyro alignment with dimension swapping.Solution
New
nle_handles_rotation()detection helper checks:When all three are true, the plugin sets
frame_rotation = video_rotationon the core. This causesset_output_size()to use portrait reference dimensions, so the output matches the host's portrait buffer (scale=1.0).The transform pipeline stays in landscape sensor coordinates. The shader's
input_rotation(always set to 270°) handles the UV rotation from landscape source coords to portrait buffer layout — this is a trivial per-pixel coordinate transform with negligible GPU cost.Key design decisions
InputRotationis always set (shader needs it for landscape→portrait UV mapping)org_ratiousesframe_rotationto decide landscape vs portrait aspect ratioframe_rotationis set unconditionally beforeinit_size()/set_output_size(), reading from the OFXRotationparam (which the host always restores on project load)Media
Files changed
common/src/lib.rsnle_handles_rotation(), frame_rotation catch-all before init, InputRotation always setopenfx/src/gyroflow.rsorg_ratiouses portrait ratio when frame_rotation is 90°/270°, always passinput_rotationto shaderCompanion PR
Requires gyroflow-core changes: philmodin/gyroflow#1
Test plan
Created with assistance from Claude Code.