Module: VideoTranscoding::FFmpeg

Extended by:
FFmpeg
Included in:
FFmpeg
Defined in:
lib/video_transcoding/ffmpeg.rb

Constant Summary collapse

COMMAND_NAME =
'ffmpeg'

Instance Method Summary collapse

Instance Method Details

#aac_encoderObject



36
37
38
# File 'lib/video_transcoding/ffmpeg.rb', line 36

def aac_encoder
  Tool.properties(COMMAND_NAME)[:aac_encoder]
end

#command_nameObject



32
33
34
# File 'lib/video_transcoding/ffmpeg.rb', line 32

def command_name
  Tool.use(COMMAND_NAME)
end

#setupObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/video_transcoding/ffmpeg.rb', line 13

def setup
  Tool.provide(COMMAND_NAME, ['-version']) do |output, status, properties|
    fail "#{COMMAND_NAME} failed during execution" unless status == 0

    unless output =~ /^ffmpeg version [^ ]+/
      Console.debug output
      fail "#{COMMAND_NAME} version unknown"
    end

    Console.info "#{$MATCH} found..."

    if output =~ /--enable-libfdk-aac/
      properties[:aac_encoder] = 'libfdk_aac'
    else
      properties[:aac_encoder] = 'aac'
    end
  end
end