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

MediaConvert client.create_job()调用失败,提示FollowSource参数未知

解决AWS MediaConvert create_job()接口的"FollowSource"参数错误问题

问题场景

基于手动运行成功的MediaConvert作业JSON编写boto3代码调用create_job()接口时,抛出参数验证错误:

Parameter validation failed: Unknown parameter in Settings: "FollowSource"

原代码片段:

# Initialize a MediaConvert client
client = boto3.client('mediaconvert', region_name='us-east-1')

job_settings = {
  "Queue": "arn:aws:mediaconvert:my-queue",
  "UserMetadata": {},
  "Role": "arn:aws:iam::my-role",
  "Settings": {
    "TimecodeConfig": {
      "Source": "ZEROBASED"
    },
    "OutputGroups": [
      {
        "CustomName": "video resolution",
        "Name": "File Group",
        "Outputs": [
          {
            "Preset": "System-Broadcast_Avci_Ts_Avc_Aac_16x9_1280x720p_30Hz_50Mbps",
            "NameModifier": "720p"
          },
          {
            "Preset": "System-Broadcast_Avci_Ts_Avc_Aac_16x9_1920x1080i_25Hz_100Mbps",
            "NameModifier": "1080p"
          },
          {
            "Preset": "System-Broadcast_Mpegts_Ts_Hevc_Aac_4x3_720x480p_30Hz_1.5Mbps",
            "NameModifier": "480p"
          }
        ],
        "OutputGroupSettings": {
          "Type": "FILE_GROUP_SETTINGS",
          "FileGroupSettings": {
            "Destination": "s3://vidvast/videos/",
            "DestinationSettings": {
              "S3Settings": {
                "StorageClass": "STANDARD"
              }
            }
          }
        }
      }
    ],
    "FollowSource": 1,  # 导致错误的参数
    "Inputs": [
      {
        "AudioSelectors": {
          "Audio Selector 1": {
            "DefaultSelection": "DEFAULT"
          }
        },
        "VideoSelector": {},
        "TimecodeSource": "ZEROBASED",
        "FileInput": input_file
      }
    ]
  },
  "BillingTagsSource": "JOB",
  "AccelerationSettings": {
    "Mode": "DISABLED"
  },
  "StatusUpdateInterval": "SECONDS_60",
  "Priority": 0
}

# Create the job
response = client.create_job(**job_settings)
return response

解决方法

  1. 移除非法参数:直接删除Settings对象下的"FollowSource": 1字段。这个参数是MediaConvert控制台生成作业时自动添加的扩展字段,不属于boto3调用create_job()接口的合法参数范围。
  2. 确认替代逻辑:如果原FollowSource是为了让输出跟随源文件的属性(如帧率、分辨率),MediaConvert的系统预设或输入配置会自动处理该逻辑,无需额外添加这个参数。若需自定义跟随行为,可在Inputs的VideoSelector或AudioSelectors中配置对应参数。
  3. 验证参数结构:可以通过AWS CLI命令生成合法的参数骨架,对比检查自己的配置:
aws mediaconvert create-job --generate-cli-skeleton

修改后的代码片段(移除FollowSource):

# Initialize a MediaConvert client
client = boto3.client('mediaconvert', region_name='us-east-1')

job_settings = {
  "Queue": "arn:aws:mediaconvert:my-queue",
  "UserMetadata": {},
  "Role": "arn:aws:iam::my-role",
  "Settings": {
    "TimecodeConfig": {
      "Source": "ZEROBASED"
    },
    "OutputGroups": [
      {
        "CustomName": "video resolution",
        "Name": "File Group",
        "Outputs": [
          {
            "Preset": "System-Broadcast_Avci_Ts_Avc_Aac_16x9_1280x720p_30Hz_50Mbps",
            "NameModifier": "720p"
          },
          {
            "Preset": "System-Broadcast_Avci_Ts_Avc_Aac_16x9_1920x1080i_25Hz_100Mbps",
            "NameModifier": "1080p"
          },
          {
            "Preset": "System-Broadcast_Mpegts_Ts_Hevc_Aac_4x3_720x480p_30Hz_1.5Mbps",
            "NameModifier": "480p"
          }
        ],
        "OutputGroupSettings": {
          "Type": "FILE_GROUP_SETTINGS",
          "FileGroupSettings": {
            "Destination": "s3://vidvast/videos/",
            "DestinationSettings": {
              "S3Settings": {
                "StorageClass": "STANDARD"
              }
            }
          }
        }
      }
    ],
    "Inputs": [
      {
        "AudioSelectors": {
          "Audio Selector 1": {
            "DefaultSelection": "DEFAULT"
          }
        },
        "VideoSelector": {},
        "TimecodeSource": "ZEROBASED",
        "FileInput": input_file
      }
    ]
  },
  "BillingTagsSource": "JOB",
  "AccelerationSettings": {
    "Mode": "DISABLED"
  },
  "StatusUpdateInterval": "SECONDS_60",
  "Priority": 0
}

# Create the job
response = client.create_job(**job_settings)
return response

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.16 15:47:12