Module: Ffprober

Defined in:
lib/ffprober.rb,
lib/ffprober/format.rb,
lib/ffprober/parser.rb,
lib/ffprober/stream.rb,
lib/ffprober/chapter.rb,
lib/ffprober/version.rb,
lib/ffprober/audio_stream.rb,
lib/ffprober/video_stream.rb,
lib/ffprober/ffprobe_version.rb

Defined Under Namespace

Classes: AudioStream, Chapter, FfprobeVersion, Format, InvalidInputFileError, Parser, Stream, VideoStream

Constant Summary collapse

VERSION =
'0.4.0'

Class Method Summary collapse

Class Method Details

.executable_nameObject



22
23
24
# File 'lib/ffprober.rb', line 22

def self.executable_name
  @executable_name ||= self.windows? ? 'ffprobe.exe' : 'ffprobe'
end

.pathObject



12
13
14
15
16
17
18
19
20
# File 'lib/ffprober.rb', line 12

def self.path
  @path ||= begin
    path = ENV['PATH'].split(File::PATH_SEPARATOR).find do |path_to_check|
      File.executable?(File.join(path_to_check, executable_name))
    end

    path && File.expand_path(executable_name, path)
  end
end

.windows?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/ffprober.rb', line 26

def self.windows?
  !!(RUBY_PLATFORM =~ /(mingw|mswin)/)
end