Acceleration mode causes side effects
See original GitHub issuehi there,
I am using Video On Demand on AWS . (https://github.com/awslabs/video-on-demand-on-aws#source-code, https://aws.amazon.com/solutions/video-on-demand-on-aws/)
When we have jobs running in Acceleration mode ENABLED/PREFERRED with have the following two side effects.
- Thumbnail URLs not generated
It was noted that for jobs that run with Acceleration there is no thumbnail URL information in Dynamodb table used by VOD solution. However in the destination S3 bucket the thumbnail folders and thumbnails itself seem to be getting generated correctly.
Is there a quick fix you can do / suggest so that dynamoDB table entry used by VOD will contain the correct URL for thumbnail information ?
- Status updates SNS message information seems to be incorrect
We have configured status update interval to SECONDS_10 . With no acceleration we get updates on regular intervals with progress such as 10%, 30%, 55%, 75%i, 80%, 100% etc
However with acceleration enabled the updates we get contain the first value for a long period e.g: 5%, 5%, 5%, 5%… 100% (basically you see 5% and then 100%). When we log on to AWS MediaConvert console directly and continue to monitor job progress (by refreshing screen continuously) the job status shown is identical to the progress updates we get ( stays at around 5% for a long time and thereafter skips directly to 100%). Is this a issue on AWS VOD solution or AWS media convert itself ? Can you suggest any work around
Additional information: We are using Custom Job templates on AWS MediaConvert. We have been told that currently there is a known issue where when submitting jobs via AWS VOD solution the template settings such as Acceleration will not work correctly.
Therefore to get Acceleration working with custom templates we were asked to modify the VOD code as below. In the below search for comments “// Christer’s fix”
Thanks
Sam
/*******************************************************************************
- Copyright 2019 Amazon.com, Inc. and its affiliates. All Rights Reserved.
- Licensed under the Amazon Software License (the “License”).
- You may not use this file except in compliance with the License.
- A copy of the License is located at
- http://aws.amazon.com/asl/
- or in the “license” file accompanying this file. This file is distributed
- on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- express or implied. See the License for the specific language governing
- permissions and limitations under the License.
********************************************************************************/
const AWS = require(‘aws-sdk’); const error = require(‘./lib/error.js’);
//fix patch const _ = require(‘lodash’);
const applySettingsIfNeeded = (isCustomTemplate, originalGroup, customGroup) => { if (isCustomTemplate) { return _.merge({}, originalGroup, customGroup); }
return originalGroup; }; //fix patch
exports.handler = async (event) => { console.log('REQUEST:: ', JSON.stringify(event, null, 2));
const mediaconvert = new AWS.MediaConvert({ endpoint: process.env.EndPoint });
try { // define paths: let inputPath = ‘s3://’ + event.srcBucket + ‘/’ + event.srcVideo; let outputPath = ‘s3://’ + event.destBucket + ‘/’ + event.guid;
// Baseline for the job parameters
let job = {
"JobTemplate": event.jobTemplate,
"Role": process.env.MediaConvertRole,
"UserMetadata": {
"guid": event.guid,
"workflow": event.workflowName,
"Qvbr": process.env.Qvbr
},
// Christer's fix
"StatusUpdateInterval": "SECONDS_10",
"AccelerationSettings": {
// "Mode": "PREFERRED"
"Mode": "ENABLED"
// "Mode": "DISABLED"
},
"Settings": {
// Christer's fix
"TimecodeConfig": {
"Source": "ZEROBASED"
},
"Inputs": [{
"AudioSelectors": {
"Audio Selector 1": {
"Offset": 0,
"DefaultSelection": "NOT_DEFAULT",
"ProgramSelection": 1,
"SelectorType": "TRACK",
"Tracks": [
1
]
}
},
"VideoSelector": {
"ColorSpace": "FOLLOW"
},
"FilterEnable": "AUTO",
"PsiControl": "USE_PSI",
"FilterStrength": 0,
"DeblockFilter": "DISABLED",
"DenoiseFilter": "DISABLED",
// Christer's fix
//"TimecodeSource": "EMBEDDED",
"TimecodeSource": "ZEROBASED",
"FileInput": inputPath,
}],
"OutputGroups": []
}
};
let mp4 = {
"Name": "File Group",
"OutputGroupSettings": {
"Type": "FILE_GROUP_SETTINGS",
"FileGroupSettings": {
"Destination": outputPath + '/mp4/',
}
},
"Outputs": []
};
let hls = {
"Name": "HLS Group",
"OutputGroupSettings": {
"Type": "HLS_GROUP_SETTINGS",
"HlsGroupSettings": {
"SegmentLength": 5,
"MinSegmentLength": 0,
"Destination": outputPath + '/hls/',
}
},
"Outputs": []
};
let dash = {
"Name": "DASH ISO",
"OutputGroupSettings": {
"Type": "DASH_ISO_GROUP_SETTINGS",
"DashIsoGroupSettings": {
"SegmentLength": 30,
"FragmentLength": 3,
"Destination": outputPath + '/dash/',
}
},
"Outputs": []
};
let cmaf = {
"Name": "CMAF",
"OutputGroupSettings": {
"Type": "CMAF_GROUP_SETTINGS",
"CmafGroupSettings": {
"SegmentLength": 30,
"FragmentLength": 3,
"Destination": outputPath + '/cmaf/',
}
},
"Outputs": []
};
let mss = {
"Name": "MS Smooth",
"OutputGroupSettings": {
"Type": "MS_SMOOTH_GROUP_SETTINGS",
"MsSmoothGroupSettings": {
"FragmentLength": 2,
"ManifestEncoding": "UTF8",
"Destination": outputPath + '/mss/',
}
},
"Outputs": []
};
let frameCapture = {
"CustomName": "Frame Capture",
"Name": "File Group",
"OutputGroupSettings": {
"Type": "FILE_GROUP_SETTINGS",
"FileGroupSettings": {
"Destination": outputPath + "/thumbnails/"
}
},
"Outputs": [{
"NameModifier": "_tumb",
"ContainerSettings": {
"Container": "RAW"
},
"VideoDescription": {
"ColorMetadata": "INSERT",
"AfdSignaling": "NONE",
"Sharpness": 100,
"Height": event.frameHeight,
"RespondToAfd": "NONE",
"TimecodeInsertion": "DISABLED",
"Width": event.frameWidth,
"ScalingBehavior": "DEFAULT",
"AntiAlias": "ENABLED",
"CodecSettings": {
"FrameCaptureSettings": {
"MaxCaptures": 10000000,
"Quality": 80,
"FramerateDenominator": 5,
"FramerateNumerator": 1
},
"Codec": "FRAME_CAPTURE"
},
"DropFrameTimecode": "ENABLED"
}
}]
};
let params = {
Name: event.jobTemplate
};
let tmpl = await mediaconvert.getJobTemplate({
Name: event.jobTemplate
}).promise();
console.log(`TEMPLATE:: ${JSON.stringify(tmpl, null, 2)}`);
tmpl.JobTemplate.Settings.OutputGroups.forEach(group => {
let found = false,
defaultGroup = {};
if (group.OutputGroupSettings.Type === 'FILE_GROUP_SETTINGS') {
found = true;
defaultGroup = mp4;
}
if (group.OutputGroupSettings.Type === 'HLS_GROUP_SETTINGS') {
found = true;
defaultGroup = hls;
}
if (group.OutputGroupSettings.Type === 'DASH_ISO_GROUP_SETTINGS') {
found = true;
defaultGroup = dash;
}
if (group.OutputGroupSettings.Type === 'MS_SMOOTH_GROUP_SETTINGS') {
found = true;
defaultGroup = mss;
}
if (group.OutputGroupSettings.Type === 'CMAF_GROUP_SETTINGS') {
found = true;
defaultGroup = cmaf;
}
if (found) {
console.log(`${group.Name} found in Job Template`);
const outputGroup = applySettingsIfNeeded(event.isCustomTemplate, defaultGroup, group);
job.Settings.OutputGroups.push(outputGroup);
}
});
// let tmpl = await mediaconvert.getJobTemplate(params).promise();
// // OutputGroupSettings:Type is required and must be one of the following
// // HLS_GROUP_SETTINGS | DASH_ISO_GROUP_SETTINGS | FILE_GROUP_SETTINGS | MS_SMOOTH_GROUP_SETTINGS | CMAF_GROUP_SETTINGS,
// // Using this to determing the output types in the the job Template
// tmpl.JobTemplate.Settings.OutputGroups.forEach(function(output) {
// if (output.OutputGroupSettings.Type === 'FILE_GROUP_SETTINGS') {
// console.log(output.Name, ' found in Job Template');
// job.Settings.OutputGroups.push(mp4);
// }
// if (output.OutputGroupSettings.Type === 'HLS_GROUP_SETTINGS') {
// console.log(output.Name, ' found in Job Template');
// job.Settings.OutputGroups.push(hls);
// }
// if (output.OutputGroupSettings.Type === 'DASH_ISO_GROUP_SETTINGS') {
// console.log(output.Name, ' found in Job Template');
// job.Settings.OutputGroups.push(dash);
// }
// if (output.OutputGroupSettings.Type === 'MS_SMOOTH_GROUP_SETTINGS') {
// console.log(output.Name, ' found in Job Template');
// job.Settings.OutputGroups.push(mss);
// }
// if (output.OutputGroupSettings.Type === 'CMAF_GROUP_SETTINGS') {
// console.log(output.Name, ' found in Job Template');
// job.Settings.OutputGroups.push(cmaf);
// }
// });
if (event.frameCapture) {
job.Settings.OutputGroups.push(frameCapture);
}
let data = await mediaconvert.createJob(job).promise();
event.encodingJob = job;
event.ecodeJobId = data.Job.Id;
console.log(JSON.stringify(data, null, 2));
} catch (err) { console.log(err); await error.handler(event, err); throw err; } return event; };
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Thanks for the update Daniel,
I have the AWS Support team working on the ticket I opened related to MediaConvert sending incorrect SNS updates with acceleration mode enabled (issue 2 of my original posting).
I have brought to their attention your finding; and based on their feedback I will open a 2nd support ticket with them if needed.
Regards,
Sam
Addressed with version v5.1.0