0

transcoder.rb is my file in Model

class Transcoder < Gallery
 def initialize(video)
  @gallery = video
 end

 def create
  transcoder = AWS::ElasticTranscoder::Client.new(region: "Asia Pacific (Singapore)")
options = {
  pipeline_id: "id_value",
  input: { 
    key: @gallery.image,
    frame_rate: "auto", 
    resolution: 'auto', 
    aspect_ratio: 'auto', 
    interlaced: 'auto', 
    container: 'auto' 
    },
  outputs: [
    {
      key: "#{@filename}.avi", 
      preset_id: '1351620000001-000040', 
      rotate: "auto", 
      thumbnail_pattern: "{count}#{@filename}"
    }
  ],
  output_key_prefix: "#{@directory}"
}
job = transcoder.create_job(options)
@video.job_id = job.data[:job][:id]
@video.save!
 end
end

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.

Community
  • 1
  • 1
Kumar Saket
  • 93
  • 2
  • 8
  • you've presented the code. What's the problem? – tedder42 Jul 23 '15 at 00:51
  • Hey thanks for taking your time. Actually the problem with the code is that it never transcodes the video and at the same time throws no error. I'm unable to debug the code. Can you please help. – Kumar Saket Jul 23 '15 at 05:39

0 Answers0