下記のサンプルソースで実装したのですがサムネイル作成時PNGで作成されます。
PNGがElasticTranscoderの仕様なのでしょうか?
それともどこかで変更可能なのでしょうか?
よろしくお願いします。
'use strict'; var AWS = require('aws-sdk'); var s3 = new AWS.S3({ apiVersion: '2012-09-25' }); var transcoder = new AWS.ElasticTranscoder({ apiVersion: '2012-09-25', region: 'ap-northeast-1' }); // return dirname without extensionn function dirname(path) { var p = path.split(path.sep).pop().split('.')[0]; return decodeURIComponent(p); } exports.handler = function(event, context) { console.log('Executing Elastic Transcoder Orchestrator'); var bucket = event.Records[0].s3.bucket.name; if (bucket !== 'transcoder.raw') { context.fail('Incorrect Video Input Bucket'); return; } var pipelineId = '<ElasticTranscoder Pipeline ID>'; var key = event.Records[0].s3.object.key; var dkey = dirname(key); console.log("(^-^)key"); console.log(key); console.log(dkey); var params = { Input: { Key: key, FrameRate: 'auto', Resolution: 'auto', AspectRatio: 'auto', Interlaced: 'auto', Container: 'auto', }, PipelineId: pipelineId, Outputs: [ { Key: dkey + '/600k/s', PresetId: '1351620000001-200040', // hls 600k SegmentDuration: '10' } ,{ Key: dkey + '/1M/s', PresetId: '1351620000001-200030', // hls 1M SegmentDuration: '10' } ,{ Key: dkey + '/2M/s', PresetId: '1351620000001-200010', // hls 2M SegmentDuration: '10' } ,{ Key: key, PresetId: '1351620000001-000010', //Generic 720p - mp4 ThumbnailPattern: dkey + '-{count}' } ], Playlists: [ { Name: dkey, Format: 'HLSv3', OutputKeys: [ dkey + '/600k/s', dkey + '/1M/s', dkey + '/2M/s' ] } ] }; transcoder.createJob(params, function(err, data){ if (err) { console.log(err, err.stack); context.fail(); return; } context.succeed('Job well done'); }); };
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。