I want to create an ElasticTranscoder Job via Lambda (NodeJS).
It works fine if I define one input (see below). But I have several source files. If I modify my coding, so that the input is an array, I'll get errors.
Can someone help me?
This works fine:
transcoder.createJob({
PipelineId: '12345678-vsyssc',
Input: {
Key: fileName,
FrameRate: 'auto',
Resolution: 'auto',
AspectRatio: 'auto',
Interlaced: 'auto',
Container: 'auto'
},
Output: {
Key: 'Output.mp4',
ThumbnailPattern: '',
PresetId: '1351620000001-000030',
Rotate: 'auto'
}
}, function (err, data) {
if (err) {
console.log('Something went wrong:', err)
} else {
console.log('Converting is done');
}
callback(err, data);
});
This doesnt work:
transcoder.createJob({
PipelineId: '12345678-vsyssc',
Input: [{
Key: 'VID-20180217-WA0002.mp4',
FrameRate: 'auto',
Resolution: 'auto',
AspectRatio: 'auto',
Interlaced: 'auto',
Container: 'auto'
}, {
Key: 'VID-20180411-WA0012.mp4',
FrameRate: 'auto',
Resolution: 'auto',
AspectRatio: 'auto',
Interlaced: 'auto',
Container: 'auto'
},
],
Output: {
Key: 'test123445.mp4',
ThumbnailPattern: '',
PresetId: '1351620000001-000030',
Rotate: 'auto'
}
}, function (err, data) {
if (err) {
console.log('Something went wrong:', err)
} else {
console.log('Converting is done');
}
callback(err, data);
});
i get the Error:
- UnexpectedParameter: Unexpected key '1' found in params.Input at ParamValidator.validate (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\param_validator.js:40:28) at Request.VALIDATE_PARAMETERS (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\event_listeners.js:125:42) at Request.callListeners (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\sequential_executor.js:105:20) at callNextListener (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\sequential_executor.js:95:12) at C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\event_listeners.js:85:9 at finish (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\config.js:315:7) at C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\config.js:333:9 at SharedIniFileCredentials.get (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\credentials.js:126:7) at getAsyncCredentials (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\config.js:327:24) at Config.getCredentials (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\config.js:347:9) message: 'There were 2 validation errors:\n* UnexpectedParameter: Unexpected key \'0\' found in params.Input\n* UnexpectedParameter: Unexpected key \'1\' found in params.Input', code: 'MultipleValidationErrors', errors: [ { UnexpectedParameter: Unexpected key '0' found in params.Input at ParamValidator.fail (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\param_validator.js:50:37) at ParamValidator.validateStructure (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\param_validator.js:77:14) at ParamValidator.validateMember (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\param_validator.js:88:21) at ParamValidator.validateStructure (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\param_validator.js:75:14) at ParamValidator.validateMember (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\param_validator.js:88:21) at ParamValidator.validate (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\param_validator.js:34:10) at Request.VALIDATE_PARAMETERS (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\event_listeners.js:125:42) at Request.callListeners (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\sequential_executor.js:105:20) at callNextListener (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\sequential_executor.js:95:12) at C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\event_listeners.js:85:9 message: 'Unexpected key \'0\' found in params.Input', code: 'UnexpectedParameter', time: 2018-06-10T11:39:59.749Z }, { UnexpectedParameter: Unexpected key '1' found in params.Input at ParamValidator.fail (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\param_validator.js:50:37) at ParamValidator.validateStructure (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\param_validator.js:77:14) at ParamValidator.validateMember (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\param_validator.js:88:21) at ParamValidator.validateStructure (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\param_validator.js:75:14) at ParamValidator.validateMember (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\param_validator.js:88:21) at ParamValidator.validate (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\param_validator.js:34:10) at Request.VALIDATE_PARAMETERS (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\event_listeners.js:125:42) at Request.callListeners (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\sequential_executor.js:105:20) at callNextListener (C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\sequential_executor.js:95:12) at C:\Users\Volkm\Google Drive\Quellcode\nodejs\ElasticTranscoderJob\test\node_modules\aws-sdk\lib\event_listeners.js:85:9 message: 'Unexpected key \'1\' found in params.Input', code: 'UnexpectedParameter', time: 2018-06-10T11:39:59.749Z } ], time: 2018-06-10T11:39:59.749Z }
Kind Regards Stefan