Skip to content

feat: Lut colour grade on Clip and Timeline - #108

Closed
ankit-v2-3 wants to merge 2 commits into
mainfrom
ankit/editor-lut
Closed

ankit-v2-3 wants to merge 2 commits into
mainfrom
ankit/editor-lut

Conversation

@ankit-v2-3

Copy link
Copy Markdown
Collaborator

Summary

Adds 3D .cube LUT colour grading to the editor, matching the server-side contract in Spext/streaming_service#75 and Spext/videodb-server#1052.

  • Lut(src, intensity=1.0): src is the URL of a .cube file; intensity blends from untouched (0) to fully graded (1).
  • Lut.from_file(connection, path, intensity) uploads a local .cube through the collection upload URL (the same upload_bytes path large timelines use) and returns a Lut pointing at it. The server rewrites that upload URL to a readable one before compile.
  • Clip(lut=...) grades one clip, applied before its filter. Not valid on audio or caption clips (the server rejects it).
  • Timeline.lut grades the whole composited frame, under any captions.
  • Both are emitted only when set, like filter, so existing timelines serialize exactly as before. Older servers ignore the field silently, so deploy the service first.
timeline = Timeline(conn)
timeline.lut = Lut.from_file(conn, "teal-orange.cube", intensity=0.8)
track.add_clip(0, Clip(asset=VideoAsset(id=video.id), duration=10, lut=Lut(src=url), filter=Filter.contrast))

Test plan

  • pytest — 11 passed (6 new in tests/test_editor_lut.py: serialization, intensity bounds, emit-only-when-set on Clip and Timeline, from_file upload call and error wrapping)
  • Against a dev deployment of the two server PRs: generate_stream() on a timeline with a clip LUT and a timeline LUT, confirm the graded stream plays

🤖 Generated with Claude Code

ankit-v2-3 and others added 2 commits November 10, 2026 18:36
Adds Lut(src, intensity) for 3D .cube lookup tables. Clip(lut=...) grades
one clip before its filter; Timeline.lut grades the whole composited
frame under captions. Lut.from_file uploads a local .cube through the
collection upload URL, the same path large timelines use. The field is
emitted only when set, so existing timelines serialize unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Adds Motion(enter, exit, keyframes) with MotionPreset (fade, slides,
pop, wipes; duration, amount, easing) and Keyframe (time, value, easing)
on offset.x/y, scale, rotation and opacity, plus the Effect enum for the
server's named effect set. Clip(motion=...) is emitted only when set, so
existing timelines serialize unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@ankit-v2-3

Copy link
Copy Markdown
Collaborator Author

Superseded by #110: the branch was renamed to ankit/editor-lut-motion and now carries both the LUT and motion changes. GitHub closed this PR on the rename (head ref deleted) and it cannot be reopened.

@ankit-v2-3 ankit-v2-3 mentioned this pull request Nov 11, 2026
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.

1 participant