title: I am using elastic trans-coding by AWS for transcoding a video into different versions but I'm not able to achieve the task, Below is my code
body: <h1>transcoder.rb is my file in Model</h1>
  <pre><code>class Transcoder &lt; Gallery
   def initialize(video)
    @gallery = video
   end
  
   def create
    transcoder = AWS::ElasticTranscoder::Client.new(region: &quot;Asia Pacific (Singapore)&quot;)
  options = {
    pipeline_id: &quot;id_value&quot;,
    input: { 
      key: @gallery.image,
      frame_rate: &quot;auto&quot;, 
      resolution: 'auto', 
      aspect_ratio: 'auto', 
      interlaced: 'auto', 
      container: 'auto' 
      },
    outputs: [
      {
        key: &quot;#{@filename}.avi&quot;, 
        preset_id: '1351620000001-000040', 
        rotate: &quot;auto&quot;, 
        thumbnail_pattern: &quot;{count}#{@filename}&quot;
      }
    ],
    output_key_prefix: &quot;#{@directory}&quot;
  }
  job = transcoder.create_job(options)
  @video.job_id = job.data[:job][:id]
  @video.save!
   end
  end
  </code></pre>
  <p>And I am calling up the create method of Transcoder class in my create method of controller upon the action @gallery.save. Please note that here Gallery is the model which stores all the details about the video being uploaded to aws s3 bucket.</p>