There is no native method in AWS Elemental MediaConvert for setting a relative path for the output based on the location of the input, however you are right in that you can override parameters from a template without needing to define the entire job from scratch.
For instance, here's an AWS CLI (boto3) JSON example of submitting job using a template that does not reference presets.
Notes: This template contains an input array object (notice there is not a FileURI parameter, you will add this on job create)
{
"Queue": "arn:aws:mediaconvert:us-west-2:111122223333:queues/Default",
"Name": "Test_MP4",
"Description":"Test MP4"
"Settings": {
"OutputGroups": [
{
"Name": "File Group",
"Outputs": [
{
"ContainerSettings": {
"Container": "MP4",
"Mp4Settings": {
"CslgAtom": "EXCLUDE",
"FreeSpaceBox": "EXCLUDE",
"MoovPlacement": "NORMAL"
}
},
"VideoDescription": {
"Width": 3840,
"ScalingBehavior": "DEFAULT",
"Height": 2160,
"VideoPreprocessors": {
"Deinterlacer": {
"Algorithm": "INTERPOLATE",
"Mode": "DEINTERLACE",
"Control": "NORMAL"
}
},
"TimecodeInsertion": "DISABLED",
"AntiAlias": "ENABLED",
"Sharpness": 50,
"CodecSettings": {
"Codec": "H_265",
"H265Settings": {
"InterlaceMode": "PROGRESSIVE",
"ParNumerator": 1,
"NumberReferenceFrames": 3,
"FramerateDenominator": 1001,
"GopClosedCadence": 1,
"AlternateTransferFunctionSei": "DISABLED",
"HrdBufferInitialFillPercentage": 90,
"GopSize": 48,
"Slices": 4,
"GopBReference": "ENABLED",
"HrdBufferSize": 20000000,
"SlowPal": "DISABLED",
"ParDenominator": 1,
"SpatialAdaptiveQuantization": "ENABLED",
"TemporalAdaptiveQuantization": "ENABLED",
"FlickerAdaptiveQuantization": "DISABLED",
"Bitrate": 10000000,
"FramerateControl": "SPECIFIED",
"RateControlMode": "CBR",
"CodecProfile": "MAIN_MAIN",
"Tiles": "ENABLED",
"Telecine": "NONE",
"FramerateNumerator": 24000,
"MinIInterval": 0,
"AdaptiveQuantization": "HIGH",
"CodecLevel": "LEVEL_5",
"SceneChangeDetect": "ENABLED",
"QualityTuningLevel": "MULTI_PASS_HQ",
"FramerateConversionAlgorithm": "DUPLICATE_DROP",
"UnregisteredSeiTimecode": "DISABLED",
"GopSizeUnits": "FRAMES",
"ParControl": "SPECIFIED",
"NumberBFramesBetweenReferenceFrames": 3,
"TemporalIds": "DISABLED",
"SampleAdaptiveOffsetFilterMode": "ADAPTIVE"
}
},
"AfdSignaling": "NONE",
"DropFrameTimecode": "ENABLED",
"RespondToAfd": "NONE",
"ColorMetadata": "INSERT"
},
"AudioDescriptions": [
{
"AudioTypeControl": "FOLLOW_INPUT",
"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": "_1"
}
],
"OutputGroupSettings": {
"Type": "FILE_GROUP_SETTINGS",
"FileGroupSettings": {
"Destination": "s3://myawsbucket/out/"
}
}
}
],
"AdAvailOffset": 0,
"Inputs": [
{
"AudioSelectors": {
"Audio Selector 1": {
"Offset": 0,
"DefaultSelection": "DEFAULT",
"ProgramSelection": 1
}
},
"VideoSelector": {
"ColorSpace": "FOLLOW"
},
"FilterEnable": "AUTO",
"PsiControl": "USE_PSI",
"FilterStrength": 0,
"DeblockFilter": "DISABLED",
"DenoiseFilter": "DISABLED",
"TimecodeSource": "EMBEDDED"
}
]
}
}
The following JSON payload adds an input and a caption selector on input as well as a caption track to the output, and it changes the destination location for the output file.
Note: You will need to make sure to include you job template name as well as the role you want the service to assume (i.e. what you set up in Setting up using IAM)
{
"Settings": {
"OutputGroups": [
{
"Name": "File Group",
"Outputs": [
{
"CaptionDescriptions": [
{
"DestinationSettings": {
"DestinationType": "EMBEDDED"
},
"CaptionSelectorName": "Captions Selector 1",
"LanguageCode": "ENG"
}
]
}
],
"OutputGroupSettings": {
"Type": "FILE_GROUP_SETTINGS",
"FileGroupSettings": {
"Destination": "s3://myawsbucket/newfolder/out/"
}
}
}
],
"AdAvailOffset": 0,
"Inputs": [
{
"AudioSelectors": {
"Audio Selector 1": {
"Offset": 0,
"DefaultSelection": "DEFAULT",
"ProgramSelection": 1
}
},
"VideoSelector": {
"ColorSpace": "FOLLOW"
},
"FilterEnable": "AUTO",
"PsiControl": "USE_PSI",
"FilterStrength": 0,
"DeblockFilter": "DISABLED",
"DenoiseFilter": "DISABLED",
"TimecodeSource": "EMBEDDED",
"FileInput": "s3://myawsbucket/input/test.mp4",
"CaptionSelectors": {
"Captions Selector 1": {
"SourceSettings": {
"SourceType": "SCC",
"FileSourceSettings": {
"SourceFile": "s3://myawsbucket/input/Captions/SCC/test.scc"
}
}
}
}
}
]
},
"JobTemplate": "Test_MP4",
"Role": "arn:aws:iam::111122223333:role/MediaConvertRole"
}
To only change the destination, you would use this JSON:
{
"Settings": {
"OutputGroups": [
{
"OutputGroupSettings": {
"Type": "FILE_GROUP_SETTINGS",
"FileGroupSettings": {
"Destination": "s3://myawsbucket/newfolder/out/"
}
}
}
],
"Inputs": [
{
"FileInput": "s3://myawsbucket/input/test.mp4"
}
]
},
"JobTemplate": "Test_MP4",
"Role": "arn:aws:iam::111122223333:role/MediaConvertRole"
}