Skip to content

Introduction ​

The idea of CutCraft is that a video is a file: a TSX file of elements on a timeline. The file is the project, the edit and the code at once. The player plays it, an editor changes it, the export renders it, and you, your agent and your code all work on the same text.

tsx
import { Captions, Clip, Composition, LowerThird, Track } from "@cutcraft/kit";

export default function Video() {
  return (
    <Composition fps={30} width={1920} height={1080}>
      <Track id="main">
        <Clip id="talk" src="asset:talk" in={2} out={12} />
      </Track>
      <Track id="over" layout="free">
        <LowerThird id="name" start={0.5} duration={4} name="Maya Chen" role="Founder, Shed" />
      </Track>
      <Captions id="captions" src="asset:talk" animation="karaoke" />
    </Composition>
  );
}

Ten seconds of an interview with a name card and captions. Every element has a literal id, which is how an editor finds it: drag the end of talk on a timeline, and CutCraft changes one value in the file, out={12} to out={11}, and nothing else. There is no project file beside it, so whoever opens the file next, you or a model, reads the edit as code. Where the elements stop, a <Layer> holds any React, CSS, canvas or WebGL, on the video's clock.

What you get ​

To write a video with:

  • Elements for footage, sound, tracks, transitions, titles, shapes, SVG, masks, keyframes, speed ramps, freeze frames and multicam.
  • Captions from a transcript that follow the clips through every trim, word by word or as karaoke, and narration timed from a script.
  • Effects and transitions, from exposure, curves and LUTs to keying, glow and film burn, run as shaders in the preview and the export. Or write your own in GLSL.
  • Components such as lower thirds, callouts, counters and quote cards, and parts for drawing diagrams in a layer.
  • Themes and fonts: a palette, type and motion style set once in the file.
  • Free code: any React in a <Layer>, and three.js and Motion on the timeline.

To play, check and export it:

  • A React <Player> that plays the file in your app, and editor actions (trim, move, retime, restyle) that are undoable and written back to the file.
  • A command line that exports MP4, WebM, audio, stills and subtitles, and checks a cut without watching it: the timeline as text, sheets of frames, and the layout against a platform's safe zone.
  • The CutCraft skill, which teaches a coding agent all of the above.

How it fits together ​

video.tsx      ┐                                       ┌─▶ <Player>   plays it in a page
cutcraft.json  ├─▶ resolve ─▶ every element in seconds ├─▶ actions    edit it; each edit is written back to video.tsx
media files    ┘                                       └─▶ export     MP4, WebM, a still or subtitles

Resolving reads the file and the manifest and gives every element its start and end in seconds. The player, the editor and the export all work from that one result, so the preview and the export agree.

In practice:

  1. npx cutcraft add talk.mp4 lists the media in cutcraft.json, the manifest.
  2. You write video.tsx, or your agent does with the CutCraft skill.
  3. npx cutcraft look video.tsx draws a sheet of its frames, and cutcraft inspect prints the timeline as text, so a cut can be checked without watching it.
  4. The <Player> plays it in your app, and an editor around it changes the file by hand.
  5. npx cutcraft video.tsx --out video.mp4 exports it, through the same player in headless Chrome.

It comes as five npm packages, free under the MIT licence:

PackageWhat it does
cutcraftThe command line: export, check and look at a file, and add media to its manifest.
@cutcraft/kitThe elements, the resolver that places everything in time, the editor actions, and the tools that write edits back into the file.
@cutcraft/playerA React <Player> and a framework-free PlayerCore for the browser.
@cutcraft/renderThe export from your own code: from Node, through the player in headless Chrome.
@cutcraft/graphicsthree.js and Motion on the video's clock, for <Three> and <Motion>.

Next ​

MIT licensed.