Sha256: 4dc0b11c6dc56ac597f0a5a63ccecad7e13e83b30651f8026f62c2e121b4646e

Contents?: true

Size: 931 Bytes

Versions: 29

Compression:

Stored size: 931 Bytes

Contents

module FormatParser
  class Video
    include FormatParser::AttributesJSON

    NATURE = :video

    attr_accessor :width_px

    attr_accessor :height_px

    attr_accessor :frame_rate

    # Type of the file (e.g :mp3)
    attr_accessor :format

    attr_accessor :codecs

    # Duration of the media object (be it audio or video) in seconds,
    # as a Float
    attr_accessor :media_duration_seconds

    # Duration of the media object in addressable frames or samples,
    # as an Integer
    attr_accessor :media_duration_frames

    # If a parser wants to provide any extra information to the caller
    # it can be placed here
    attr_accessor :intrinsics

    # The MIME type of the video
    attr_accessor :content_type

    # Only permits assignments via defined accessors
    def initialize(**attributes)
      attributes.map { |(k, v)| public_send("#{k}=", v) }
    end

    def nature
      NATURE
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
format_parser-2.10.0 lib/video.rb
format_parser-2.9.0 lib/video.rb
format_parser-2.8.0 lib/video.rb
format_parser-2.7.2 lib/video.rb
format_parser-2.7.1 lib/video.rb
format_parser-2.7.0 lib/video.rb
format_parser-2.6.0 lib/video.rb
format_parser-2.5.0 lib/video.rb
format_parser-2.4.5 lib/video.rb
format_parser-2.4.4 lib/video.rb
format_parser-2.4.3 lib/video.rb
format_parser-2.3.0 lib/video.rb
format_parser-2.2.1 lib/video.rb
format_parser-2.2.0 lib/video.rb
format_parser-2.1.0 lib/video.rb
format_parser-2.0.0 lib/video.rb
format_parser-2.0.0.pre.4 lib/video.rb
format_parser-2.0.0.pre.3 lib/video.rb
format_parser-2.0.0.pre.2 lib/video.rb
format_parser-2.0.0.pre lib/video.rb