lib/ffmpeg/transcoder.rb in streamio-ffmpeg-1.0.0 vs lib/ffmpeg/transcoder.rb in streamio-ffmpeg-2.0.0
- old
+ new
@@ -40,11 +40,11 @@
return nil
end
end
def encoding_succeeded?
- @errors << "no output file created" and return false unless File.exists?(@output_file)
+ @errors << "no output file created" and return false unless File.exist?(@output_file)
@errors << "encoded file is invalid" and return false unless encoded.valid?
true
end
def encoded
@@ -56,10 +56,10 @@
def transcode_movie
@command = "#{FFMPEG.ffmpeg_binary} -y -i #{Shellwords.escape(@movie.path)} #{@raw_options} #{Shellwords.escape(@output_file)}"
FFMPEG.logger.info("Running transcoding...\n#{@command}\n")
@output = ""
- Open3.popen3(@command) do |stdin, stdout, stderr, wait_thr|
+ Open3.popen3(@command) do |_stdin, _stdout, stderr, wait_thr|
begin
yield(0.0) if block_given?
next_line = Proc.new do |line|
fix_encoding(line)
@output << line