Sha256: 59b0ec0c43de44ed3c6b62476d1709c9f92cea3e7d8175bf4846d27f53b7c612

Contents?: true

Size: 577 Bytes

Versions: 15

Compression:

Stored size: 577 Bytes

Contents

#
# Implementes MetaInfo Interface for FFmpeg
#

# MetaInformation = Struct.new(:duration, :bit_rate, :size, :format, :extension, :raw)

require_relative '../time_index'

module VCSRuby
  class FFmpegMetaInfo
    attr_reader :raw

    def initialize meta_info
      @raw = meta_info
    end

    def duration
      TimeIndex.new(@raw['duration'].to_f)
    end

    def bit_rate
      @raw['bit_rate'].to_i
    end

    def size
      @raw['size'].to_i
    end

    def format
      @raw['format_long_name']
    end

    def extension
      @raw['format_name']
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
vcs_ruby-1.1.16 lib/FFmpeg/ffmpeg_meta_info.rb
vcs_ruby-1.1.15 lib/FFmpeg/ffmpeg_meta_info.rb
vcs_ruby-1.1.14 lib/FFmpeg/ffmpeg_meta_info.rb
vcs_ruby-1.1.13 lib/FFmpeg/ffmpeg_meta_info.rb
vcs_ruby-1.1.12 lib/FFmpeg/ffmpeg_meta_info.rb
vcs_ruby-1.1.11 lib/FFmpeg/ffmpeg_meta_info.rb
vcs_ruby-1.1.10 lib/FFmpeg/ffmpeg_meta_info.rb
vcs_ruby-1.1.8 lib/FFmpeg/ffmpeg_meta_info.rb
vcs_ruby-1.1.7 lib/FFmpeg/ffmpeg_meta_info.rb
vcs_ruby-1.1.6 lib/FFmpeg/ffmpeg_meta_info.rb
vcs_ruby-1.1.5 lib/FFmpeg/ffmpeg_meta_info.rb
vcs_ruby-1.1.4 lib/FFmpeg/ffmpeg_meta_info.rb
vcs_ruby-1.1.3 lib/FFmpeg/ffmpeg_meta_info.rb
vcs_ruby-1.1.2 lib/FFmpeg/ffmpeg_meta_info.rb
vcs_ruby-1.1.0 lib/FFmpeg/ffmpeg_meta_info.rb