Class: Ffprober::Ffmpeg::Exec
- Inherits:
-
Object
- Object
- Ffprober::Ffmpeg::Exec
- Defined in:
- lib/ffprober/ffmpeg/exec.rb
Constant Summary collapse
- CHAPTER_SUPPORT =
Gem::Version.new('2.0.0')
Instance Method Summary collapse
- #ffprobe_options ⇒ Object
- #ffprobe_version ⇒ Object
- #ffprobe_version_output ⇒ Object
-
#initialize(finder = Ffprober::Ffmpeg::Finder.new) ⇒ Exec
constructor
A new instance of Exec.
- #json_output(filename) ⇒ Object
Constructor Details
#initialize(finder = Ffprober::Ffmpeg::Finder.new) ⇒ Exec
Returns a new instance of Exec.
11 12 13 14 |
# File 'lib/ffprober/ffmpeg/exec.rb', line 11 def initialize(finder = Ffprober::Ffmpeg::Finder.new) @finder = finder @ffprobe_version_output = nil end |
Instance Method Details
#ffprobe_options ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/ffprober/ffmpeg/exec.rb', line 28 def = '-v quiet -print_format json -show_format ' \ '-show_streams -show_error' = "#{base_options} -show_chapters" if ffprobe_version.version >= CHAPTER_SUPPORT || end |
#ffprobe_version ⇒ Object
37 38 39 |
# File 'lib/ffprober/ffmpeg/exec.rb', line 37 def ffprobe_version Ffprober::Ffmpeg::Version.new(self) end |
#ffprobe_version_output ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/ffprober/ffmpeg/exec.rb', line 20 def ffprobe_version_output @ffprobe_version_output ||= if @finder.path.nil? '' else `#{@finder.path} -version` end end |
#json_output(filename) ⇒ Object
16 17 18 |
# File 'lib/ffprober/ffmpeg/exec.rb', line 16 def json_output(filename) `#{@finder.path} #{ffprobe_options} #{Shellwords.escape(filename)}` end |