kinetograph.

Write your first video in code

Write a two-second title card as a TSX project or an HTML page, look at its frames, and render it to an MP4.

Run npx kinetograph init and npm install in an empty folder, then npx kinetograph render. You get out/renders/Main.mp4, a two-second title card. Install Kinetograph first with npm install kinetograph, or build from source. Check your setup shows what it needs. For the shortest route, with your agent, see Make your first video.

You can write the video as a Remotion-style TSX project or as an HTML page in the HyperFrames style. Pick a tab where the two differ.

Make the project

npx kinetograph init
npm install

init writes a starter title card. The scene is in src/scenes/Title.tsx:

src/scenes/Title.tsx
import { AbsoluteFill, Rect, Text, interpolate, useCurrentFrame } from '@kinetographdev/core';
import { loadFont } from '@remotion/google-fonts/Inter';

const { fontFamily } = loadFont('normal', { weights: ['400'] });

export const Title = () => {
  const frame = useCurrentFrame();
  const width = interpolate(frame, [0, 30], [0, 640], { extrapolateRight: 'clamp' });
  return (
    <AbsoluteFill style={{ backgroundColor: '#14171f' }}>
      <Text x={320} y={200} font={fontFamily} size={96} color="#ffffff">
        Hello, Kinetograph
      </Text>
      <Rect x={320} y={340} width={width} height={12} radius={6} fill="#f6c177" />
    </AbsoluteFill>
  );
};

src/index.tsx registers it:

src/index.tsx
import { Composition, registerRoot } from '@kinetographdev/core';
import { Title } from './scenes/Title';

registerRoot(() => (
  <Composition id="Main" component={Title} durationInFrames={60} fps={30} width={1280} height={720} />
));

Import the API from @kinetographdev/core, not from kinetograph, which is the CLI. You do not need Remotion.

A composition is one video: Composition sets its id, length in frames, frame rate and size. useCurrentFrame gives the frame being drawn, and the picture depends only on that number. Here the bar grows from 0 to 640 over 30 frames, then holds.

Look at it, then render it

npx kinetograph strip src/index.tsx
npx kinetograph render src/index.tsx

strip writes twelve labelled frames on one sheet to out/sheets/Main-strip.png. render writes out/renders/Main.mp4, 1280 by 720, H.264. Add --draft for a half-size look first. Rendering covers still, lint, doctor and the export options.

To edit with a preview, a timeline and a chat with your coding agent, run npx kinetograph studio src/index.tsx (or html/index.html). See Studio.

Next steps

On this page