Skip to main content

MoviePy-style Python bindings for the Cutlass video engine.

Project description

cutlass (Python)

MoviePy-style Python bindings for the Cutlass video engine. Build a project with explicit tracks, place clips, animate properties, and export, all through a track-first object model over the pure-Rust timeline, GPU compositor, and platform-native exporter.

See api-design.md for the full v2 API reference.

Install

pip install --pre cutlass-py   # imports as `cutlass`

Wheels ship for macOS (Apple Silicon) and Windows (x64), Python 3.9+. The distribution is named cutlass-py (the bare cutlass name on PyPI belongs to an unrelated project); the module you import is cutlass. --pre is needed while releases carry a pre-release version (e.g. 0.5.3a0).

Install (from source)

Requires the Rust toolchain and maturin.

cd crates/cutlass-py
python3 -m venv .venv && source .venv/bin/activate
pip install maturin numpy
maturin develop --release      # builds + installs `cutlass` into the venv

Quick start

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")

print(p)                      # Project(size=(1920, 1080), fps=30.000, duration=2.000s)
frame = p.get_frame(0.5)      # numpy uint8 array, shape (height, width, 4), RGBA
p.export("out.mp4")           # H.264/mp4 (+ AAC when audio clips exist)
p.save("demo.cutlass")

Object model

Project
├── media pool          p.import_media(path) -> Media
├── tracks              p.add_track(kind) -> Track
│   └── clips           track.add(content, start=...) -> Clip
│       ├── transform / crop / speed / volume
│       ├── effects     clip.add_effect(id) -> Effect
│       └── transition  clip.transition(id, duration=...)
└── render              p.get_frame(t), p.export(path)

Tracks are explicit. Create a track, then add clips to it. Content descriptors (Text, Solid, shapes, media.subclip(...)) describe what; track.add decides where and when.

Animation: set constants with properties (clip.opacity = 0.5) or keyframes with clip.animate(opacity=1.0, at=0.4) / batch curves clip.animate(opacity=[(0.0, 0.0), (0.4, 1.0)]).

Media import

import_media accepts probed video, audio, and still images (PNG, JPEG, and other formats the decoder recognizes). Stills register with kind == "image", a default duration of 5 seconds, and no audio. Place them on video tracks; the placement duration can exceed the pool default (the same frame holds).

clip = p.import_media("footage.mp4")
still = p.import_media("photo.png")
main = p.add_track("video")
main.add(clip.subclip(3.0, 8.0), start=0.0)
main.add(clip[3:8], start=0.0)   # slicing sugar
main.add(still, start=0.0, duration=10.0)  # hold the still for 10s

Track kinds

video, audio, text, sticker, effect, filter, adjustment. The kind must match the clip content (TrackKindError on mismatch): media goes on video/audio, Text on text, Solid, shapes, and Sticker on sticker. Sticker("heart") places a bundled sticker (static or animated); browse ids with cutlass.stickers().

Errors

Exception When
OverlapError Clips overlap on the same track
TrackKindError Wrong track kind for content
MediaError Import/probe failure
RenderError GPU frame or export failure

Development

maturin develop                     # debug build into the active venv
pip install pytest
python -m pytest tests/ -q          # full API suite (bootstraps its own mp4 via export)
python tests/smoke.py               # quick GPU frame smoke test
python examples/tour.py             # optional; needs sample media paths

Rust-side unit tests cover the pure conversion helpers. The test binary links libpython, so on macOS point dyld at the Python framework:

DYLD_FRAMEWORK_PATH="$(python3 -c 'import sys; print(sys.base_prefix.rsplit("/Python3.framework", 1)[0])')" \
    cargo test --no-default-features

