You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Go代码创建含多MP3音轨与SRT字幕的HLS输出MediaConvert任务时遇400错误请求问题排查求助

Troubleshooting AWS MediaConvert 400 Bad Request for Multi-Audio/Subtitle HLS Job

I’ve dealt with plenty of these vague 400 errors from MediaConvert before—especially when working with external audio tracks and captions. Let’s walk through the most likely fixes to get your job running:

  • Fix the external audio selector type
    Your ENG and SPA audio selectors use selectorType: "TRACK", but these are standalone MP3 files (not audio tracks embedded in the video input). For external audio files, MediaConvert expects selectorType: "EXTERNAL_FILE" instead. Using TRACK here is probably confusing the service’s parser.

  • Adjust caption destination settings for HLS
    You’re trying to use destinationType: "EMBEDDED" for captions in an HLS output, but HLS doesn’t support embedded captions the same way MP4 does. For HLS, you’ll need to switch to either:

    • Sidecar captions: This creates separate SRT files alongside your stream segments, which is widely supported:
      "destinationSettings": {
        "destinationType": "SIDEcar",
        "sidecarSettings": {
          "sidecarType": "SRT"
        }
      }
      
    • Embedded SCTE-20 captions: If you need captions embedded directly in the stream, use destinationType: "EMBEDDED_SCTE20" and ensure your HLS group settings are configured to handle it.
  • Validate your clientRequestToken
    The clientRequestToken needs to be a unique, case-sensitive string (up to 64 characters). If you’re using placeholder text like "---", replace it with a valid UUID or unique identifier. MediaConvert uses this token to prevent duplicate jobs, so an invalid value can trigger a parsing error.

  • Double-check enum values for typos
    MediaConvert is strict about enum casing and values. A small typo can break the whole request:

    • Confirm codec values like "AAC" and "H_264" are correctly cased (they’re case-sensitive)
    • Verify defaultSelection values ("DEFAULT"/"NOT_DEFAULT") are spelled correctly
    • Ensure numeric fields like bitrate and segmentLength are actually numbers (not strings)
  • Test with a minimal working job
    Strip your request down to the basics: just the video input, one internal audio track, no captions. If that succeeds, add back external audio first, then captions, one component at a time. This helps isolate exactly which part of your configuration is causing the parsing failure—critical when the settingsValidationErrorsJsonBlob comes back empty.

  • Compare with a console-generated request
    Build the exact same job manually in the AWS MediaConvert Console, then export the JSON request from the console. Compare it line-by-line with your generated JSON. The console’s output is a gold standard for valid configurations, and it’ll often catch subtle missing fields or incorrect structures your code might have missed.

  • Verify JSON formatting
    Even if your JSON looks correct, double-check for trailing commas, missing quotes, or mismatched brackets. A single tiny syntax error can lead to this vague "request could not be interpreted" message. Use a JSON linter to validate the entire payload before sending it.

内容的提问来源于stack exchange,提问作者Jayyrus

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.01 02:17:32