LeClap

LeClap · On-device

The video engine for AI agents

One template. Many videos.

Use the same JSON template with different coding agents. Your AI agent uses tokens to write it. Rerender a video or swap inputs to make variations, with zero tokens per render.

Connect your agent

MCP or CLI. Keep every composition editable.

Render a sample template. No upload or camera needed.

Your agent writes the template once. LeClap renders a video for every input: same inputs, same file.

Change the inputs, never the template.

A template declares its inputs: your clip, your words, your colours. Every set of inputs gives its own video; the same set gives the same file again, byte for byte, per platform.

  1. An intro card with your show's name, in your colour.
  2. Sections cross-fade on their own. One line sets it.
  3. Your clip goes in. No editing timeline.
  4. Your name lands on the name bar.
  5. Your role and show, on the second bar.
  6. One colour styles the bar and both cards.
  7. Your logo, on every video.
  8. Subtitles follow the voice, and the music ducks under it. No editing.
  9. An outro card closes on your name.
  10. Film someone else. Same template, same brand, same finish.
  11. Change one value. Every video follows.
  12. Same inputs, same file, byte for byte. No model in the loop.

Rendered twice: the same file, byte for byte.

your-clip.jsonTemplate locked
{  "global": {    "transition": { "type": "fade", "duration": 0.4 },    "music": { "name": "lofi-study.mp3" },    "audio": {      "musicVolume": 1, "musicFade": 0.4,      "ducking": true    },    "watermark": {      "url": "pictures/open-clinic-mark.png",      "position": "top-right",      "scale": 0.155, "opacity": 1, "margin": 36    },    "fields": {      "clip": { "type": "media" },      "name": { "type": "text", "maxLength": 28 },      "role": { "type": "text", "maxLength": 24 },      "show": { "type": "text", "maxLength": 24 },      "line": { "type": "text", "maxLength": 64 },      "accent": { "type": "color" }    }  },  "sections": [{    "type": "color_background",    "options": {      "duration": 1.6, "musicVolume": 1    },    "inputs": [{      "type": "image",      "url": "pictures/open-clinic-mark.png"    }],    "titleCard": {      "headline": { "en": "{{ show }}" },Health MinuteHealth MinuteHealth Minute      "accent": "{{ accent }}"#FF8AAE#FF8AAE#FFF685    }  }, {    "type": "video",    "options": {      "videoUrl": "{{ clip }}",doctor-office-clinic.mp4podcast-host-clinic.mp4podcast-host-clinic.mp4      "musicVolume": 0.25    },    "lowerThird": {      "position": "top",      "title": { "en": "{{ name }}" },Mai TranSam RiveraSam Rivera      "subtitle": { "en": "{{ role }}, {{ show }}" },Doctor, Health MinuteHost, Health MinuteHost, Health Minute      "accent": "{{ accent }}"#FF8AAE#FF8AAE#FFF685    },    "subtitles": {      "cues": [{        "at": 0.4, "end": 3.2,        "text": "{{ line }}"Hi, I'm Mai Tran. Welcome to Open Clinic.Hey, Sam Rivera here. This is Open Clinic.Hey, Sam Rivera here. This is Open Clinic.      }],      "style": "boxed", "karaoke": "word",      "activeColor": "{{ accent }}"#FF8AAE#FF8AAE#FFF685    }  }, {    "type": "color_background",    "options": {      "duration": 1.8, "musicVolume": 1    },    "inputs": [{      "type": "image",      "url": "pictures/open-clinic-mark.png"    }],    "titleCard": {      "headline": { "en": "{{ name }}" },Mai TranSam RiveraSam Rivera      "subtitle": { "en": "{{ show }}" }Health MinuteHealth MinuteHealth Minute    }  }]}

From an empty folder to a render, with your agent

Two commands set the project up. Then ask your agent client for a video: it reads the schema, writes the template, fixes what the validator flags, and LeClap renders it.

~/hello
  1. pnpm dlx @leclap/cli init hello
  2. ✓ Created hello
  3. cd hello && pnpm install
  4. + @leclap/cli 0.7.0
  5. ◆ leclap connected · .mcp.json · 15 tools
  6. Make a 6-second vertical launch teaser, with the logo at the end.
  7. Reading the template schema.
  8. get_template_schema: schema and authoring guide
  9. Drafting template.json: 3 scenes, portrait.
  10. validate_template: "Oswald" is not a bundled font → use "oswald"
  11. Fixing the font id.
  12. validate_template: valid · 2 motion findings: headline_hold_short
  13. Holding each headline longer.
  14. validate_template: valid · 3 sections, portrait
  15. compose_video: build/1796258694754-ffca7f/output.mp4 · 6s · 749 KB · QC verified
  16. Done: a 6-second vertical teaser, logo on the last scene.
output.mp4· 720×1280 · 6 s

Runs where you do

Node, the browser through WebAssembly and the phone, with no render server in between.

  • Node.js

    Render from a script or CI with the engine library, on system FFmpeg or ffmpeg-static.

  • Browser

    FFmpeg compiled to WebAssembly renders in the tab. Nothing is uploaded.

  • On-device

    An LGPL build of FFmpeg is linked into the iOS and Android app. Footage stays on the phone.

Shoot and render, right on the phone.

The same templates run on the phone: FFmpeg is compiled into the app, so your footage never leaves your hands.

  1. 01

    Pick a template

    Browse ready-made looks and choose the one that fits your story.

  2. 02

    Shoot your clip

    Film straight from the app, with a countdown and a framing guide.

  3. 03

    Render it on the phone

    FFmpeg composes the finished video on the device. No server, no upload.

  4. 04

    Your video, finished

    Titles, grade and lower third baked in, ready to post, and still on your phone.

One template. Every screen.

62 seconds, every shot rendered or recorded for real: the template, the engine, the browser and the phone.

The trailer · 1:02

Questions, answered

What is LeClap?

LeClap is an open-source JSON template engine. One file describes a video’s sections, effects, music and transitions, and LeClap compiles it into a finished video with FFmpeg.

Is the render deterministic?

Yes, per platform. The same template, assets, configuration and runtime give the same video, and leclap verify --rerender checks it against the render manifest. Platforms use different encoders (libx264 on Node and in the browser, libopenh264 on Android, h264_videotoolbox on iOS), so pixels can differ between them.

Does AI generate the video?

No. There is no generative model in the render path. An agent can write the template over MCP; LeClap renders it locally with FFmpeg.

Does rendering cost tokens?

Your AI agent uses tokens when you ask it to write or edit a template. Once you have the template, LeClap renders it locally with FFmpeg. Use the same inputs to rerender the video or change the inputs to make variations, all without tokens.

How do I connect an agent?

Add @leclap/mcp to your MCP client, then have the agent call get_capabilities and get_template_schema before it validates and composes a template.

Does it need a server?

No. LeClap renders on Node, in the browser with WebAssembly and on-device with an LGPL build of FFmpeg. Nothing is uploaded to render.

How do I try it?

Run pnpm dlx @leclap/cli init hello, then pnpm install and pnpm render inside the new folder (npm works too). It writes build/output.mp4 from the template.json next to it.

Same JSON, same video. No code.