Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/ffmpeg/movie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/ffmpeg/transcoder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ module FFMPEG
class Transcoder
@@timeout = 30

attr_reader :output

def self.timeout=(time)
@@timeout = time
end
Expand Down