Sha256: 3865662ad5badbed00349e28c1ba026661948bdba93db9af61fa23433a8d0c5b

Contents?: true

Size: 759 Bytes

Versions: 2

Compression:

Stored size: 759 Bytes

Contents

module QuickTime
  # see ext/track.c for additional methods
  class Track
    # Returns the length of this track in seconds
    # using raw_duration and time_scale.
    def duration
      raw_duration.to_f/time_scale
    end
    
    # The average frame_rate for this track. May not be exact.
    def frame_rate # what about odd frame rates such as 29.97?
      frame_count/duration
    end
    
    # Returns true/false depending on if track is an audio track.
    def audio?
      media_type == :audio
    end
    
    # Returns true/false depending on if track is a video track.
    def video?
      media_type == :video
    end
    
    # Returns true/false depending on if track is a text track.
    def text?
      media_type == :text
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rmov-0.1.3 lib/quicktime/track.rb
rmov-0.1.4 lib/quicktime/track.rb