Skip to main content
Glama

create_video_from_images

Convert a sequence of images into a video file using FFmpeg processing. Specify input image patterns, output path, framerate, and codec options to generate videos from still frames.

Instructions

Create a video from a sequence of images

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputPatternYesPattern for input images (e.g., 'img%03d.jpg' or 'folder/*.png')
outputPathYesPath for the output video file
framerateNoFrames per second (default: 25)
codecNoVideo codec to use (default: libx264)
pixelFormatNoPixel format (default: yuv420p)
extraOptionsNoAdditional FFmpeg options

Implementation Reference

  • The core handler logic for the 'create_video_from_images' tool. It processes input arguments, builds an FFmpeg command to generate a video from images using the specified pattern, framerate, codec, pixel format, and extra options, executes it via runFFmpegCommand, and returns the completion message with results.
    case "create_video_from_images": {
      const inputPattern = String(args?.inputPattern);
      const outputPath = validatePath(String(args?.outputPath));
      const framerate = Number(args?.framerate || 25);
      const codec = String(args?.codec || "libx264");
      const pixelFormat = String(args?.pixelFormat || "yuv420p");
      const extraOptions = String(args?.extraOptions || "");
      
      if (!inputPattern) {
        throw new Error("Input pattern is required");
      }
      
      await ensureDirectoryExists(outputPath);
      const command = `-framerate ${framerate} -i "${inputPattern}" -c:v ${codec} -pix_fmt ${pixelFormat} ${extraOptions} "${outputPath}" -y`;
      const result = await runFFmpegCommand(command);
      
      return {
        content: [{
          type: "text",
          text: `Video creation completed: ${inputPattern} → ${outputPath}\n\n${result}`
        }]
      };
    }
  • The tool schema definition specifying name, description, and input schema with properties for inputPattern (required), outputPath (required), framerate, codec, pixelFormat, and extraOptions.
    {
      name: "create_video_from_images",
      description: "Create a video from a sequence of images",
      inputSchema: {
        type: "object",
        properties: {
          inputPattern: {
            type: "string",
            description: "Pattern for input images (e.g., 'img%03d.jpg' or 'folder/*.png')"
          },
          outputPath: {
            type: "string",
            description: "Path for the output video file"
          },
          framerate: {
            type: "number",
            description: "Frames per second (default: 25)"
          },
          codec: {
            type: "string",
            description: "Video codec to use (default: libx264)"
          },
          pixelFormat: {
            type: "string",
            description: "Pixel format (default: yuv420p)"
          },
          extraOptions: {
            type: "string",
            description: "Additional FFmpeg options"
          }
        },
        required: ["inputPattern", "outputPath"]
      }
    },
  • src/index.ts:46-50 (registration)
    Registers the tool by including it in the toolDefinitions array returned for ListToolsRequestSchema, making the schema and description available to clients.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: toolDefinitions
      };
    });
  • src/index.ts:56-68 (registration)
    Registers the generic tool call handler that dispatches to the specific handler in handlers.ts based on tool name, enabling execution of create_video_from_images.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      try {
        return await handleToolCall(request.params.name, request.params.arguments);
      } catch (error: any) {
        console.error("Tool execution error:", error.message);
        return {
          content: [{
            type: "text",
            text: `Error: ${error.message}`
          }]
        };
      }
    });
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action 'create' but lacks details on behavioral traits like whether it overwrites existing files, requires specific permissions, handles errors, or has performance implications. This is inadequate for a tool with 6 parameters and no output schema.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, with no wasted content.

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?

Given the complexity of a video creation tool with 6 parameters, no annotations, and no output schema, the description is incomplete. It lacks information on output format, error handling, dependencies, or usage context, leaving significant gaps for an AI agent.

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%, providing full documentation for all 6 parameters. The description adds no additional parameter semantics beyond the schema, so it meets the baseline of 3 without compensating or adding 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 verb 'create' and the resource 'video from a sequence of images', making the purpose explicit. It distinguishes from siblings like 'convert_video' or 'extract_frames' by focusing on generation from images, but doesn't explicitly mention how it differs from all siblings.

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 on when to use this tool versus alternatives. It doesn't mention prerequisites, when not to use it, or compare to siblings like 'convert_video' or 'extract_frames' that might handle related tasks.

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

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/sworddut/mcp-ffmpeg-helper'

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