### Doctor output example Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/getting-started/installation.mdx Example output from kinetograph doctor showing the addon loaded. ```text node v22.x.x on darwin-arm64 addon: loaded, version 0.1.0 kinetograph doctor reports what a project holds that the engine cannot draw ``` -------------------------------- ### List and install skills from repository with skills CLI Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/guides/agents.mdx Shows what the skills CLI finds in the repository without installing, then installs both skills. The --list flag displays the found skills and installs nothing. ```bash npx skills add 0xS4N4TG/kinetograph --list # show what it found, install nothing npx skills add 0xS4N4TG/kinetograph # install ``` -------------------------------- ### Install and build commands Source: https://github.com/0xs4n4tg/kinetograph/blob/main/README.md Install dependencies and build the TypeScript packages and debug addon. Then build the release addon for timing. ```sh npm ci npm run build # TS packages and a debug addon npm run build:release -w @kinetographdev/native # the addon for timing ``` -------------------------------- ### Set PATH for rustup Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/getting-started/installation.mdx If Homebrew's rustc is first on PATH and does not start, put rustup first. ```sh export PATH="$HOME/.cargo/bin:/opt/homebrew/opt/rustup/bin:$PATH" ``` -------------------------------- ### Install skills from GitHub repo with skills CLI Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/guides/agents.mdx Installs both kinetograph and kinetograph-migrate skills from the GitHub repository. The CLI asks which agents to install them for. ```sh npx skills add 0xS4N4TG/kinetograph ``` -------------------------------- ### Start local studio Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/SKILL.md Starts the local studio at http://127.0.0.1:3000 and opens a browser. Runs until stopped. ```bash kinetograph studio ``` -------------------------------- ### Kinetograph CLI usage examples Source: https://github.com/0xs4n4tg/kinetograph/blob/main/README.md Generate a still, a strip, a render, and inspect a frame from an example project. Each command supports --json. ```sh npx kinetograph still examples/rajz-cards/index.tsx 60 -o out/rajz-60.png npx kinetograph strip examples/rajz-cards/index.tsx -n 12 -o out/rajz-strip.png npx kinetograph render examples/rajz-cards/index.tsx -o out/rajz-cards.mp4 npx kinetograph inspect examples/rajz-cards/index.tsx --frame 60 --json ``` -------------------------------- ### mcp Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Starts the MCP server on stdio. ```APIDOC ## mcp ### Description Starts the MCP server on stdio. ### Command `npx kinetograph mcp` ### Options - `--json` - Output one JSON object on stdout. ### Output MCP server communication over stdio. ``` -------------------------------- ### Start studio without opening browser Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/SKILL.md Use when you start the studio yourself. ```bash kinetograph studio --no-open ``` -------------------------------- ### Build from repository root Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/getting-started/installation.mdx Run npm ci to install workspace packages and npm run build to build TypeScript packages and a debug addon build. ```sh npm ci npm run build ``` -------------------------------- ### Doctor install capabilities Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/SKILL.md Reports what this install can do. ```bash kinetograph doctor ``` -------------------------------- ### Run MCP server on stdio Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/reference/cli.mdx Starts the MCP server on stdio. It exposes one tool for each command except `studio`. See the guide for use with agents. ```sh npx kinetograph mcp ``` -------------------------------- ### Play an audio file with Audio and Sequence Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/guides/audio.mdx Plays a sound file from the public folder using the Audio element inside a Sequence. The clip starts at the Sequence's start frame and lasts for the given duration. Use staticFile to reference files in public/. ```tsx import { Audio, Sequence, staticFile } from 'remotion'; ``` -------------------------------- ### Check install with doctor Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/getting-started/installation.mdx Run npx kinetograph doctor to check the install. With no entry, it prints the Node version, platform, and whether the addon loaded. ```sh npx kinetograph doctor ``` -------------------------------- ### Audio onFrame example Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/SKILL.md Runs Web Audio code offline against the frame timeline. Call onFrame at module level; ctx is an OfflineAudioContext, t is the start time in seconds. ```ts import { onFrame } from '@kinetographdev/audio'; onFrame(42, (ctx, t) => { const o = ctx.createOscillator(); const g = ctx.createGain(); o.frequency.setValueAtTime(3000, t); o.frequency.exponentialRampToValueAtTime(4500, t + 0.055); g.gain.setValueAtTime(0.4, t); g.gain.exponentialRampToValueAtTime(0.001, t + 0.06); o.connect(g).connect(ctx.destination); o.start(t); o.stop(t + 0.06); }); ``` -------------------------------- ### Renderer.beginVideo Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Starts a video writer for frame-by-frame rendering, useful when the scene changes every frame. Returns a VideoWriter instance. ```APIDOC ## Renderer.beginVideo ### Description Starts a video writer for frame-by-frame rendering, useful when the scene changes every frame. Returns a VideoWriter instance. ### Method beginVideo ### Signature `beginVideo(output: string, options: VideoOptions): VideoWriter` ### Parameters - **output** (string) - Required - Output file path (extension determines container). - **options.width** (number) - Required - Video width. - **options.height** (number) - Required - Video height. - **options.fps** (number) - Required - Frames per second. - **options.encoder** (string) - Optional - ffmpeg H.264 encoder name. ### Returns - **VideoWriter** - A writer for pushing frames and finishing the video. ``` -------------------------------- ### Build from source with cargo Source: https://github.com/0xs4n4tg/kinetograph/blob/main/README.md Build the Rust CLI in release mode and render an example JSON file. Requires rustup toolchain (stable, edition 2024) and a wgpu-supported GPU; render links FFmpeg, so development libraries are needed. ```sh cargo build --release ./target/release/kinetograph render examples/papercut-card.json -o out/card.mp4 ``` -------------------------------- ### GET /api/project Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Retrieves project information from the studio server. Returns a ProjectInfo object. ```APIDOC ## [GET] /api/project ### Description Retrieves project information from the studio server. Returns a ProjectInfo object. ### Method GET ### Endpoint /api/project ### Response #### Success Response (200) - **ProjectInfo** - Project information object #### Response Example { "type": "ProjectInfo" } ``` -------------------------------- ### studio: open the studio in a browser Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/reference/cli.mdx Opens the studio in a browser: preview, timeline, scene tree, props, and render queue. Options include `--port` (default 3000, `0` picks free port), `--host` (default `127.0.0.1`), `--no-open`, and `--props` (merged over each composition's `defaultProps`). The studio is the `@kinetographdev/studio` package, loaded by name, so it must be installed next to `kinetograph`. Stop with Ctrl-C. ```sh npx kinetograph studio ``` -------------------------------- ### beginVideo(output, options) Source: https://github.com/0xs4n4tg/kinetograph/blob/main/crates/node/README.md Starts a video writer for projects whose scene changes every frame. Returns a VideoWriter that can be used to push frames and finish the video. ```APIDOC ## beginVideo(output, options) ### Description Starts a video writer for projects whose scene changes every frame. Returns a VideoWriter that can be used to push frames and finish the video. ### Method beginVideo ### Parameters - **output** (string) - Required - The output file path. - **options** (object) - Required - Video options. - **width** (number) - Required - Width of the video. - **height** (number) - Required - Height of the video. - **fps** (number) - Required - Frames per second. - **encoder** (string) - Optional - Encoder to use. ### Returns - **VideoWriter** - A writer for pushing frames and finishing the video. ``` -------------------------------- ### Build and test commands Source: https://github.com/0xs4n4tg/kinetograph/blob/main/crates/node/README.md Commands to install dependencies, build the debug addon, run CPU tests, run GPU tests on M4, and run Rust unit tests. Requires CARGO_TARGET_DIR if sharing a target directory. ```sh npm ci npm run build -w @kinetographdev/native # debug build; writes kinetograph..node, index.js, index.d.ts npm test -w @kinetographdev/native # node --test: the CPU tests; the GPU tests are skipped KINETOGRAPH_GPU_TESTS=1 npm test -w @kinetographdev/native # on the M4: opens a GPU cargo test --lib # Rust unit tests (CPU) ``` -------------------------------- ### Render with development React Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/SKILL.md Keeps the development build to get React's warnings. Default is production mode (faster). ```bash kinetograph render src/index.tsx --dev-react ``` -------------------------------- ### doctor [entry] Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Reports installation status or unsupported content in the entry. ```APIDOC ## doctor [entry] ### Description Reports installation status or unsupported content in the entry. ### Command `npx kinetograph doctor [entry] [--range]` ### Arguments - **entry** (string) - Optional - Path to a project file (.tsx, .ts, .jsx, .js) or a .json scene. ### Options - `--range` (string) - Frame range to check. - `--json` - Output one JSON object on stdout. - `--comp ` - Composition ID (default: first composition). - `--props ` - JSON string of props to pass to the composition. ### Output Without an entry, the install report. With one, how many frames have nothing unsupported, and every unsupported element or property with its frame ranges. ``` -------------------------------- ### Copy skills from npm package to Claude Code skills folder Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/guides/agents.mdx Copies the kinetograph and kinetograph-migrate skills from the installed npm package to the global Claude Code skills directory. Requires the package to be installed in the project. ```bash mkdir -p ~/.claude/skills cp -R node_modules/kinetograph/skills/kinetograph node_modules/kinetograph/skills/kinetograph-migrate ~/.claude/skills/ ``` -------------------------------- ### Run performance benchmark with cargo run --release Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/ENGINE.md Command to run the performance example for the kinetograph-dom crate. The island is slabs with a grain background-image, background-blend-mode, rotate, inset shadows, text pills in Inter 800, , and . The benchmark measures per-frame timings for JSON parse, build, build+resolve, and layout_boxes. ```bash cargo run --release -p kinetograph-dom --example perf [slabs…] ``` -------------------------------- ### Run handoff spike benchmark Source: https://github.com/0xs4n4tg/kinetograph/blob/main/crates/node/README.md Builds the native addon and runs the handoff spike with GPU tests enabled, timing 50 runs of frame 30 from the papercut-card example. Prints a JSON object with stringifyMs, validateSceneMs, and bench stages when KINETOGRAPH_GPU_TESTS=1; without it, only the CPU part runs and no GPU is opened. ```sh npm run build:release -w @kinetographdev/native KINETOGRAPH_GPU_TESTS=1 node crates/node/spike/handoff.mjs examples/papercut-card.json --frame 30 --runs 50 ``` -------------------------------- ### GET /api/compositions Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Retrieves the list of compositions available in the project. Returns an array of CompositionInfo objects. ```APIDOC ## [GET] /api/compositions ### Description Retrieves the list of compositions available in the project. Returns an array of CompositionInfo objects. ### Method GET ### Endpoint /api/compositions ### Response #### Success Response (200) - **CompositionInfo[]** - Array of composition information objects #### Response Example [ { "type": "CompositionInfo" } ] ``` -------------------------------- ### Analyze audio loudness with CLI Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/guides/audio.mdx Analyzes the loudness of a composition, printing integrated loudness in LUFS, true peak in dBTP, clipped samples, and silences. Use --scenes to measure specific frame ranges and --json for machine-readable output. ```sh npx kinetograph audio analyze examples/rajz-cards/index.tsx --scenes 0..60,60..125 ``` -------------------------------- ### onFrame Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Registers a synthesis callback to start at a specific absolute frame. The callback is invoked during audio rendering with the OfflineAudioContext and the time in seconds. ```APIDOC ## onFrame ### Description Registers a synthesis callback to start at a specific absolute frame. The callback is invoked during audio rendering with the OfflineAudioContext and the time in seconds. ### Method Function ### Signature `onFrame(frame: number, callback: OnFrameCallback): void` ### Parameters - **frame** (number) - Required - The absolute frame at which the callback should be triggered. - **callback** (OnFrameCallback) - Required - The callback function, receiving `(ctx: OfflineAudioContext, time: number)`. ### Notes - Must be called at module level; the registry is global (`globalThis[Symbol.for('kinetograph.audio')]`). ``` -------------------------------- ### Render a single frame to PNG with kinetograph still Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/INTERNALS.md Renders frame 30 of the example scene to a PNG. Add --json for machine-readable output. ```sh ./target/release/kinetograph still examples/papercut-card.json 30 -o out/card.png ``` -------------------------------- ### VideoWriter.pushFrame Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Renders a frame of the scene and queues it for encoding. Frames must be pushed in increasing order, starting at time 0. ```APIDOC ## VideoWriter.pushFrame ### Description Renders a frame of the scene and queues it for encoding. Frames must be pushed in increasing order, starting at time 0. ### Method pushFrame ### Signature `pushFrame(sceneJson: string, frame: number, baseDir?: string): void` ### Parameters - **sceneJson** (string) - Required - The JSON scene definition. - **frame** (number) - Required - The frame number to render. - **baseDir** (string) - Optional - Base directory for resolving relative paths. ### Returns - **void** - Returns once the frame is queued. ### Errors - Throws if frames are not in increasing order. - Throws on the next call if a frame cannot be drawn (e.g., wrong size, missing file). ``` -------------------------------- ### GET /api/renders Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Lists all render jobs, oldest first. Returns an array of RenderJob objects. ```APIDOC ## [GET] /api/renders ### Description Lists all render jobs, oldest first. Returns an array of RenderJob objects. ### Method GET ### Endpoint /api/renders ### Response #### Success Response (200) - **RenderJob[]** - Array of render job objects, oldest first #### Response Example [ { "type": "RenderJob" } ] ``` -------------------------------- ### GET /api/frame Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Fetches a preview frame image for a given composition and frame. Supports scale and format parameters, and optional props. ```APIDOC ## [GET] /api/frame ### Description Fetches a preview frame image for a given composition and frame. Supports scale and format parameters, and optional props. ### Method GET ### Endpoint /api/frame?comp&frame&scale&format&props ### Parameters #### Query Parameters - **comp** (string) - Required - Composition identifier - **frame** (number) - Required - Frame number - **scale** (number) - Optional - Scale factor for the image - **format** (string) - Optional - Image format (e.g., jpeg, png) - **props** (string) - Optional - URL-encoded JSON merged over the composition's defaultProps ### Response #### Success Response (200) - **image** (binary) - The image data - Headers: `Content-Type` (mime), `X-Build`, `X-Frame` #### Response Example (image binary data) ``` -------------------------------- ### Generate deterministic noise with random Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/guides/audio.mdx Fills an array with deterministic noise values using a named seed. The same seed produces the same sound every render. ```tsx import { random } from 'remotion'; for (let i = 0; i < data.length; i++) data[i] = random(`whoosh-${i}`) * 2 - 1; ``` -------------------------------- ### SceneRoot.snapshot() Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Returns the tree as it is now, after state updates since the last render (delayRender data arriving). Useful for getting the current state without re-rendering. ```APIDOC ## SceneRoot.snapshot() ### Description Returns the tree as it is now, after state updates since the last render (delayRender data arriving). Useful for getting the current state without re-rendering. ### Method Function ### Signature ```ts snapshot(): RenderedTree; ``` ### Returns - **RenderedTree** - The current emitted tree. ### Example ```ts const currentTree = root.snapshot(); ``` ``` -------------------------------- ### Kinetograph CLI usage Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/reference/cli.mdx Shows the general command syntax and how to get help for a command. The entry is a project file (.tsx, .ts, .jsx, .js) or a .json scene; some commands take a frame number or range after the entry. ```sh npx kinetograph [entry] [options] npx kinetograph --help ``` -------------------------------- ### Synthesize a tone with onFrame Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/guides/audio.mdx Schedules a Web Audio oscillator with a frequency and gain envelope at a specific frame. Call onFrame at the top level of the module, not inside a component. Schedule against t, not ctx.currentTime. ```tsx import { onFrame } from '@kinetographdev/audio'; onFrame(4, (ctx, t) => { const osc = ctx.createOscillator(); const gain = ctx.createGain(); osc.frequency.setValueAtTime(1800, t); osc.frequency.exponentialRampToValueAtTime(900, t + 0.05); gain.gain.setValueAtTime(0.25, t); gain.gain.exponentialRampToValueAtTime(0.001, t + 0.06); osc.connect(gain).connect(ctx.destination); osc.start(t); osc.stop(t + 0.07); }); ``` -------------------------------- ### List compositions, render a still, and create a strip Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/getting-started/first-video.mdx Run these commands to inspect the project. `compositions` lists each composition's id, size, frame rate, and length. `still` writes one frame as a PNG. `strip` writes 12 evenly spaced frames on one sheet, labelled with frame and time. The output folder is created if it does not exist. ```sh npx kinetograph compositions examples/hello/index.tsx npx kinetograph still examples/hello/index.tsx 15 -o out/hello-15.png npx kinetograph strip examples/hello/index.tsx -n 12 -o out/hello-strip.png ``` -------------------------------- ### Animate volume over frames with interpolate Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/guides/audio.mdx Sets the volume as a function of the frame, rising from 0 to 1 over the first 30 frames and clamping beyond. The frame is counted from the start of the enclosing Sequence. ```tsx -o /abs/path.png # the s11 look stills ``` -------------------------------- ### onInit / onPaint Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Lifecycle hooks for custom drawing in Remotion frames. onInit runs first, then onPaint; onInit must return a cleanup function. ```APIDOC ## onInit / onPaint ### Description Lifecycle hooks for custom drawing in Remotion frames. onInit runs first, then onPaint; onInit must return a cleanup function. ### Method N/A (function hooks) ### Parameters - **onInit** (function) - Required - Runs before onPaint; must return a cleanup function. - **onPaint** (function) - Optional - Draws on a 2D context; if omitted, default drawing is used. ### Notes - Async onPaint records only what is drawn before the first await; the rest is not waited for (warning once). - WebGPU context is not run; children are shown and reported as unsupported. - `isHtmlInCanvasSupported()` returns true; `isHtmlInCanvasNestingSupported()` returns false. ``` -------------------------------- ### Build and test the optional Skia addon Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Commands to build and test the optional @kinetographdev/skia addon. The first build downloads skia-safe's prebuilt Skia binary. Use these instead of the root npm scripts, which skip Skia. ```bash npm run build:addon:release -w crates/skia/node # downloads skia-safe's prebuilt Skia binary on the first build npm run test:addon -w crates/skia/node cargo test --manifest-path crates/skia/Cargo.toml # the pixel tests of the primitives, filters, SkSL and text ``` -------------------------------- ### getGifDurationInSeconds(src) Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Function to get the duration of a GIF in seconds. Returns a Promise that resolves to the duration. ```APIDOC ## getGifDurationInSeconds(src) ### Description Returns a Promise that resolves to the duration of the GIF in seconds. ### Parameters - `src` (string) - Required - The source URL or static file path. ### Returns - `Promise` - The duration in seconds. ``` -------------------------------- ### Check entry loads with npx kinetograph compositions Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/guides/migrate.mdx Run from the project root to verify the entry file (often src/index.ts) loads. If an import is not supported, the command stops and names it. ```bash npx kinetograph compositions src/index.ts ``` -------------------------------- ### GET /api/inspect Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Returns inspection data for a given composition and frame. Provides detailed layer information. ```APIDOC ## [GET] /api/inspect ### Description Returns inspection data for a given composition and frame. Provides detailed layer information. ### Method GET ### Endpoint /api/inspect?comp&frame&props ### Parameters #### Query Parameters - **comp** (string) - Required - Composition identifier - **frame** (number) - Required - Frame number - **props** (string) - Optional - URL-encoded JSON merged over the composition's defaultProps ### Response #### Success Response (200) - **InspectResult** - Inspection result object #### Response Example { "type": "InspectResult" } ``` -------------------------------- ### Renderer.beginVideo Source: https://github.com/0xs4n4tg/kinetograph/blob/main/crates/node/README.md Begins a video encoding session. GPU required. ```APIDOC ## Renderer.beginVideo ### Description Begins a video encoding session. GPU required. ### Method N/A (synchronous method) ### Endpoint N/A ### Parameters - **scene** (string) - Required - The scene as a JSON string. ### Request Example ```json { "scene": "{...}" } ``` ### Response - **videoSession** (object) - The video session handle. ### Response Example ```json { "videoSession": {} } ``` ``` -------------------------------- ### bench Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Runs performance benchmarks on the rendering pipeline. ```APIDOC ## bench ### Description Runs performance benchmarks on the rendering pipeline. ### Command `npx kinetograph bench [--frame N --runs K | --range a..b]` ### Arguments - **entry** (string) - Required - Path to a project file (.tsx, .ts, .jsx, .js) or a .json scene. ### Options - `--frame` (number) - Frame number to benchmark. - `--runs` (number) - Number of runs. - `--range` (string) - Frame range to benchmark. - `--json` - Output one JSON object on stdout. - `--comp ` - Composition ID (default: first composition). - `--props ` - JSON string of props to pass to the composition. ### Output Benchmark results for stages: `js`, `stringify`, addon stages, and `total`. ``` -------------------------------- ### GET /api/timeline Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Returns timeline data for a composition, including sequences and layer frame ranges. Cached per build, composition, and props. ```APIDOC ## [GET] /api/timeline ### Description Returns timeline data for a composition, including sequences and layer frame ranges. Cached per build, composition, and props. ### Method GET ### Endpoint /api/timeline?comp&props ### Parameters #### Query Parameters - **comp** (string) - Required - Composition identifier - **props** (string) - Optional - URL-encoded JSON merged over the composition's defaultProps ### Response #### Success Response (200) - **TimelineData** - Timeline data object #### Response Example { "type": "TimelineData" } ``` -------------------------------- ### Render the video with and without draft mode Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/getting-started/first-video.mdx Render the video to an MP4. `--draft` renders at half size for a quick look; without it, the video is 1280 by 720. The output is H.264 by default. Use a .mp4 or .mov path. `render` prints frame count, encoder, and time; add `--json` for a single JSON object. ```sh npx kinetograph render examples/hello/index.tsx -o out/hello.mp4 --draft npx kinetograph render examples/hello/index.tsx -o out/hello.mp4 ``` -------------------------------- ### getVideoMetadata(src) Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Function to get metadata for a video file. Returns a Promise that resolves to an object with duration, dimensions, aspect ratio, and FPS. ```APIDOC ## getVideoMetadata(src) ### Description Returns a Promise that resolves to an object containing video metadata. ### Parameters - `src` (string) - Required - The source URL or static file path. ### Returns - `Promise<{ durationInSeconds: number, width: number, height: number, aspectRatio: number, isRemote: false, fps: number }>` - The video metadata. ``` -------------------------------- ### probeStreams Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/AUTHORING.md Reads container and stream metadata from any file FFmpeg can open, without decoding. Returns format, duration, start, tags, and per-stream details. ```APIDOC ## probeStreams ### Description Reads container and stream metadata from any file FFmpeg can open, without decoding. Returns format, duration, start, tags, and per-stream details. ### Method Function ### Signature `probeStreams(path: string, baseDir?: string): MediaStreams` ### Parameters - **path** (string) - Required - Path to the media file. - **baseDir** (string) - Optional - Base directory for resolving relative paths. ### Returns - **MediaStreams** - Object containing format, duration, start, tags, and per-stream details (codec, ids, time base, size, rotation, colour, rate, channels, private data, cover picture). ### Errors - `IO` for a missing file. - `INVALID_ARG` for a file FFmpeg cannot open. ``` -------------------------------- ### Benchmark stages Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/SKILL.md Times the rendering stages. ```bash kinetograph bench ``` -------------------------------- ### Render with codec vp9 Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/SKILL.md Use vp9 codec. Output must be .webm. ```bash kinetograph render src/index.tsx --codec vp9 ``` -------------------------------- ### Select composition with props Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/SKILL.md Pick a composition by id and pass props as JSON. ```bash kinetograph compositions --comp --props '{"title":"Hi"}' ``` -------------------------------- ### studio Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/reference/cli.mdx Opens the studio in a browser: a preview, the timeline, the scene tree, props and a render queue. ```APIDOC ## studio ### Description Opens the studio in a browser: a preview, the timeline, the scene tree, props and a render queue. ### Usage ```sh npx kinetograph studio ``` ### Options | Option | Meaning | |---|---| | `--port ` | Port to listen on. The default is 3000. `0` picks a free port. | | `--host
` | Address to listen on. The default is `127.0.0.1`. | | `--no-open` | Do not open the browser. | | `--props ` | Input props, merged over each composition's `defaultProps`. | ### Notes The studio is the `@kinetographdev/studio` package. The command loads it by name, so it must be installed next to `kinetograph`. Stop the studio with Ctrl-C. ``` -------------------------------- ### Shader validation error message Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/SCENE.md Example error output when the shader code fails validation. The error names the layer and provides the line and column within the `code` field. ```text invalid scene: layer "card": shader code 2:30: expected `)`, found ";" ``` -------------------------------- ### Render as GIF Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/SKILL.md Use gif codec. Output must be .gif. ```bash kinetograph render src/index.tsx --codec gif ``` -------------------------------- ### Before: Remotion ThreeCanvas Spin component Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph-migrate/references/three.md Original Remotion implementation using ThreeCanvas and Remotion hooks. Uses position-based lighting and rotation in radians. ```tsx import { ThreeCanvas } from '@remotion/three'; import { useCurrentFrame, useVideoConfig } from 'remotion'; export const Spin = () => { const frame = useCurrentFrame(); const { width, height } = useVideoConfig(); return ( ); }; ``` -------------------------------- ### snapshot Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/reference/cli.mdx Compares rendered frames with approved PNGs. The approved files are in a `__snapshots__/` folder next to the entry. Each one is named after the file and the composition, with the frame number, for example `card.Title.f30.png`. ```APIDOC ## snapshot ### Description Compares rendered frames with approved PNGs. The approved files are in a `__snapshots__/` folder next to the entry. Each one is named after the file and the composition, with the frame number, for example `card.Title.f30.png`. ### Usage ```sh npx kinetograph snapshot --frames 0,30,60 npx kinetograph snapshot --update ``` ### Options | Option | Meaning | |---|---| | `--frames ` | Frames to compare. The default is the first, the middle and the last frame. | | `--update` | Writes the current renders as the approved PNGs. | ### Behavior A frame matches when no colour channel differs from the approved image by more than 2 levels. A mismatch or a missing approved file exits with 1. ``` -------------------------------- ### Render with draft quality Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/SKILL.md Half-size quick look for faster iteration. ```bash kinetograph render src/index.tsx --draft ``` -------------------------------- ### Render with --strict to catch unsupported features Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/guides/migrate.mdx Stops on the first frame with something unsupported, so nothing is silently missing. ```bash kinetograph render src/index.ts --comp -o out/video.mp4 --strict ``` -------------------------------- ### Benchmark a single frame with kinetograph bench Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/references/INTERNALS.md Times one frame: two warm-up renders, then K runs; outputs per-stage mean/min/max in ms. ```sh ./target/release/kinetograph bench examples/papercut-card.json --frame 30 --runs 10 ``` -------------------------------- ### Example scene JSON Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/guides/scene-format.mdx A minimal scene that moves a card and fades a dot in and out. It defines canvas size, frame rate, duration, background, and two layers with keyframed transforms. Render a frame with `npx kinetograph still scene.json 15 -o out/card-15.png`. ```json { "width": 640, "height": 360, "fps": 30, "durationInFrames": 60, "background": "#14171f", "layers": [ { "id": "card", "type": "shape", "shape": { "kind": "roundedRect", "width": 360, "height": 200, "radius": 28 }, "fill": "#f6c177", "stroke": { "color": "#ffffff", "width": 4 }, "transform": { "x": [ { "frame": 0, "value": 200, "easing": "easeOut" }, { "frame": 30, "value": 140 } ], "y": 80, "rotation": [ { "frame": 0, "value": -8, "easing": "easeInOut" }, { "frame": 59, "value": 8 } ] } }, { "id": "dot", "type": "shape", "shape": { "kind": "ellipse", "width": 40, "height": 40 }, "fill": "#7aa2f7", "opacity": 0.8, "transform": { "x": 500, "y": 280 } } ] } ``` -------------------------------- ### List compositions Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/SKILL.md Lists compositions in the entry file. ```bash kinetograph compositions ``` -------------------------------- ### Scene3D with model and light Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph-migrate/references/three.md Use this JSX to render a glTF model with a directional light in a Scene3D. The model file robot.glb must be placed in public/ next to the entry. Run kinetograph doctor to check for unsupported glTF features; unsupported features are drawn without them. ```tsx ``` -------------------------------- ### CMake configuration for yogacore library Source: https://github.com/0xs4n4tg/kinetograph/blob/main/vendor/rive/yoga/yoga/CMakeLists.txt Defines the yogacore static library build using CMake. Includes project defaults, collects all .cpp sources, links Android log library when building for Android, enables IPO if supported, and sets public include directories for build and install interfaces. ```cmake # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. cmake_minimum_required(VERSION 3.13...3.26) project(yogacore) set(CMAKE_VERBOSE_MAKEFILE on) if(TARGET yogacore) return() endif() include(CheckIPOSupported) set(YOGA_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/..) include(${YOGA_ROOT}/cmake/project-defaults.cmake) file(GLOB SOURCES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/**/*.cpp) add_library(yogacore STATIC ${SOURCES}) # Yoga conditionally uses when building for Android if (ANDROID) target_link_libraries(yogacore log) endif() check_ipo_supported(RESULT result) if(result) set_target_properties(yogacore PROPERTIES CMAKE_INTERPROCEDURAL_OPTIMIZATION true) endif() target_include_directories(yogacore PUBLIC $ $) ``` -------------------------------- ### Renderer.bench Source: https://github.com/0xs4n4tg/kinetograph/blob/main/crates/node/README.md Benchmarks rendering performance for the scene. GPU required. ```APIDOC ## Renderer.bench ### Description Benchmarks rendering performance for the scene. GPU required. ### Method N/A (synchronous method) ### Endpoint N/A ### Parameters - **scene** (string) - Required - The scene as a JSON string. ### Request Example ```json { "scene": "{...}" } ``` ### Response - **benchmark** (object) - The benchmark result. ### Response Example ```json { "benchmark": {} } ``` ``` -------------------------------- ### Render a Composition with CLI --props Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/site/content/docs/guides/authoring.mdx Command to render a composition. --comp selects the composition by id; --props passes a JSON object merged over defaultProps. Output is written to out/card.mp4. ```sh npx kinetograph render src/index.tsx --comp Card --props '{"title":"Hello"}' -o out/card.mp4 ``` -------------------------------- ### Render with audio codec Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/SKILL.md Set audio codec to opus. ```bash kinetograph render src/index.tsx --audio-codec opus ``` -------------------------------- ### List effects Source: https://github.com/0xs4n4tg/kinetograph/blob/main/packages/cli/skills/kinetograph/SKILL.md Lists available effects. ```bash kinetograph effects ```