{
  "id": "opencv/video-writer-fourcc-codec-not-supported",
  "signature": "OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 12",
  "signature_zh": "OpenCV: FFMPEG: 标签0x5634504d/'MP4V'不支持编解码器id 12",
  "regex": "OpenCV: FFMPEG: tag 0x[0-9a-fA-F]+/'.*' is not supported with codec id \\d+",
  "domain": "opencv",
  "category": "encoding_error",
  "subcategory": null,
  "root_cause": "The specified FOURCC code for VideoWriter is not supported by the FFMPEG backend on the current system, often due to missing codec or incompatible container format.",
  "root_cause_type": "generic",
  "root_cause_zh": "指定的VideoWriter FOURCC码在当前系统上不受FFMPEG后端支持，通常由于缺少编解码器或容器格式不兼容。",
  "versions": [
    {
      "version": "4.5.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "4.6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "4.8.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Changing FOURCC to 'XVID' without checking container compatibility",
      "why_fails": "XVID codec may not be installed or may require AVI container; using MP4 container fails.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Reinstalling OpenCV with different flags but not installing ffmpeg codecs",
      "why_fails": "Codec support depends on system ffmpeg libraries, not OpenCV build flags alone.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use a widely supported codec like 'avc1' (H.264) with .mp4 container, or 'MJPG' with .avi container. Verify codec availability with: ffmpeg -encoders | grep h264",
      "success_rate": 0.85,
      "how": "Use a widely supported codec like 'avc1' (H.264) with .mp4 container, or 'MJPG' with .avi container. Verify codec availability with: ffmpeg -encoders | grep h264",
      "condition": "",
      "sources": []
    },
    {
      "action": "Switch VideoWriter backend to OpenCV's built-in codecs by using cv2.CAP_OPENCV_MJPEG or specify backend via cv2.VideoWriter(filename, apiPreference, fourcc, ...).",
      "success_rate": 0.7,
      "how": "Switch VideoWriter backend to OpenCV's built-in codecs by using cv2.CAP_OPENCV_MJPEG or specify backend via cv2.VideoWriter(filename, apiPreference, fourcc, ...).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "使用广泛支持的编解码器，如'avc1'（H.264）配合.mp4容器，或'MJPG'配合.avi容器。通过ffmpeg -encoders | grep h264验证编解码器可用性。",
    "通过使用cv2.CAP_OPENCV_MJPEG或指定apiPreference参数，将VideoWriter后端切换到OpenCV内置编解码器。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.opencv.org/4.x/dd/d9e/classcv_1_1VideoWriter.html#a1b3b7b3e3e3e3e3e3e3e3e3e3e3e3e3",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.75,
  "resolvable": "partial",
  "first_seen": "2024-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}