{
  "name": "video-thumbnail",
  "summary": "Grabs a single frame from a video at a chosen timestamp as a PNG or JPEG, optionally scaled to a width.",
  "rationale": "Seeking and decoding one frame needs ffmpeg AND a hardened fetch: an agent that pulls the URL itself walks past every SSRF control, and carrying an ffmpeg per call is not something an agent does inline.",
  "family": "av",
  "price_usd": "0.003",
  "free": false,
  "timeout_ms": 60000,
  "max_timeout_seconds": 81,
  "input_schema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "url": {
        "type": "string",
        "maxLength": 2048,
        "format": "uri",
        "description": "Absolute http(s) URL of the video, at most 2048 characters; the container (MP4/MOV, MKV/WebM, AVI or Ogg) is detected from the bytes."
      },
      "time_seconds": {
        "default": 0,
        "description": "Timestamp of the frame to grab, in seconds from the start (0 to 86400, default 0); a time past the end fails with no_frame.",
        "type": "number",
        "minimum": 0,
        "maximum": 86400
      },
      "format": {
        "default": "png",
        "description": "Encoding of the returned frame: png (default) or jpeg.",
        "type": "string",
        "enum": [
          "png",
          "jpeg"
        ]
      },
      "width": {
        "description": "Output width in pixels (16 to 4096); the height keeps the aspect ratio, rounded to an even number. Native size when omitted.",
        "type": "integer",
        "minimum": 16,
        "maximum": 4096
      }
    },
    "required": [
      "url"
    ],
    "additionalProperties": false
  },
  "input_example": {
    "url": "https://grist.tools/samples/av/thumbnail-clip.mp4",
    "time_seconds": 1,
    "format": "png"
  },
  "output_example": {
    "source_url": "https://grist.tools/samples/av/thumbnail-clip.mp4",
    "bytes": 2587,
    "container": "mp4",
    "time_seconds": 1,
    "format": "png",
    "width": 128,
    "height": 72,
    "image_bytes": 292,
    "image_base64": "iVBORw0KGgoAAAANSUhEUgAAAIAAAABICAIAAACx52pFAAAACXBIWXMAAAABAAAA..."
  },
  "errors": [
    "invalid_input",
    "blocked_target",
    "unreachable_target",
    "upstream_timeout",
    "unsupported_content_type",
    "too_large",
    "unprocessable",
    "internal"
  ]
}