{
  "slug": "video-aspect-ratio-fix",
  "name": "gizza-ai/video-aspect-ratio-fix",
  "version": "0.1.0",
  "title": "Fix Video Aspect Ratio Online — Retag DAR Without Re-encoding — gizza.ai",
  "description": "Repair a video that plays stretched or squashed by retagging its display aspect ratio locally with ffmpeg stream copy — no upload, no re-encode, no quality loss.",
  "tags": [
    "fix video aspect ratio",
    "display aspect ratio",
    "DAR",
    "SAR",
    "anamorphic video",
    "stretched video",
    "squashed video",
    "remux",
    "ffmpeg"
  ],
  "category": "video",
  "urls": {
    "page": "https://gizza.ai/tools/video-aspect-ratio-fix/",
    "markdown": "https://gizza.ai/tools/video-aspect-ratio-fix/index.md",
    "descriptor": "https://gizza.ai/tools/video-aspect-ratio-fix/tool.json",
    "deep_link_example": "https://gizza.ai/tools/video-aspect-ratio-fix/?url=https://example.com/input&aspect=16%3A9&custom_aspect=1.85&container=keep&faststart=true"
  },
  "cli": "gizza tool video-aspect-ratio-fix 'url=https://example.com/input' 'aspect=16:9' 'custom_aspect=1.85' 'container=keep' 'faststart=true'",
  "tool": {
    "description": "Fix a video that plays stretched, squashed, or anamorphic because its stored aspect metadata is wrong. Rewrites the display aspect ratio (DAR) tag with ffmpeg stream copy (-map 0 -c copy -aspect W:H): the container header is rebuilt with the correct ratio while the audio and video packets are copied bit-for-bit, so there is no re-encode and no quality loss. The frame's stored pixel size is unchanged — only the shape the player displays. Provide a video as url or ref. Params: aspect=16:9|9:16|4:3|3:4|1:1|21:9|2.39:1|1.85:1|5:4|4:5|3:2|2:3|custom (default 16:9), custom_aspect (used only when aspect=custom; accepts 16:9, 16/9, 1.85 or 1920x1080), container=keep|mp4|mkv|mov|webm (default keep), faststart=true|false (MP4/MOV moov-to-front, default true). To reset a file to square pixels, use aspect=custom with the video's stored pixel size, e.g. 640x480. To letterbox, crop, or actually rescale the pixels, use the video-aspect-pad, video-crop, or video-resize tools instead.",
    "parameters": {
      "additionalProperties": false,
      "oneOf": [
        {
          "required": [
            "url"
          ]
        },
        {
          "required": [
            "ref"
          ]
        }
      ],
      "properties": {
        "aspect": {
          "default": "16:9",
          "description": "Display aspect ratio (DAR) to tag the video with. 16:9 (default) is standard widescreen, 9:16 vertical/phone, 4:3 classic TV, 1:1 square, 21:9 ultrawide, 2.39:1 and 1.85:1 cinema. Pick custom to supply your own ratio in custom_aspect. The stored pixel size is never changed — only the shape the player is told to display.",
          "enum": [
            "16:9",
            "9:16",
            "4:3",
            "3:4",
            "1:1",
            "21:9",
            "2.39:1",
            "1.85:1",
            "5:4",
            "4:5",
            "3:2",
            "2:3",
            "custom"
          ],
          "type": "string"
        },
        "container": {
          "default": "keep",
          "description": "Output container. keep (default) rebuilds the same container as the input, which is the safest lossless fix; mp4/mkv/mov/webm remux into that container instead. Only stream copy is used, so the codecs must be compatible with the chosen container (e.g. H.264/AAC fits mp4/mov/mkv but not webm; VP9/Opus fit webm/mkv/mp4).",
          "enum": [
            "keep",
            "mp4",
            "mkv",
            "mov",
            "webm"
          ],
          "type": "string"
        },
        "custom_aspect": {
          "default": "",
          "description": "Your own ratio, used ONLY when aspect=custom (ignored otherwise). Accepts 'W:H' (16:9), 'W/H' (16/9), a decimal width÷height (1.85), or display dimensions 'WxH' (1920x1080). Must work out to between 0.05 and 20. Tip: to reset a file to square pixels, pass its stored pixel size, e.g. 640x480.",
          "type": "string"
        },
        "faststart": {
          "default": true,
          "description": "MP4/MOV output only: move the moov atom (index) to the front of the file so players read the new aspect ratio immediately and the file streams progressively (-movflags +faststart). Ignored for mkv/webm. Default true.",
          "type": "boolean"
        },
        "ref": {
          "description": "Reference id from a prior tool call. Use either url or ref.",
          "type": "string"
        },
        "url": {
          "description": "Video URL (HTTP/HTTPS). Use either url or ref.",
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}