From a6baea62b1184f1e9f46c868714870e0b687819a Mon Sep 17 00:00:00 2001 From: Cristian Rasch Date: Sat, 12 Apr 2014 09:48:17 -0300 Subject: [PATCH 1/2] Make the FFMPEG stdout log accessible. --- lib/ffmpeg/movie.rb | 7 ++++++- lib/ffmpeg/transcoder.rb | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ffmpeg/movie.rb b/lib/ffmpeg/movie.rb index 5f4fbf7d..e5c3815e 100644 --- a/lib/ffmpeg/movie.rb +++ b/lib/ffmpeg/movie.rb @@ -100,7 +100,12 @@ def frame_rate end def transcode(output_file, options = EncodingOptions.new, transcoder_options = {}, &block) - Transcoder.new(self, output_file, options, transcoder_options).run &block + @transcoder = Transcoder.new(self, output_file, options, transcoder_options) + @transcoder.run &block + end + + def transcoder_output + @transcoder.output if @transcoder end def screenshot(output_file, options = EncodingOptions.new, transcoder_options = {}, &block) diff --git a/lib/ffmpeg/transcoder.rb b/lib/ffmpeg/transcoder.rb index 1d27f899..3ffa4ee2 100644 --- a/lib/ffmpeg/transcoder.rb +++ b/lib/ffmpeg/transcoder.rb @@ -5,6 +5,8 @@ module FFMPEG class Transcoder @@timeout = 30 + attr_reader :output + def self.timeout=(time) @@timeout = time end From 779c903ce7a4570774299b1a1f5623c6af4c3edb Mon Sep 17 00:00:00 2001 From: Cristian Rasch Date: Wed, 30 Apr 2014 18:14:55 -0300 Subject: [PATCH 2/2] Also make the screenshot output available --- lib/ffmpeg/movie.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ffmpeg/movie.rb b/lib/ffmpeg/movie.rb index e5c3815e..f428cc1e 100644 --- a/lib/ffmpeg/movie.rb +++ b/lib/ffmpeg/movie.rb @@ -109,7 +109,8 @@ def transcoder_output end def screenshot(output_file, options = EncodingOptions.new, transcoder_options = {}, &block) - Transcoder.new(self, output_file, options.merge(screenshot: true), transcoder_options).run &block + @transcoder = Transcoder.new(self, output_file, options.merge(screenshot: true), transcoder_options) + @transcoder.run &block end protected