Sha256: dbff7b40bc2c1ceedbaacf1b9a6b9ce6d87161ca6ab8ef131313615ea7e56c00

Contents?: true

Size: 576 Bytes

Versions: 4

Compression:

Stored size: 576 Bytes

Contents

require "shellwords"

module Ffprober
  class Parser
    def self.from_file(file_to_parse)
      unless FfprobeVersion.valid?
        fail ArgumentError.new("no or unsupported ffprobe version found. (version: #{Ffprober::Ffmpeg::Version.new})")
      end

      file_parser = Ffprober::Parsers::File.new(file_to_parse)
      json_parser = file_parser.load
      Ffprober::Wrapper.new(json_parser.json)
    end

    def self.from_json(json_to_parse)
      json_parser = Ffprober::Parsers::Json.new(json_to_parse)
      Ffprober::Wrapper.new(json_parser.json)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ffprober-0.4.6 lib/ffprober/parser.rb
ffprober-0.4.5 lib/ffprober/parser.rb
ffprober-0.4.4 lib/ffprober/parser.rb
ffprober-0.4.3 lib/ffprober/parser.rb