Create an AWS Elemental MediaConvert job with Step Functions
Learn how to use Step Functions to create an AWS Elemental MediaConvert job using the CreateJob
API.
Experiment with Step Functions and MediaConvert
Learn how to use the MediaConvert optimized integration in a workflow that detects and removes SMTPE color bars of unknown length from the beginning of a video clip. Read the blog post from Apr, 12, 2024: Low code workflows with AWS Elemental MediaConvert
To learn about integrating with AWS servicesin Step Functions, see Integrating services and Passing parameters to a service API in Step Functions.
Key features of Optimized MediaConvert integration
The Run a Job (.sync) integration pattern is available.
No optimizations for Request Response or Wait for a Callback with Task Token integration patterns.
The following includes a Task
state that submits an MediaConvert job and waits
for it to complete.
{
"StartAt": "MediaConvert_CreateJob",
"States": {
"MediaConvert_CreateJob": {
"Type": "Task",
"Resource": "arn:aws:states:::mediaconvert:createJob.sync",
"Parameters": {
"Role": "arn:aws:iam::111122223333:role/Admin",
"Settings": {
"OutputGroups": [
{
"Outputs": [
{
"ContainerSettings": {
"Container": "MP4"
},
"VideoDescription": {
"CodecSettings": {
"Codec": "H_264",
"H264Settings": {
"MaxBitrate": 1000,
"RateControlMode": "QVBR",
"SceneChangeDetect": "TRANSITION_DETECTION"
}
}
},
"AudioDescriptions": [
{
"CodecSettings": {
"Codec": "AAC",
"AacSettings": {
"Bitrate": 96000,
"CodingMode": "CODING_MODE_2_0",
"SampleRate": 48000
}
}
}
]
}
],
"OutputGroupSettings": {
"Type": "FILE_GROUP_SETTINGS",
"FileGroupSettings": {
"Destination": "s3://amzn-s3-demo-destination-bucket/"
}
}
}
],
"Inputs": [
{
"AudioSelectors": {
"Audio Selector 1": {
"DefaultSelection": "DEFAULT"
}
},
"FileInput": "s3://amzn-s3-demo-bucket/DOC-EXAMPLE-SOURCE_FILE"
}
]
}
},
"End": true
}
}
}
Parameters in Step Functions are expressed in PascalCase
Even if the native service API is in camelCase, for example the API action startSyncExecution
, you specify parameters in PascalCase, such as: StateMachineArn
.
Supported MediaConvert APIs
-
-
Supported parameters:
-
Role
(Required) -
Settings
(Required) -
CreateJobRequest
(Optional)
-
-
Response syntax – see CreateJobResponse schema
IAM policies for calling AWS Elemental MediaConvert
The following example templates show how AWS Step Functions requires you to set up your IAM policies based on the resources in your state machine definition. You can use the IAM console to add any missing role policies. For more information, see How Step Functions generates IAM policies for integrated services and Discover service integration patterns in Step Functions.
Because MediaConvert provides partial support for resource-level access control, you must use "Resource": "*"
.