{
  "id": "android/mediacodec-format-not-supported",
  "signature": "android.media.MediaCodec$CodecException: Error 0x80001001: Failed to configure codec (format not supported)",
  "signature_zh": "android.media.MediaCodec$CodecException: 错误0x80001001: 配置编解码器失败（格式不受支持）",
  "regex": "android\\.media\\.MediaCodec\\$CodecException: Error 0x80001001: Failed to configure codec \\(format not supported\\)",
  "domain": "android",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "MediaCodec.configure() is called with a MediaFormat containing unsupported parameters (e.g., resolution, bitrate, or profile) for the selected codec on the device's hardware decoder/encoder.",
  "root_cause_type": "generic",
  "root_cause_zh": "使用包含设备硬件解码器/编码器不支持的参数（例如分辨率、比特率或配置文件）的MediaFormat调用MediaCodec.configure()。",
  "versions": [
    {
      "version": "Android 11 (API 30)",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android 12 (API 31)",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Android 13 (API 33)",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "MediaCodec API (all versions)",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Hardcode a specific codec name like 'video/avc' without checking device support",
      "why_fails": "Different devices support different profiles and levels within a codec. Hardcoding a codec name does not ensure the format parameters are valid.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Use the highest resolution supported by the camera sensor",
      "why_fails": "The encoder may not support that resolution even if the camera does. The codec's capabilities are independent of the camera's.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Query codec capabilities using MediaCodecList.getCodecCapabilities() and adjust format parameters (e.g., reduce resolution, change profile). Example: val capabilities = MediaCodecList(MediaCodecList.REGULAR_CODECS).findEncoderForFormat(format); val codecInfo = MediaCodecList.getCodecInfoAt(index); val caps = codecInfo.getCapabilitiesForType(mimeType);",
      "success_rate": 0.9,
      "how": "Query codec capabilities using MediaCodecList.getCodecCapabilities() and adjust format parameters (e.g., reduce resolution, change profile). Example: val capabilities = MediaCodecList(MediaCodecList.REGULAR_CODECS).findEncoderForFormat(format); val codecInfo = MediaCodecList.getCodecInfoAt(index); val caps = codecInfo.getCapabilitiesForType(mimeType);",
      "condition": "",
      "sources": []
    },
    {
      "action": "Fall back to a software codec by using MediaCodecList with a specific component name that is known to support the format, or use MediaCodec.createDecoderByType() with a fallback to MediaCodec.createByCodecName() using a software decoder name.",
      "success_rate": 0.85,
      "how": "Fall back to a software codec by using MediaCodecList with a specific component name that is known to support the format, or use MediaCodec.createDecoderByType() with a fallback to MediaCodec.createByCodecName() using a software decoder name.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Query codec capabilities using MediaCodecList.getCodecCapabilities() and adjust format parameters (e.g., reduce resolution, change profile). Example: val capabilities = MediaCodecList(MediaCodecList.REGULAR_CODECS).findEncoderForFormat(format); val codecInfo = MediaCodecList.getCodecInfoAt(index); val caps = codecInfo.getCapabilitiesForType(mimeType);",
    "Fall back to a software codec by using MediaCodecList with a specific component name that is known to support the format, or use MediaCodec.createDecoderByType() with a fallback to MediaCodec.createByCodecName() using a software decoder name."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.android.com/reference/android/media/MediaCodec#configure(android.media.MediaFormat,%20android.view.Surface,%20android.media.MediaCrypto,%20int)",
  "official_doc_section": null,
  "error_code": "0x80001001",
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.88,
  "resolvable": "true",
  "first_seen": "2023-04-22",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}