ondevice-ffmpeg-engine

ondevice-ffmpeg-engine is a skill for Claude Code, Codex from heristop/leclap. It costs 75 tokens per session (2,327 once invoked), scanned A, original, MIT.

A guide for building and using a Rust-based FFmpeg engine that compiles video directly on a device. FFmpeg is software for processing video and audio.

In plain words
What is it for?
Use it when working on the Rust engine, Expo native module, platform bindings, build scripts, or FFmpeg-from-source toolchain.
Why use it?
It supports video processing without a server or uploading the media, while exposing APIs for running, inspecting, checking versions, and cancelling work.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is bash scripts/ffmpeg/build-host.sh # builds scripts/ffmpeg/dist/host/lib/libfftools.a.

Good fit Use it when working on the Rust engine, Expo native module, platform bindings, build scripts, or FFmpeg-from-source toolchain.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/heristop/leclap
agentmods
npx agentmods add skills/heristop/leclap/ondevice-ffmpeg-engine

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ondevice-ffmpeg-engine

README.md
[![agentmods](https://agentmods.dev/badge/skills/heristop/leclap/ondevice-ffmpeg-engine/github.svg)](https://agentmods.dev/skills/heristop/leclap/ondevice-ffmpeg-engine)
Your own site
<a href="https://agentmods.dev/skills/heristop/leclap/ondevice-ffmpeg-engine"><img src="https://agentmods.dev/badge/skills/heristop/leclap/ondevice-ffmpeg-engine/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ondevice-ffmpeg-engine

Your own site · 80×15
<a href="https://agentmods.dev/skills/heristop/leclap/ondevice-ffmpeg-engine"><img src="https://agentmods.dev/badge/skills/heristop/leclap/ondevice-ffmpeg-engine.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,327 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00075 $0.02327
Opus 5.5 $0.00030 $0.00931
Sonnet 5.5 $0.00015 $0.00465
Haiku 4.5 $0.00007 $0.00233

Measured 21d ago against content hash 46c95e73591a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ondevice-ffmpeg-engine scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 21d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/ondevice-ffmpeg-engine/SKILL.md · 88 lines

How it starts

The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.

On-Device FFmpeg Engine

Overview

The Expo app renders video on-device (no compile server or render upload; remote assets can still require downloads) by running real FFmpeg in-process through a Rust engine that statically links patched FFmpeg fftools. The same ffmpeg-video-composer core that drives Node/WASM drives this engine via one more AbstractFFmpeg implementation. Full architecture + boundary contracts: docs/on-device-compilation.md.

Two halves:

  • Build toolchain — scripts/ffmpeg/ cross-compiles FFmpeg + deps into static libs (libfftools.a …) per target.
  • Runtime engine — packages/ffmpeg-engine/ (Rust + uniffi) → apps/leclap-expo/modules/leclap-ffmpeg/ (Expo native module, Kotlin + Swift).

Call chain: core FFmpegDeviceAdapter.execute(cmd) → parseCommand → Leclap.run(argv) (native module) → uniffi → Rust lib.rs → C shim ffmpeg_shim.c → patched ffmpeg_main/ffprobe_main.

API surface (the native module / Rust uniffi exports)

apps/leclap-expo/modules/leclap-ffmpeg/index.ts wraps the Expo native module, whose Kotlin/Swift bridges call the generated uniffi functions:

  • run(args: string[]): Promise<{ code, log }> — runs ffmpeg; args exclude the program name (the shim prepends ffmpeg); captures stderr as log.
  • probe(args: string[]): Promise<{ code, output }> — runs ffprobe; captures stdout (-print_format json).
  • version(): string — FFmpeg build version; also the presence probe (ffmpegAvailability.ts).
  • cancel(): void — cooperative cancel of the in-flight run (sets fftools' shutdown flags; the run exits ~as on SIGTERM, returns 255). No-op when idle.

No shell is ever involved — run/probe invoke ffmpeg_main/ffprobe_main in-process with an argv array. run and probe serialize behind a process-global ENGINE_LOCK (fftools hold global state). cancel deliberately bypasses the lock so it can stop a running invocation; version also does not take it. Cancellation does not affect probe. Empty argv or an interior NUL returns the Rust ARGV_ERROR sentinel (-2) before invoking fftools.

Read the full file on GitHub · 88 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 21d ago Changed · +4 lines 46c95e73591a
  2. 24d ago Changed · +3 lines cdf1b074929e
  3. 1mo ago First seen · 81 lines · 75 tokens per session scan A 5c6b69c3c9d0

Subscribe to this mod's changes

ondevice-ffmpeg-engine is a skill published in the GitHub repository heristop/leclap (36 stars, last pushed 4d ago), licensed MIT. It adds 75 tokens to every session and 2,327 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.