Export: uses the platform-native encoder: Apple (VideoToolbox) and Windows (Media Foundation), both H.264 + AAC → mp4. Other platforms raise until their backends land.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cutlass_py-0.5.3a1.tar.gz (762.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

cutlass_py-0.5.3a1-cp314-cp314-win_amd64.whl (5.8 MB view details)

Uploaded CPython 3.14Windows x86-64

cutlass_py-0.5.3a1-cp314-cp314-macosx_11_0_arm64.whl (5.1 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

cutlass_py-0.5.3a1-cp313-cp313-win_amd64.whl (5.8 MB view details)

Uploaded CPython 3.13Windows x86-64

cutlass_py-0.5.3a1-cp313-cp313-macosx_11_0_arm64.whl (5.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

cutlass_py-0.5.3a1-cp312-cp312-win_amd64.whl (5.8 MB view details)

Uploaded CPython 3.12Windows x86-64

cutlass_py-0.5.3a1-cp312-cp312-macosx_11_0_arm64.whl (5.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

cutlass_py-0.5.3a1-cp311-cp311-win_amd64.whl (5.8 MB view details)

Uploaded CPython 3.11Windows x86-64

cutlass_py-0.5.3a1-cp311-cp311-macosx_11_0_arm64.whl (5.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

cutlass_py-0.5.3a1-cp310-cp310-win_amd64.whl (5.8 MB view details)

Uploaded CPython 3.10Windows x86-64

cutlass_py-0.5.3a1-cp310-cp310-macosx_11_0_arm64.whl (5.1 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

cutlass_py-0.5.3a1-cp39-cp39-win_amd64.whl (5.8 MB view details)

Uploaded CPython 3.9Windows x86-64

cutlass_py-0.5.3a1-cp39-cp39-macosx_11_0_arm64.whl (5.1 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file cutlass_py-0.5.3a1.tar.gz.

File metadata

  • Download URL: cutlass_py-0.5.3a1.tar.gz
  • Upload date:
  • Size: 762.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cutlass_py-0.5.3a1.tar.gz
Algorithm Hash digest
SHA256 ef7b9034c820a5eed26653b32dfa79656cc8f3bc1b450b538a4e4db48c46bce5
MD5 4e0ae19dff07a4307626c85dde3b4c28
BLAKE2b-256 f8e88a101a7a0ffd6894f63c89f51d9e37d2800a8667839aefde0d04cdabcd60

See more details on using hashes here.

Provenance

The following attestation bundles were made for cutlass_py-0.5.3a1.tar.gz:

Publisher: pywheels.yml on 1mrnewton/cutlass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cutlass_py-0.5.3a1-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for cutlass_py-0.5.3a1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 29588111d91c9839941934fe0eb1171528531f3cfb3eea0007ba26644bf25dd2
MD5 7387bb22596930d2f91f7a44ffbac4f7
BLAKE2b-256 c5f27ba10abbcd92ef047a549d5110c228e164f0d58d08b20a33fdd5bbadd3d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for cutlass_py-0.5.3a1-cp314-cp314-win_amd64.whl:

Publisher: pywheels.yml on 1mrnewton/cutlass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cutlass_py-0.5.3a1-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cutlass_py-0.5.3a1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 82f481830b9813ce9e04aa88ad08f68ad2c614fc827108d6d4da1feb05d0ef3d
MD5 b28b38be52a51ce764a28bd1ac126532
BLAKE2b-256 1990bdf42500eabe9cc0d9112cd9c37f2dfb18fc3afa26be3826bf384c824f83

See more details on using hashes here.

Provenance

The following attestation bundles were made for cutlass_py-0.5.3a1-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: pywheels.yml on 1mrnewton/cutlass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cutlass_py-0.5.3a1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for cutlass_py-0.5.3a1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 dfce08076c14f7e4bef086aeff6491fe6f65dbf9b8636cb39048279f3cded06b
MD5 fc490daa268754c2cae9781a78494ead
BLAKE2b-256 fa76a6ef5bfc83451e1a355eab9dc898b2caa11f98bbc1317ad9f87c5d995f25

See more details on using hashes here.

Provenance

The following attestation bundles were made for cutlass_py-0.5.3a1-cp313-cp313-win_amd64.whl:

Publisher: pywheels.yml on 1mrnewton/cutlass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cutlass_py-0.5.3a1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cutlass_py-0.5.3a1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 037f3b78c987b43a7502c891a89a4b04fbab36ec90ecda9dc03ffca0b6d4083d
MD5 47ca028ab9eb92f50ff93ff9c3af36f3
BLAKE2b-256 cc42026a60af0b4d3035a32eb4a090709b56f58a9150c35a2ad5c0ff1373cb9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cutlass_py-0.5.3a1-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: pywheels.yml on 1mrnewton/cutlass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cutlass_py-0.5.3a1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for cutlass_py-0.5.3a1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6b304c5ef6246966d918c0bd2181d4756100f3c7fc527a10229c12ca71ae16b2
MD5 9e6bd91d2da87ebf945f761fe58ef4a8
BLAKE2b-256 cfbf4228eda01e899a3a0add516edefa26d3863dd27aa6c87a65b64e5e52da57

See more details on using hashes here.

Provenance

The following attestation bundles were made for cutlass_py-0.5.3a1-cp312-cp312-win_amd64.whl:

Publisher: pywheels.yml on 1mrnewton/cutlass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cutlass_py-0.5.3a1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cutlass_py-0.5.3a1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 11166dc1d0cde2924f13b2734f735386be5e55d9c1bfad80f974678c70a806ee
MD5 af5c0d3cf0413ccb6865d541e275ebbb
BLAKE2b-256 b5fa24bea57bf0120c90818a2c57cf8709817a10c972a27e1e53689f17aaa886

See more details on using hashes here.

Provenance

The following attestation bundles were made for cutlass_py-0.5.3a1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: pywheels.yml on 1mrnewton/cutlass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cutlass_py-0.5.3a1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for cutlass_py-0.5.3a1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 194a327a84da81d2cc6ba6e5aa8edb32123d2a43b9683d94f64f7acdfd2edf7a
MD5 6ce6713d7b70b66483a0f0f299e3fa5e
BLAKE2b-256 89588a7e5edb71e7f22956851dd08db26eb30338ad4717e5ca59c8743940b567

See more details on using hashes here.

Provenance

The following attestation bundles were made for cutlass_py-0.5.3a1-cp311-cp311-win_amd64.whl:

Publisher: pywheels.yml on 1mrnewton/cutlass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cutlass_py-0.5.3a1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cutlass_py-0.5.3a1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1cb48308fae6bdf69e50875909932c1d8ff5ec13914e64293e242d23bbc61de1
MD5 6197c42ca2d4b0927b86a60abc8240e8
BLAKE2b-256 3af8d64882b96d64b3e61765785db7c8ebdc50c8c8bcc96d7b09d2a7976c87ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for cutlass_py-0.5.3a1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: pywheels.yml on 1mrnewton/cutlass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cutlass_py-0.5.3a1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for cutlass_py-0.5.3a1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d9f2098ad6164c2d5050c0a2498450ea31e714f18acdc0d89635dbb2394577e7
MD5 849a2866825ee31770ee5e0aaefaf2f0
BLAKE2b-256 95eae5a8f2d8ebcac6880fdde89bb06c5662aba04a1ddd80abb8fa377967d490

See more details on using hashes here.

Provenance

The following attestation bundles were made for cutlass_py-0.5.3a1-cp310-cp310-win_amd64.whl:

Publisher: pywheels.yml on 1mrnewton/cutlass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cutlass_py-0.5.3a1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cutlass_py-0.5.3a1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0df1e1add0e23bd0720299c51fef59a6360511879725e4fb821662e6e2eb856a
MD5 eb36f6e3ee6e9f4fea8bf29a95e5cf13
BLAKE2b-256 14c7026e00ca959e8cfd1fd90da49519845abb2def16c443cf9213c6998a9ecb

See more details on using hashes here.

Provenance

The following attestation bundles were made for cutlass_py-0.5.3a1-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: pywheels.yml on 1mrnewton/cutlass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cutlass_py-0.5.3a1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: cutlass_py-0.5.3a1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 5.8 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cutlass_py-0.5.3a1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 39ab7513e4431d363d0bddd2f870a4241112a38f936aa6c7a1e81871399f2b1b
MD5 01285a3b1844e8ba82305b2848b2a663
BLAKE2b-256 c63c9df1a447aaa7ad20b21a37f1c2b1ab1520633c0f207b58670bea7d799abd

See more details on using hashes here.

Provenance

The following attestation bundles were made for cutlass_py-0.5.3a1-cp39-cp39-win_amd64.whl:

Publisher: pywheels.yml on 1mrnewton/cutlass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cutlass_py-0.5.3a1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cutlass_py-0.5.3a1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dc5ffa7e005c67be6257aa8933380ab72413f70a9423d3e7b66372f3e2439b84
MD5 ca953a50271f5dae2c25a16690472084
BLAKE2b-256 a65e5b25278d9e642e86299fc4a4de26cd3ab90182e7cf9e5774f78fef72d3d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for cutlass_py-0.5.3a1-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: pywheels.yml on 1mrnewton/cutlass

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page