Sha256: eabe9d71682a13daf44dea2cced4d40c56bc6de91a90cd915f66f213148871eb

Contents?: true

Size: 764 Bytes

Versions: 11

Compression:

Stored size: 764 Bytes

Contents

module Tlapse
  class Video
    attr_accessor *%i(size framerate codec outfile)

    def initialize(opts)
      @size      = opts.fetch :size,      "1920x1080"
      @framerate = opts.fetch :framerate, "60"
      @codec     = opts.fetch :codec,     "libx264"
      @outfile   = opts.fetch :out,       "out.mkv"
    end

    def create!
      command = "ffmpeg"
      command += " -pattern_type glob"
      command += " -i '*.jpg'"
      command += " -s #{@size}"
      command += " -r #{@framerate}"
      command += " -vcodec #{@codec}"
      command += " #{@outfile}"
      puts command
      exec command
    end

    ##
    # @return whether the output file already exists
    def outfile_exists?
      File.exist? @outfile
    end

  end # Video
end # Tlapse

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
tlapse-0.6.2 lib/tlapse/video.rb
tlapse-0.6.1 lib/tlapse/video.rb
tlapse-0.6.0 lib/tlapse/video.rb
tlapse-0.5.1 lib/tlapse/video.rb
tlapse-0.5.0 lib/tlapse/video.rb
tlapse-0.4.1 lib/tlapse/video.rb
tlapse-0.4.0 lib/tlapse/video.rb
tlapse-0.3.3 lib/tlapse/video.rb
tlapse-0.3.2 lib/tlapse/video.rb
tlapse-0.3.1 lib/tlapse/video.rb
tlapse-0.3.0 lib/tlapse/video.rb