Deterministic, on-device, agent-callable video β composed by prompt or by hand.
Describe a video in one JSON template β sections, filters, music, overlays β then render the same template identically on a phone (React Native, on-device) or in the browser (WebAssembly). No upload, no server, no generative model: the output is deterministic and reproducible.
Quick start Β· Templates Β· Library API Β· Architecture Β· Docs
LeClap renders video from a single JSON template: the same spec β sections, filters, music, text overlays β runs in the browser via WebAssembly and fully on-device on React Native, with no upload and no server required. Its uncontested corner is deterministic + on-device + agent-callable video, where generative tools (Sora/Runway) and backend-bound renderers (Remotion/Shotstack) can't reach: the full loop β record a clip from the camera, apply effects, mix music, add transitions, render β runs on the phone (or a browser tab), and an AI agent can author and render a template with no LLM in the output path.
| Highlight | What it means |
|---|---|
| π§© Template-driven | One JSON descriptor β a complete video. No imperative FFmpeg wrangling. |
| π Runs everywhere | Node.js, browser (WASM), and React Native β one shared core, deterministic output. |
| πΉ Capture β compose β render | Record from the camera, trim/crop, mix music, add transitions, and render β captured, edited, and composed on-device. |
| π€ Agent-callable | An MCP server lets an AI agent author & render a template β no LLM in the loop, just deterministic output. |
| π¨ Premium out of the box | A bundled creative kit of polished, on-device-safe templates β by prompt or in the visual builder. |
| π§± Typed & validated | Zod-validated templates, strict TypeScript, dependency-injected architecture. |
Two looks at LeClap β a finished clip rendered from a single JSON template, and the mobile app composing one fully on-device.
|
π¬ Template-driven render one JSON template β a finished clip Β· unmute for sound drink-and-coffee.mp4 |
π± On-device on Android the app: capture β compose β render, on the phone leclap-android-demo.mp4 |
π‘ Recommended: mise.
mise installprovisions the exact pinned toolchain β Node 24, pnpm 11, FFmpeg 8.1.1, and Rust β so every contributor and CI run identical versions. Managing versions yourself? Bring Node β₯ 24 and pnpm 11.
git clone https://github.com/heristop/leclap.git
cd leclap
mise install # Node 24, pnpm 11, FFmpeg 8.1.1 + Rust
pnpm installThen pick an app:
pnpm app:web # web app β compiles videos in-browser (no server)
pnpm app:expo # Expo mobile app β compiles fully on-device (no server)Or use the CLI β @leclap/cli is the leclap dev tool:
npx @leclap/cli init my-video # scaffold a starter project
npx @leclap/cli render template.json # render it (`leclap diagnose` checks your FFmpeg)Or drive it from an AI agent: the @leclap/mcp server exposes the engine as MCP tools β discover β validate β render β with no LLM in the output path.
pnpm workspaces (apps/*, packages/*) β no turbo/nx. The root is a private orchestrator (leclap); ffmpeg-video-composer, @leclap/cli, and @leclap/mcp are published to npm. The web and mobile apps both run the same core β the mobile app drives it fully on-device via the embedded native engine (no server), the web app in-browser via WASM.
| Package | Description |
|---|---|
ffmpeg-video-composer |
The library β cross-platform composition engine (Node, browser, WASM). |
@leclap/cli |
The CLI β the leclap dev tool: scaffold (init), render, diagnose. |
@leclap/creative-kit |
Shared creative catalog β templates, partials, fonts, media, bundled assets. |
@leclap/mcp |
MCP server β the engine as agent-callable tools (compose/list/probe). |
@leclap/web |
React 19 + Vite + Tailwind β in-browser FFmpeg via WASM (reference). |
@leclap/expo |
Expo / React Native β on-device compiles via the native engine (reference). |
ffmpeg-engine |
Rust engine embedding FFmpeg fftools for on-device compiles. |
A template is a Zod-validated JSON descriptor β a global block plus an ordered list of sections, each a clip with its own inputs β maps β filters pipeline and {{ variable }} placeholders. Start from a creative-kit template and tweak text, colors, and media β by prompt (MCP) or in the visual builder.
- π Template configuration reference β global config, sections, the FFmpeg pipeline, placeholders.
- π₯ Use it as a library β install, the
compile()API, entry points (Node / browser / RN), and automatic FFmpeg detection.
- π Descriptor reference (web) β the full, schema-driven descriptor reference, one page per topic (sections, transitions, looks, grade, motion, audio, captions, filters, examples, JSON Schema).
- π§© Template Configuration β the template JSON reference.
- π Architecture β system architecture and design patterns.
- π§ FFmpeg Fallback Strategy β how automatic FFmpeg detection works.
- π± On-Device Compilation β the serverless Expo compile pipeline.
- π€ AGENTS.md β repo layout, commands, and conventions for contributors and AI agents.
Issues and PRs welcome. Keep changes formatted (pnpm fmt) and lint-clean (pnpm lint) before committing. Licensed under the MIT License.