ffmpeg-runtime
Runs FFmpeg and FFprobe native builds to inspect media metadata, convert media, extract audio, trim media, and capture frames/screenshots through MCP tools, CLI commands, and a JavaScript API.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
FFmpeg Runtime
Run current FFmpeg and FFprobe builds without installing them globally. Use native commands from a terminal, call the JavaScript API, or connect an MCP client for media inspection, conversion, audio extraction, trimming, and screenshots.
Requires Node.js 22.18+ and npm. Windows, macOS, and glibc Linux are supported on
x64 and arm64. Linux archive extraction also requires tar with XZ support.
Musl Linux and other architectures currently require a compatible local binary
with --preferred-runtime local.
Native CLI
npx -y --prefer-online mcp-ffmpeg-runtime@latest ffmpeg -i input.mp4 output.webm
npx -y --prefer-online mcp-ffmpeg-runtime@latest ffprobe -v error -show_streams -of json input.mp4Everything after ffmpeg or ffprobe is passed as a native argument array without
a shell. Standard input, standard output, standard error, and exit status belong
to the underlying program. For native help use ffmpeg -h or ffprobe -h.
Wrapper options go before the program name:
npx -y --prefer-online mcp-ffmpeg-runtime@latest --preferred-runtime local ffmpeg -version
npx -y --prefer-online mcp-ffmpeg-runtime@latest --offline ffprobe -version
npx -y --prefer-online mcp-ffmpeg-runtime@latest runtime info--preferred-runtime local uses which to find the required program in PATH. Only native
PE, ELF, or Mach-O executables are accepted. Shell scripts, .cmd, .bat, .sh,
and extensionless scripts are skipped, preventing recursion through wrapper
scripts. If no native match exists, the normal download/cache path is used.
Other preferences ignore system programs.
Preference | Behavior |
| Default: newest published build, checked at most daily |
| Use a validated cached build without checking; use latest when none exists |
| Prefer a native executable in PATH; use latest when none exists |
npm semver range | Highest available matching release, e.g. |
Build ID | Use that specific build; never substitute an unrelated build |
Version preferences have independent cache pointers and can coexist. Failed
updates may use an existing matching build, but never a version outside the
requested range. If no compatible published or cached build exists, the operation
fails. --offline remains a strict no-network option; cached may download on a miss.
npx -y --prefer-online mcp-ffmpeg-runtime@latest --preferred-runtime "9.1" ffmpeg -versionRelated MCP server: ffmpeg-mcp
MCP
{
"mcpServers": {
"ffmpeg-runtime": {
"command": "npx",
"args": [
"-y",
"--prefer-online",
"mcp-ffmpeg-runtime@latest",
"--preferred-runtime",
"local",
"mcp"
]
}
}
}To limit the impact of duplicate and orphaned MCP processes in applications such as Codex, Claude Code, etc., we recommend running this server throughmcpLazyProxy.
When mcpLazyProxy starts a new backend with npx -y --prefer-online and an @latest package reference, npm checks the current version. A running backend uses its installed version until its next start.
CLI and MCP use the same tool definitions and functions from the installed package. The MCP server executes tools directly; package updates are checked at launch by external npx. It also works without a proxy.
Omit the preference to use latest. Preference is configured
once at server launch; individual tools do not expose it. The CLI and JavaScript
API share the same executable resolver.
Tool | Purpose |
| Executable paths, sources, build identifiers, and versions |
| Any native FFmpeg argument array, including codec/filter help |
| Any native FFprobe argument array |
| Local file metadata as structured JSON |
| First audio stream; copy by default, or select an encoder |
| Output container and optional audio/video codecs |
| Start and duration, with optional stream copying |
| One screenshot, optionally limiting its height |
Common operations require explicit output paths and preserve existing files unless
overwrite is true. Native ffmpeg arguments retain their normal overwrite and
network behavior. Stream-copy trimming may align to video keyframes. Copying audio
requires an output container compatible with the source codec.
Generic MCP tools capture textual stdout/stderr, with a 16 MiB limit per stream.
Write binary or large output to files. Their default execution timeout is 3600
seconds and can be overridden with timeoutSeconds. Use the native CLI for pipes
or interactive execution. Discovery never downloads or starts FFmpeg.
JavaScript
import { resolveBinary, runFfmpeg, probeMedia } from "mcp-ffmpeg-runtime";
const options = { preferredRuntime: "local" };
const { command } = await resolveBinary("ffmpeg", options);
const metadata = await probeMedia("/recordings/input.mp4", options);
await runFfmpeg(
["-nostdin", "-i", "/recordings/input.mp4", "/output/audio.mp3"],
options,
);runFfprobe, ensureRuntime, getBuilds, and settings are also exported.
getBuilds({ platform, arch, channel }) returns a normalized catalog with release
versions, immutable build IDs, archive URLs and checksum references. Selection
resolves the selected archives to SHA-256 values before any download. Runtime options are
cacheDir, channel, offline, and preferredRuntime. Execution accepts signal and
timeoutSeconds. Nonzero execution throws an error with exitCode, stdout, and
stderr. ensureRuntime explicitly installs or validates a downloaded pair;
use resolveBinary to apply the local preference for a particular program.
Builds and cache
One catalog module reads public paginated build histories. The default release
channel selects the highest published release version
by FFmpeg-Builds on Windows/Linux and the
latest release build on Martin Riedl's server
for macOS. Two-component FFmpeg release labels such as 9.1 are normalized to
9.1.0 for npm semver matching. Builds can include provider commits after that
release; use a build ID to select a specific provider build. History retention varies by provider.
Select --channel snapshot for development snapshots. "Latest" means
the newest build available from that provider for the selected platform/channel;
a provider may lag upstream FFmpeg. Both binaries come from the same build.
With a valid cached runtime, provider metadata is checked at most once every 24 hours for each platform and channel. The check time is shared on disk across processes; cache hits do not extend it. Missing or damaged binaries trigger an immediate lookup and repair. Unchanged builds reuse their cached files after integrity verification. New archives are checked against provider SHA-256 checksums and installed atomically under a lock. Existing build directories remain available to running processes. Updates do not require a new npm release of this wrapper.
If a provider check or update download fails, a verified existing runtime remains
usable. The failed attempt is also remembered for 24 hours to avoid repeated
requests during outages or rate limiting. The JavaScript result exposes
updateCheckError, checkedAt, and lastCheckAt. Without a valid cached runtime,
the operation reports the provider/download error.
env-paths('ffmpeg-runtime') supplies the platform cache directory:
Windows:
%LOCALAPPDATA%/ffmpeg-runtime-nodejs/CachemacOS:
~/Library/Caches/ffmpeg-runtime-nodejsLinux:
$XDG_CACHE_HOME/ffmpeg-runtime-nodejsor~/.cache/ffmpeg-runtime-nodejs
The npm/npx cache holds this package; the runtime cache separately holds downloaded
binaries. No install script downloads them. Use --offline to use an existing
validated runtime without any release check. Offline mode fails clearly if no
valid cached build is available. If --preferred-runtime local finds a native binary, no
provider request or binary download occurs.
Environment variable | Default | CLI equivalent |
|
|
|
| Platform cache |
|
|
|
|
|
|
|
FFMPEG_OFFLINE accepts true or false. JavaScript options override environment
settings; CLI wrapper flags override the corresponding environment values.
License
This wrapper is MIT licensed. Downloaded FFmpeg/FFprobe builds have their own licenses, including GPL components. They are fetched from the providers and are not included in this npm package. Consult the corresponding provider's build information, source, and license terms when distributing binaries or outputs. This project is independent of FFmpeg and the build providers.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP tools for FFmpeg-style video and audio processing through FFMPEG API.
Audio, music, video, image, PDF, speech, text and web-check tools callable from any MCP client.
Audio, music, video, image, PDF, speech, text and web-check tools callable from any MCP client.
FFmpeg processing for video, audio and images via MCP with OAuth and shared account allowance.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables comprehensive video and audio processing using FFmpeg, supporting tasks like metadata extraction, clipping, scaling, and adding transitions or overlays. It provides a high-performance interface for building media processing microservices via FastMCP.1212MIT
- FlicenseNot gradedqualityDmaintenanceEnables comprehensive video/audio processing, analysis, and streaming via natural language by exposing 40+ FFmpeg tools as MCP tools.23-
- AlicenseBqualityCmaintenanceEnables any MCP host to probe, transcode, remux, extract, convert, thumbnail, and burn subtitles for video, audio, and images using local FFmpeg with safe typed tools and quality-first CRF/VBR defaults.10MIT
- AlicenseNot gradedqualityCmaintenanceGives coding agents a local FFmpeg video-editing engine exposed over MCP, enabling them to probe, cut, join, reframe, caption, normalize audio, and verify the resulting media without cloud services or API keys. Every operation returns structured JSON and self-checks its own output against delivery specs.MIT