def execute(task, options = {})
      t1 = Time.now
      
      if @input_file.nil?
        @input_file = options[:input_file]
      end
      
      Transcoder.logger.info("\nNew transcoder job\n================\nTask: #{task}\nOptions: #{options.inspect}")
      parse_and_execute(task, options)      
      @processed = Inspector.new(:file => options[:output_file])
      result = check_integrity
      Transcoder.logger.info("\nFinished task. Total errors: #{@errors.size}\n")
      @total_time = Time.now - t1
      result
    rescue TranscoderError => e
      raise e
    rescue Exception => e
      Transcoder.logger.error("[ERROR] Unhandled RVideo exception: #{e.class} - #{e.message}\n#{e.backtrace}")
      raise TranscoderError::UnknownError, "Unexpected RVideo error: #{e.message} (#{e.class})", e.backtrace
    end
def execute(task, options = {})
      t1 = Time.now
      
      if @input_file.nil?
        @input_file = options[:input_file]
      end
      
      Transcoder.logger.info("\nNew transcoder job\n================\nTask: #{task}\nOptions: #{options.inspect}")
      parse_and_execute(task, options)      
      @processed = Inspector.new(:file => options[:output_file])
      result = check_integrity
      Transcoder.logger.info("\nFinished task. Total errors: #{@errors.size}\n")
      @total_time = Time.now - t1
      result
    rescue TranscoderError => e
      raise e
    rescue Exception => e
      Transcoder.logger.error("[ERROR] Unhandled RVideo exception: #{e.class} - #{e.message}\n#{e.backtrace}")
      raise TranscoderError::UnknownError, "Unexpected RVideo error: #{e.message} (#{e.class})", e.backtrace
    end
Requires a command and a hash of various interpolated options. The
 command should be one or more lines of transcoder tool commands (e.g.
 ffmpeg, flvtool2). Interpolate options by adding $option_key$ to the
 recipe, and passing :option_key => "value" in the options hash.

   recipe = "ffmpeg -i $input_file$ -ar 22050 -ab 64 -f flv -r 29.97
   recipe += "-s $resolution$ -y $output_file$"
   recipe += "\nflvtool2 -U $output_file$"

   transcoder = RVideo::Transcoder.new("/path/to/input.mov")
   begin
     transcoder.execute(recipe, {:output_file => "/path/to/output.flv", :resolution => "320x240"})
   rescue TranscoderError => e
     puts "Unable to transcode file: #{e.class} - #{e.message}"
   end