pythonamazon-web-servicesboto3aws-media-convert

MediaConvert client.create_job() doesnt work for some reason


i have come up with this code so far:

# 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

The response throws error:
Parameter validation failed: Unknown parameter in Settings: "FollowSource"

I have no clue what to do next. can anyone with experience on MediaConvert and boto3 give tips?

I mostly got my code from a json snippet of a successful job i ran on MediaConvert manually.


Solution

  • I found my error i had to remove:

    "FollowSource": 1,
    and
    "StorageClass": "STANDARD"
    from my dict because it was wrong syntax I guess