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) ⇒ Exec
constructor
A new instance of Exec.
- #json_output(filename) ⇒ Object
Constructor Details
#initialize(finder = Ffprober::Ffmpeg::Finder) ⇒ Exec
10 11 12 |
# File 'lib/ffprober/ffmpeg/exec.rb', line 10 def initialize(finder = Ffprober::Ffmpeg::Finder) @finder = finder end |
Instance Method Details
#ffprobe_options ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/ffprober/ffmpeg/exec.rb', line 28 def = '-v quiet -print_format json -show_format'\ ' -show_streams -show_error' if ffprobe_version.version >= CHAPTER_SUPPORT = + ' -show_chapters' end end |
#ffprobe_version ⇒ Object
39 40 41 |
# File 'lib/ffprober/ffmpeg/exec.rb', line 39 def ffprobe_version Ffprober::Ffmpeg::Version.new(self) end |
#ffprobe_version_output ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/ffprober/ffmpeg/exec.rb', line 18 def ffprobe_version_output @ffprobe_version_output ||= begin if @finder.path.nil? '' else `#{@finder.path} -version` end end end |
#json_output(filename) ⇒ Object
14 15 16 |
# File 'lib/ffprober/ffmpeg/exec.rb', line 14 def json_output(filename) `#{@finder.path} #{ffprobe_options} #{Shellwords.escape(filename)}` end |