Sha256: 317f553373c0d79b3bab31fd29127e2133370db19cc5fb822c94af6b6c048cbc

Contents?: true

Size: 642 Bytes

Versions: 3

Compression:

Stored size: 642 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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rmov-0.1.0 lib/quicktime/track.rb
rmov-0.1.1 lib/quicktime/track.rb
rmov-0.1.2 lib/quicktime/track.rb