AWS Elemental MediaConvert CreateJob Example Using the SDK for Python - AWS Elemental MediaConvert API Reference
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

AWS Elemental MediaConvert CreateJob Example Using the SDK for Python

Follow these steps to send requests using the Amazon SDK for Python (Boto):

  1. Use the describe_endpoints method to request an endpoint.


    Make the DescribeEndpoints call only once, then hardcode or cache your endpoint. This endpoint is specific to your Amazon Region and won't change.

    Don't use DescribeEndpoints to create your Amazon client each time that you make a request to MediaConvert. Otherwise, you will reach the throttle maximum on the public API endpoint.

  2. Specify the transcoding settings for your job in a JSON file.

    You can use the AWS Elemental MediaConvert console to generate the JSON job specification. For more information and sample job specifications, see Creating Your Job Specification.

  3. Perform these steps in your Python code, as demonstrated in the example that follows these steps:

    1. Create the client with endpoint specified.

    2. Load your settings JSON file.

    3. Create the transcoding job using create_job.

    import json import boto3 # Create MediaConvert client mediaconvert_client = boto3.client('mediaconvert', endpoint_url='') # Load job.json from disk and store as Python object: job_object with open("job.json", "r") as jsonfile: job_object = json.load(jsonfile) # Create MediaConvert job by unpacking the arguments from job_object. The job object contains the required parameters # for create_job. Pass these to create_job using Python's ** argument unpacking syntax. mediaconvert_client.create_job(**job_object)