Cutlass
DocsDownloadsGitHub ↗
07Documentation

CUTLASS.PY DOCS

Cutlass.py quickstart

Create a project, add generated clips, render a frame, export MP4, and save a .cutlass file.

First script

Create a project, add tracks, place generated content, and animate a title:

import cutlass
from cutlass import Project, Text, Solid

p = Project("demo", fps=30, canvas="16:9", background=(20, 20, 30))

bg = p.add_track("sticker", name="Background")
overlay = p.add_track("text", name="Titles")

bg.add(Solid((38, 42, 64, 255)), start=0.0, duration=2.0)
title = overlay.add(
    Text("Cutlass", size=220, color="#f0f0ff"),
    start=0.0,
    duration=2.0,
)
title.animate(opacity=[(0.0, 0.0), (0.5, 1.0)], easing="ease_out")

Render a frame

get_frame composites the timeline at a time in seconds and returns a NumPy array:

frame = p.get_frame(0.5)
print(frame.dtype, frame.shape)

The frame is uint8 RGBA with shape (height, width, 4).

Export and save

Export an MP4 and save the project document:

frames = p.export("out.mp4")
p.save("demo.cutlass")
print(frames)

The saved .cutlass project can be loaded again with:

loaded = Project.load("demo.cutlass")

Next steps

  • Import real video or audio with p.import_media(path).
  • Put media on video or audio tracks.
  • Use clip.split, clip.trim, clip.move, and clip.ripple_delete.
  • Add effects and transitions from the engine catalogs.