By using AWS re:Post, you agree to the Terms of Use
/Mediaconvert Job JSON Issue/

Mediaconvert Job JSON Issue

0

I'm trying to run MediaConvert using the PHP SDK however I'm getting a bad exception. I have directly copy and pasted the job json from the console and then json_decode it into an array and pass it into the SDK. But this is the error i'm getting.

Bad Request` response:
{
"errorType": "BadRequestException",
"httpStatus" : 400,
"requestId" : "8271d3c1-94bb-4489-b950-d5be7edabd20",
(truncated...)
BadRequestException (client): The 'settings' field is required. - {
"errorType": "BadRequestException",
"httpStatus" : 400,
"requestId" : "8271d3c1-94bb-4489-b950-d5be7edabd20",
"message" : "The 'settings' field is required.",
"settingsValidationErrorsJsonBlob" : "[]"
}

$jobSetting = '{
"Queue": "arn:aws:mediaconvert:us-west-2:XXXX:queues/Default",
"UserMetadata": {},
"Role": "arn:aws:iam::XXXXX",
"Settings": {
"OutputGroups": [
{
"Name": "File Group",
"Outputs": [
{
"ContainerSettings": {
"Container": "MP4",
"Mp4Settings": {
"CslgAtom": "INCLUDE",
"FreeSpaceBox": "EXCLUDE",
"MoovPlacement": "PROGRESSIVE_DOWNLOAD"
}
},
"VideoDescription": {
"Width": 1920,
"ScalingBehavior": "DEFAULT",
"Height": 1080,
"VideoPreprocessors": {
"Deinterlacer": {
"Algorithm": "INTERPOLATE",
"Mode": "DEINTERLACE",
"Control": "NORMAL"
}
},
"TimecodeInsertion": "DISABLED",
"AntiAlias": "ENABLED",
"Sharpness": 50,
"CodecSettings": {
"Codec": "H_264",
"H264Settings": {
"InterlaceMode": "PROGRESSIVE",
"ParNumerator": 1,
"NumberReferenceFrames": 3,
"Syntax": "DEFAULT",
"Softness": 0,
"GopClosedCadence": 1,
"HrdBufferInitialFillPercentage": 90,
"GopSize": 2,
"Slices": 1,
"GopBReference": "DISABLED",
"HrdBufferSize": 12000000,
"ParDenominator": 1,
"SpatialAdaptiveQuantization": "ENABLED",
"TemporalAdaptiveQuantization": "ENABLED",
"FlickerAdaptiveQuantization": "ENABLED",
"EntropyEncoding": "CABAC",
"Bitrate": 6000000,
"FramerateControl": "INITIALIZE_FROM_SOURCE",
"RateControlMode": "CBR",
"CodecProfile": "HIGH",
"Telecine": "NONE",
"MinIInterval": 0,
"AdaptiveQuantization": "HIGH",
"CodecLevel": "LEVEL_4",
"FieldEncoding": "PAFF",
"SceneChangeDetect": "ENABLED",
"QualityTuningLevel": "MULTI_PASS_HQ",
"FramerateConversionAlgorithm": "DUPLICATE_DROP",
"UnregisteredSeiTimecode": "DISABLED",
"GopSizeUnits": "SECONDS",
"ParControl": "SPECIFIED",
"NumberBFramesBetweenReferenceFrames": 1,
"RepeatPps": "DISABLED"
}
},
"AfdSignaling": "NONE",
"DropFrameTimecode": "ENABLED",
"RespondToAfd": "NONE",
"ColorMetadata": "INSERT"
},
"AudioDescriptions": [
{
"AudioTypeControl": "FOLLOW_INPUT",
"AudioSourceName": "Audio Selector 1",
"CodecSettings": {
"Codec": "AAC",
"AacSettings": {
"AudioDescriptionBroadcasterMix": "NORMAL",
"Bitrate": 256000,
"RateControlMode": "CBR",
"CodecProfile": "LC",
"CodingMode": "CODING_MODE_2_0",
"RawFormat": "NONE",
"SampleRate": 48000,
"Specification": "MPEG4"
}
},
"LanguageCodeControl": "FOLLOW_INPUT",
"AudioType": 0
}
],
"NameModifier": "1080"
},
{
"ContainerSettings": {
"Container": "MP4",
"Mp4Settings": {
"CslgAtom": "INCLUDE",
"FreeSpaceBox": "EXCLUDE",
"MoovPlacement": "PROGRESSIVE_DOWNLOAD"
}
},
"VideoDescription": {
"Width": 1280,
"ScalingBehavior": "DEFAULT",
"Height": 720,
"VideoPreprocessors": {
"Deinterlacer": {
"Algorithm": "INTERPOLATE",
"Mode": "DEINTERLACE",
"Control": "NORMAL"
}
},
"TimecodeInsertion": "DISABLED",
"AntiAlias": "ENABLED",
"Sharpness": 50,
"CodecSettings": {
"Codec": "H_264",
"H264Settings": {
"InterlaceMode": "PROGRESSIVE",
"ParNumerator": 1,
"NumberReferenceFrames": 3,
"Syntax": "DEFAULT",
"Softness": 0,
"GopClosedCadence": 1,
"HrdBufferInitialFillPercentage": 90,
"GopSize": 2,
"Slices": 1,
"GopBReference": "ENABLED",
"HrdBufferSize": 9000000,
"ParDenominator": 1,
"SpatialAdaptiveQuantization": "ENABLED",
"TemporalAdaptiveQuantization": "ENABLED",
"FlickerAdaptiveQuantization": "ENABLED",
"EntropyEncoding": "CABAC",
"Bitrate": 3000000,
"FramerateControl": "INITIALIZE_FROM_SOURCE",
"RateControlMode": "CBR",
"CodecProfile": "HIGH",
"Telecine": "NONE",
"MinIInterval": 0,
"AdaptiveQuantization": "HIGH",
"CodecLevel": "LEVEL_4",
"FieldEncoding": "PAFF",
"SceneChangeDetect": "ENABLED",
"QualityTuningLevel": "MULTI_PASS_HQ",
"FramerateConversionAlgorithm": "DUPLICATE_DROP",
"UnregisteredSeiTimecode": "DISABLED",
"GopSizeUnits": "SECONDS",
"ParControl": "SPECIFIED",
"NumberBFramesBetweenReferenceFrames": 3,
"RepeatPps": "DISABLED"
}
},
"AfdSignaling": "NONE",
"DropFrameTimecode": "ENABLED",
"RespondToAfd": "NONE",
"ColorMetadata": "INSERT"
},
"AudioDescriptions": [
{
"AudioTypeControl": "FOLLOW_INPUT",
"AudioSourceName": "Audio Selector 1",
"CodecSettings": {
"Codec": "AAC",
"AacSettings": {
"AudioDescriptionBroadcasterMix": "NORMAL",
"Bitrate": 160000,
"RateControlMode": "CBR",
"CodecProfile": "LC",
"CodingMode": "CODING_MODE_2_0",
"RawFormat": "NONE",
"SampleRate": 48000,
"Specification": "MPEG4"
}
},
"LanguageCodeControl": "FOLLOW_INPUT",
"AudioType": 0
}
],
"NameModifier": "720"
},
{
"ContainerSettings": {
"Container": "MP4",
"Mp4Settings": {
"CslgAtom": "INCLUDE",
"FreeSpaceBox": "EXCLUDE",
"MoovPlacement": "PROGRESSIVE_DOWNLOAD"
}
},
"VideoDescription": {
"Width": 854,
"ScalingBehavior": "DEFAULT",
"Height": 480,
"VideoPreprocessors": {
"Deinterlacer": {
"Algorithm": "INTERPOLATE",
"Mode": "DEINTERLACE",
"Control": "NORMAL"
}
},
"TimecodeInsertion": "DISABLED",
"AntiAlias": "ENABLED",
"Sharpness": 50,
"CodecSettings": {
"Codec": "H_264",
"H264Settings": {
"InterlaceMode": "PROGRESSIVE",
"ParNumerator": 1,
"NumberReferenceFrames": 3,
"Syntax": "DEFAULT",
"Softness": 0,
"GopClosedCadence": 1,
"HrdBufferInitialFillPercentage": 90,
"GopSize": 2,
"Slices": 1,
"GopBReference": "ENABLED",
"HrdBufferSize": 12000000,
"ParDenominator": 1,
"SpatialAdaptiveQuantization": "ENABLED",
"TemporalAdaptiveQuantization": "ENABLED",
"FlickerAdaptiveQuantization": "ENABLED",
"EntropyEncoding": "CABAC",
"Bitrate": 2000000,
"FramerateControl": "INITIALIZE_FROM_SOURCE",
"RateControlMode": "CBR",
"CodecProfile": "HIGH",
"Telecine": "NONE",
"MinIInterval": 0,
"AdaptiveQuantization": "HIGH",
"CodecLevel": "LEVEL_4",
"FieldEncoding": "PAFF",
"SceneChangeDetect": "ENABLED",
"QualityTuningLevel": "MULTI_PASS_HQ",
"FramerateConversionAlgorithm": "DUPLICATE_DROP",
"UnregisteredSeiTimecode": "DISABLED",
"GopSizeUnits": "SECONDS",
"ParControl": "SPECIFIED",
"NumberBFramesBetweenReferenceFrames": 3,
"RepeatPps": "DISABLED"
}
},
"AfdSignaling": "NONE",
"DropFrameTimecode": "ENABLED",
"RespondToAfd": "NONE",
"ColorMetadata": "INSERT"
},
"AudioDescriptions": [
{
"AudioTypeControl": "FOLLOW_INPUT",
"AudioSourceName": "Audio Selector 1",
"CodecSettings": {
"Codec": "AAC",
"AacSettings": {
"AudioDescriptionBroadcasterMix": "NORMAL",
"Bitrate": 128000,
"RateControlMode": "CBR",
"CodecProfile": "LC",
"CodingMode": "CODING_MODE_2_0",
"RawFormat": "NONE",
"SampleRate": 48000,
"Specification": "MPEG4"
}
},
"LanguageCodeControl": "FOLLOW_INPUT",
"AudioType": 0
}
],
"NameModifier": "480"
}
],
"OutputGroupSettings": {
"Type": "FILE_GROUP_SETTINGS",
"FileGroupSettings": {
"Destination": "s3://XXX",
"DestinationSettings": {
"S3Settings": {
"Encryption": {
"EncryptionType": "SERVER_SIDE_ENCRYPTION_S3"
}
}
}
}
}
}
],
"AdAvailOffset": 0,
"Inputs": [
{
"AudioSelectors": {
"Audio Selector 1": {
"Offset": 0,
"DefaultSelection": "DEFAULT",
"ProgramSelection": 1
}
},
"VideoSelector": {
"ColorSpace": "FOLLOW",
"Rotate": "DEGREE_0",
"AlphaBehavior": "DISCARD"
},
"FilterEnable": "AUTO",
"PsiControl": "USE_PSI",
"FilterStrength": 0,
"DeblockFilter": "DISABLED",
"DenoiseFilter": "DISABLED",
"TimecodeSource": "EMBEDDED",
"FileInput": "s3://XXX"
}
]
},
"AccelerationSettings": {
"Mode": "DISABLED"
},
"StatusUpdateInterval": "SECONDS_60",
"Priority": 0
}';

$jobSetting = json_decode($jobSetting, true);

$result = $mediaConvertClient->createJob([
"Role" => "arn:aws:iam::XXX",
"Settings" => $jobSetting,
"Queue" => "arn:aws:mediaconvert:us-west-2:XXX:queues/Default",
"UserMetadata" => [
"Customer" => "XXX"
],
]);

Edited by: tomhendrick on Feb 22, 2021 4:49 PM

1 Answers
0
Accepted Answer

Hi,

When using the PHP SDK to configure Elemental MediaConvert jobs, you only need to specify the settings portion in the JobSettings Variable because the mediaconvert createjob function calls the other things like Queue, Role, ARN etc.

Please take a look at an example of createJob using the PHP sdk here : https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/php/example_code/mediaconvert/CreateJob.php

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions