get-ffmpeg-version
Retrieve the installed FFmpeg version on your system to ensure compatibility and functionality for video processing tasks under the MCP FFmpeg Video Processor.
Instructions
Get the version of FFmpeg installed on the system
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp-ffmpeg.ts:77-101 (handler)Executes 'ffmpeg -version' command, extracts the version number using regex, formats and returns the version info and full output as text content. Returns error response if command fails or FFmpeg not found.async () => { try { const { stdout, stderr } = await execAsync('ffmpeg -version'); // Extract the version from the output const versionMatch = stdout.match(/ffmpeg version (\S+)/); const version = versionMatch ? versionMatch[1] : 'Unknown'; return { content: [{ type: "text" as const, text: `FFmpeg Version: ${version}\n\nFull version info:\n${stdout}` }] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { isError: true, content: [{ type: "text" as const, text: `Error getting FFmpeg version: ${errorMessage}\n\nMake sure FFmpeg is installed and in your PATH.` }] }; } }
- src/mcp-ffmpeg.ts:73-102 (registration)Registers the 'get-ffmpeg-version' tool with McpServer.tool(), providing tool name, description, empty parameter schema {}, and inline async handler function.server.tool( "get-ffmpeg-version", "Get the version of FFmpeg installed on the system", {}, async () => { try { const { stdout, stderr } = await execAsync('ffmpeg -version'); // Extract the version from the output const versionMatch = stdout.match(/ffmpeg version (\S+)/); const version = versionMatch ? versionMatch[1] : 'Unknown'; return { content: [{ type: "text" as const, text: `FFmpeg Version: ${version}\n\nFull version info:\n${stdout}` }] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { isError: true, content: [{ type: "text" as const, text: `Error getting FFmpeg version: ${errorMessage}\n\nMake sure FFmpeg is installed and in your PATH.` }] }; } } );
- src/mcp-ffmpeg.ts:76-76 (schema)Empty schema object indicating the tool takes no input parameters.{},
- src/mcp-ffmpeg.ts:11-11 (helper)Promisified version of Node.js child_process.exec() used by the tool handler to asynchronously execute the FFmpeg version command.const execAsync = promisify(exec);