{
  "name": "media-probe",
  "summary": "Reads a media file's container, duration, bit rate and per-stream codec/resolution without decoding it.",
  "rationale": "Probing a media file needs the ffprobe binary 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": 30000,
  "max_timeout_seconds": 51,
  "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 audio or video file, up to 2048 characters, in a recognised container (MP4/MOV, Matroska/WebM, AVI, Ogg, WAV, FLAC, AIFF or MP3); ffprobe reads its container index and nothing is decoded."
      }
    },
    "required": [
      "url"
    ],
    "additionalProperties": false
  },
  "input_example": {
    "url": "https://grist.tools/samples/av/probe-clip.mov"
  },
  "output_example": {
    "source_url": "https://grist.tools/samples/av/probe-clip.mov",
    "bytes": 33850,
    "container": "mp4",
    "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
    "duration_seconds": 2,
    "bit_rate": 135400,
    "streams": [
      {
        "index": 0,
        "type": "video",
        "codec": "png",
        "codec_long_name": "PNG (Portable Network Graphics) image",
        "width": 64,
        "height": 36,
        "frame_rate": 2,
        "sample_rate": null,
        "channels": null
      },
      {
        "index": 1,
        "type": "audio",
        "codec": "pcm_s16le",
        "codec_long_name": "PCM signed 16-bit little-endian",
        "width": null,
        "height": null,
        "frame_rate": null,
        "sample_rate": 8000,
        "channels": 1
      }
    ]
  },
  "errors": [
    "invalid_input",
    "blocked_target",
    "unreachable_target",
    "upstream_timeout",
    "unsupported_content_type",
    "too_large",
    "unprocessable",
    "internal"
  ]
}