Problem: I’m creating a MediaConvert job with multiple output groups (audio and thumbnail) and trying to access the output file paths using the GetJob
command after completion. According to the AWS Documentation, the COMPLETE event should contain outputFilePaths
inside outputGroupDetails.outputDetails
, but I can’t access these paths from the GetJob response.
My initial Job Config
const jobSettings = {
Queue: process.env.MEDIACONVERT_QUEUE_ARN,
Role: process.env.MEDIACONVERT_ROLE_ARN,
StatusUpdateInterval: "SECONDS_10",
Settings: {
OutputGroups: [
{
Name: "Audio",
OutputGroupSettings: {
Type: "FILE_GROUP_SETTINGS",
FileGroupSettings: {
Destination: `s3://${process.env.BUCKET_NAME}/output/audio/`,
},
},
Outputs: [
{
ContainerSettings: {
Container: "RAW",
},
AudioDescriptions: [
{
CodecSettings: {
Codec: "MP3",
Mp3Settings: {
Bitrate: 64000,
Channels: 1,
RateControlMode: "CBR",
SampleRate: 22050,
},
},
},
],
},
],
},
{
Name: "Thumbnail",
OutputGroupSettings: {
Type: "FILE_GROUP_SETTINGS",
FileGroupSettings: {
Destination: `s3://${process.env.BUCKET_NAME}/output/thumbnails/`,
},
},
Outputs: [
{
ContainerSettings: {
Container: "RAW",
},
VideoDescription: {
CodecSettings: {
Codec: "FRAME_CAPTURE",
FrameCaptureSettings: {
MaxCaptures: 1,
Quality: 80,
},
},
},
Extension: ".jpg",
},
],
},
],
},
};
COMPLETE Job Request
const command = new GetJobCommand({ Id: 'jobId' });
mediaConvert.send(command, (err, data) => {
if (err) console.log(err, err.stack);
else {
const outputGroups = data.Job?.detail?.outputGroupDetails;
const audioPath = outputGroups?.[0]?.outputDetails?.[0]?.outputFilePaths?.[0];
const thumbnailPath = outputGroups?.[1]?.outputDetails?.[0]?.outputFilePaths?.[0];
}
});
The job completes successfully. Files are correctly created in S3 in the expected locations (output/audio/
and output/thumbnails/
). BUT outputFilePaths
is nowhere to be found in the response structure.
Questions
Is there a specific configuration needed to include outputFilePaths
in the job response or am I not deconstructing the response correctly?
Environment
- AWS SDK Version:
@aws-sdk/[email protected]
- Node.js: 18.x
- TypeScript: 5.x
- Region: us-east-1