Class: Ffprober::Ffmpeg::Exec
- Inherits:
-
Object
- Object
- Ffprober::Ffmpeg::Exec
- Extended by:
- T::Sig
- Defined in:
- lib/ffprober/ffmpeg/exec.rb
Constant Summary collapse
- CHAPTER_SUPPORT =
T.let(Gem::Version.new('2.0.0'), Gem::Version)
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
Instance Method Details
#ffprobe_options ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/ffprober/ffmpeg/exec.rb', line 36 def = '-v quiet -print_format json -show_format'\ ' -show_streams -show_error' = "#{} -show_chapters" if ffprobe_version.version >= CHAPTER_SUPPORT || end |
#ffprobe_version ⇒ Object
46 47 48 |
# File 'lib/ffprober/ffmpeg/exec.rb', line 46 def ffprobe_version Ffprober::Ffmpeg::Version.new(self) end |
#ffprobe_version_output ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/ffprober/ffmpeg/exec.rb', line 25 def ffprobe_version_output @ffprobe_version_output ||= begin if @finder.path.nil? '' else `#{@finder.path} -version` end end end |
#json_output(filename) ⇒ Object
20 21 22 |
# File 'lib/ffprober/ffmpeg/exec.rb', line 20 def json_output(filename) `#{@finder.path} #{} #{Shellwords.escape(filename)}` end |