13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# 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 ([0-9.]+)/
Console.debug output
fail "#{COMMAND_NAME} version unknown"
end
version = $1
Console.info "#{$MATCH} found..."
unless version =~ /^([0-9]+)\.([0-9]+)/ and (($1.to_i * 100) + $2.to_i) >= 205
fail "#{COMMAND_NAME} version 2.5.0 or later required"
end
if output =~ /--enable-libfdk-aac/
properties[:aac_encoder] = 'libfdk_aac'
elsif output =~ /--enable-libfaac/
properties[:aac_encoder] = 'libfaac'
else
properties[:aac_encoder] = 'aac'
end
end
end
|