Using version 1.22.1 of the Ruby SDK I'm unable to set a duration on the output of a video being transcoded by the Elastic Transcoder. Based on the docs it looks like the outputs hash needs a composition array/hash containing a time_span hash with the duration. In my case I'm trying to limit it to 10 seconds.
Code sample:
transcoder = AWS::ElasticTranscoder::Client.new(
access_key_id: ENV['S3_ACCESS_KEY_ID'],
secret_access_key: ENV['S3_SECRET_ACCESS_KEY'],
region: ENV['AET_REGION']
)
transcoder.create_job(
pipeline_id: ENV['AET_PIPELINE_ID'],
input: {
key: "#{video.s3_key}",
frame_rate: 'auto',
resolution: 'auto',
aspect_ratio: 'auto',
interlaced: 'auto',
container: 'auto'
},
output: {
key: "#{video.s3_key}/web.mp4",
preset_id: '1351620000001-100070', # System preset: Web
composition: [
{
time_span: {
duration: '00:00:10.000'
}
}
]
}
)
Here's the error I get:
unexpected option :composition
Here's a link to the Ruby SDK docs on the transcoder: http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/ElasticTranscoder/Client.html#create_job-instance_method
And here are the general AWS Elastic Transcoder docs: http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/create-job.html
I'm hoping this is a syntax error and wasn't just left out of the SDK.
edit: Updated code to include initialization and composition snippet from Loren.