Sha256: fa1bab2db939dd5500e261a510c8d55528740a4723819e81695c028297303c9a
Contents?: true
Size: 1.02 KB
Versions: 23
Compression:
Stored size: 1.02 KB
Contents
# frozen_string_literal: true require 'eac_ruby_utils/core_ext' require 'ehbrs_ruby_utils/executables' require 'ehbrs_ruby_utils/videos/stream' require 'json' module EhbrsRubyUtils module Videos class Container enable_simple_cache common_constructor :path do self.path = path.to_pathname end ::EhbrsRubyUtils::Videos::Stream.lists.codec_type.each_value do |stream_type| define_method stream_type.to_s.pluralize do streams.select { |stream| stream.codec_type == stream_type } end end private def probe_data_uncached ::JSON.parse( ::EhbrsRubyUtils::Executables.ffprobe.command( '-hide_banner', '-print_format', 'json', '-show_format', '-show_streams', path ).execute! ).deep_symbolize_keys.freeze end def streams_uncached probe_data.fetch(:streams).map do |stream_ffprobe_data| ::EhbrsRubyUtils::Videos::Stream.new(stream_ffprobe_data) end end end end end
Version data entries
23 entries across 23 versions & 2 rubygems