diff --git a/lib/ffmpeg/movie.rb b/lib/ffmpeg/movie.rb index 5f4fbf7d..f428cc1e 100644 --- a/lib/ffmpeg/movie.rb +++ b/lib/ffmpeg/movie.rb @@ -100,11 +100,17 @@ 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) - 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 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