Skip to content

Improve vertical footage workflow#53

Open
philmodin wants to merge 1 commit into
gyroflow:mainfrom
philmodin:main
Open

Improve vertical footage workflow#53
philmodin wants to merge 1 commit into
gyroflow:mainfrom
philmodin:main

Conversation

@philmodin
Copy link
Copy Markdown

@philmodin philmodin commented Apr 30, 2026

Summary

  • Auto-detects when the NLE has pre-rotated vertical footage by comparing host output dimensions against raw video dimensions
  • Sets frame_rotation on gyroflow-core so set_output_size() uses portrait reference dimensions (no cropping/scaling)
  • Eliminates the need to manually clear clip rotation attributes before applying Gyroflow stabilization

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_rotation in 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_rotation which conflated gyro alignment with dimension swapping.

Solution

New nle_handles_rotation() detection helper checks:

  • Host provides portrait dimensions (height > width)
  • Raw video file is landscape (width > height)
  • Video metadata rotation is 90° or 270°

When all three are true, the plugin sets frame_rotation = video_rotation on the core. This causes set_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

  • InputRotation is always set (shader needs it for landscape→portrait UV mapping)
  • org_ratio uses frame_rotation to decide landscape vs portrait aspect ratio
  • frame_rotation is set unconditionally before init_size()/set_output_size(), reading from the OFX Rotation param (which the host always restores on project load)

Media

Before After
before after
Drag and Drop Drag and Drop

Files changed

File Change
common/src/lib.rs Added nle_handles_rotation(), frame_rotation catch-all before init, InputRotation always set
openfx/src/gyroflow.rs org_ratio uses portrait ratio when frame_rotation is 90°/270°, always pass input_rotation to shader

Companion PR

Requires gyroflow-core changes: philmodin/gyroflow#1

Test plan

  • Horizontal footage unchanged (frame_rotation stays 0, existing behavior)
  • Vertical footage in Resolve Edit page: correct stabilization without clearing clip attributes
  • Saved projects load correctly without manual reload
  • Fresh plugin application to vertical footage works immediately
  • Rolling shutter correction on vertical footage
  • Fusion page workflow (manual output size control) still works

Created with assistance from Claude Code.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 6, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants