Skip to main content
Glama
ZizoTheDev

FFmpeg MCP Server

speed_up

Increase video playback speed with configurable FPS and speed factor using FFmpeg MCP Server. Specify input/output files and adjust parameters for precise control.

Instructions

Speed up a video

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
input_fileYesPath to input file
max_fpsNoMax FPS for the output file
output_fileNoPath to output file, output to the same directory if not specified
speed_factorNoSpeed factor for the output file, default to 2x sped up

Implementation Reference

  • main.ts:31-79 (handler)
    The asynchronous handler function for the 'speed_up' tool. It processes input arguments, constructs the output file path if needed, executes ffmpeg to speed up the video using setpts, fps, and atempo filters, logs the output, and returns a success or error response.
    async (args) => {
      const output_file =
        args.output_file ||
        getOutputFilePath(args.input_file, path.extname(args.input_file))
    
      const result = x(ffmpeg, [
        `-i`,
        args.input_file,
        `-filter:v`,
        `setpts=${1 / args.speed_factor}*PTS,fps=fps=${args.max_fps}`,
        `-af`,
        `atempo=${args.speed_factor}`,
        `-y`,
        output_file,
      ])
    
      let output = ""
    
      for await (const line of result) {
        output += line
        await server.server.sendLoggingMessage({
          level: "debug",
          data: {
            line,
          },
        })
      }
    
      if (result.exitCode !== 0) {
        return {
          content: [
            {
              type: "text",
              text: `Error: ${output}`,
            },
          ],
          isError: true,
        }
      }
    
      return {
        content: [
          {
            type: "text",
            text: `Successfully sped up video to: ${output_file}`,
          },
        ],
      }
    },
  • tools.ts:4-28 (schema)
    The schema definition for the 'speed_up' tool, including name, description, and Zod-validated input schema for input_file, output_file (optional), max_fps, and speed_factor.
    speed_up: {
      name: "speed_up",
      description: "Speed up a video",
      input: {
        input_file: z.string().describe("Path to input file"),
        output_file: z
          .string()
          .describe(
            "Path to output file, output to the same directory if not specified",
          )
          .optional(),
        max_fps: z
          .number()
          .min(1)
          .max(60)
          .default(30)
          .describe("Max FPS for the output file"),
        speed_factor: z
          .number()
          .min(0.1)
          .max(10)
          .default(2)
          .describe("Speed factor for the output file, default to 2x sped up"),
      },
    },
  • main.ts:27-80 (registration)
    The registration of the 'speed_up' tool on the MCP server using server.tool(), passing the name, description, input schema from tools.ts, and the inline handler function.
    server.tool(
      tools.speed_up.name,
      tools.speed_up.description,
      tools.speed_up.input,
      async (args) => {
        const output_file =
          args.output_file ||
          getOutputFilePath(args.input_file, path.extname(args.input_file))
    
        const result = x(ffmpeg, [
          `-i`,
          args.input_file,
          `-filter:v`,
          `setpts=${1 / args.speed_factor}*PTS,fps=fps=${args.max_fps}`,
          `-af`,
          `atempo=${args.speed_factor}`,
          `-y`,
          output_file,
        ])
    
        let output = ""
    
        for await (const line of result) {
          output += line
          await server.server.sendLoggingMessage({
            level: "debug",
            data: {
              line,
            },
          })
        }
    
        if (result.exitCode !== 0) {
          return {
            content: [
              {
                type: "text",
                text: `Error: ${output}`,
              },
            ],
            isError: true,
          }
        }
    
        return {
          content: [
            {
              type: "text",
              text: `Successfully sped up video to: ${output_file}`,
            },
          ],
        }
      },
    )
  • main.ts:9-13 (helper)
    Helper function used in the speed_up handler to generate a default output file path in the same directory as the input with '_output' suffix.
    const getOutputFilePath = (input: string, ext: string) => {
      const input_dir = path.dirname(input)
      const input_filename = path.basename(input, path.extname(input))
      return path.join(input_dir, `${input_filename}_output${ext}`)
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'speed up' implies a transformation operation, it doesn't disclose whether this is destructive to the original file, what permissions are needed, or any rate limits. The description lacks essential behavioral context for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just three words, front-loading the core purpose without any wasted language. Every word earns its place in this minimal but clear statement.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a video processing tool with 4 parameters and no annotations or output schema, the description is insufficient. It doesn't explain what the tool returns, what happens to the original file, or provide any context about the processing operation beyond the basic purpose.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents all four parameters. The description adds no additional parameter information beyond what's in the schema, meeting the baseline expectation but not providing extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('speed up') and resource ('a video'), making the purpose immediately understandable. However, it doesn't differentiate from the sibling tool 'extract_audio', which handles a different video processing function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives. The description doesn't mention the sibling tool 'extract_audio' or any other video processing options, leaving the agent without context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ZizoTheDev/ffmpeg-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server