Sha256: 5c0a273b21067da64c06ab328122a6038501b5bdfed4491993a01e43c413ef61

Contents?: true

Size: 1.42 KB

Versions: 8

Compression:

Stored size: 1.42 KB

Contents

class Transcode < XMorph::Base
  DEFAULT = "default"
  def set_profiles
    self.profiles = {
      DEFAULT => "ffmpeg -y -i %{IN} -map 0:v -map 0:a:0 -acodec libfdk_aac -profile:a aac_low -ac 2 -ar 48000 -ab 192k -vcodec libx264 -vf \"fps=fps=25\" -vf \"scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2\" -pix_fmt yuv420p -flags +ilme+ildct -top 1 -g 13 -bf 2 -profile:v high -level 4.1 -vb 15000000  -minrate:v 15000000 -maxrate:v 15000000 -muxrate 16000000 -bufsize:v 30000000  -x264opts nal-hrd=cbr -refs 6 -keyint_min 1 -aspect 16:9 -deblock -1:-1 -pes_payload_size 16 -streamid 0:2064 -streamid 1:2068 %{OUT} 2>&1",
  	}
  end

  def video_checks
    {
      ALLOWED_ASPECT_RATIO => IGNORE,
      ALLOWED_HEIGHT => IGNORE,
      ALLOWED_WIDTH => IGNORE, 
      ALLOWED_FRAME_RATE => IGNORE,
      ALLOWED_VIDEO_BIT_RATE => IGNORE, #Mbps
      ALLOWED_SCAN_TYPE => IGNORE, #all downcased
    }
  end

  def audio_checks
    {
      PRESENCE_OF_AUDIO_TRACK => VALIDATE,
      ALLOWED_NUMBER_OF_AUDIO_TRACKS => [1],
      ALLOWED_AUDIO_CODECS => ["aac"],
      ALLOWED_AUDIO_BIT_RATE => IGNORE,
      ALLOWED_NUMBER_OF_AUDIO_CHANNELS => [2],
    }
  end

  # Same  transcode rule is applied for all assets.
  def set_profile_name
    self.profile_name = DEFAULT
    XMorph::Base.logger.debug("XMorph#set_profile_name#hungama: using profile #{self.profile_name}") unless self.profile_name.nil?
    return true
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
amagi_transcode-0.1.14 lib/xmorph/customers/hungama/Hungama/transcode.rb
xmorph-0.1.14 lib/xmorph/customers/hungama/Hungama/transcode.rb
xmorph-0.1.13 lib/xmorph/customers/hungama/Hungama/transcode.rb
xmorph-0.1.11 lib/xmorph/customers/hungama/Hungama/transcode.rb
xmorph-0.1.6 lib/xmorph/customers/hungama/Hungama/transcode.rb
xmorph-0.1.5 lib/xmorph/customers/hungama/Hungama/transcode.rb
xmorph-0.1.4 lib/xmorph/customers/hungama/Hungama/transcode.rb
xmorph-0.1.3 lib/xmorph/hungama/Hungama/transcode.rb