I have a Lambda function setup that successfully creates an Elastic Transcoding job to transcode an m4v to a GIF. However, I need to reduce the file size of the ouptut GIF by both reducing the size of the content, and using fewer frames.
I have read through the documentation here: http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/preset-settings.html http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/create-job.html
but I can't find any settings that work for GIFs that will downscale the content or allow me to change the framerate.
I tried using Width
, Height
, and Resolution
but they all gave me errors that said: UnexpectedParameter: Unexpected key
How can I change the size and framerate of the output?
Here is the code that runs successfully:
var params = {
Input: {
Key: key
},
PipelineId: 'xxxx',
Outputs: [
{
Key: outputKey(basename(key),'gif'),
PresetId: '1351620000001-100200', // GIF (Animated)
Composition: [
{
TimeSpan: {
Duration: '00:00:03.000'
}
}
]
}
]
};
To change these settings, you need to create a new Preset
GIF (Animated)
preset, select it and click 'Copy'PresetId
value in your output to match your new preset's id