Class: QTRefMovie::QTMovie

Inherits:
QTBase
  • Object
show all
Defined in:
lib/qtrefmovie.rb

Overview

The Movie Atom You use movie atoms to specify the information that defines a movie-that is, the information that allows your application to understand the data that is stored in the movie data atom. The movie atom normally contains a movie header atom, which defines the time scale and duration information for the entire movie, as well as its display characteristics. In addition, the movie atom contains a track atom for each track in the movie.

The movie atom has an atom type of ‘moov’. It contains other types of atoms, including at least one of three possible parent atoms-the movie header atom (‘mvhd’), the compressed movie atom (‘cmov’), or a reference movie atom (‘rmra’). An uncompressed movie atom can contain both a movie header atom and a reference movie atom, but it must contain at least one of the two. It can also contain several other atoms, such as a clipping atom ( ‘clip’), one or more track atoms ( ‘trak’), a color table atom ( ‘ctab’), and a user data atom ‘udta’).

Compressed movie atoms and reference movie atoms are discussed separately. This section describes normal uncompressed movie atoms.

A movie atom may contain the following information.

Size The number of bytes in this movie atom.

Type The type of this movie atom; this field must be set to ‘moov’.

Movie header atom See “Movie Header Atoms” for more information.

Movie clipping atom See “Clipping Atoms” for more information.

Track list atoms See “Track Atoms” for details on track atoms and their associated atoms.

User data atom See “User Data Atoms” for more infomation about user data atoms.

Color table atom See“Color Table Atoms” for a discussion of the color table atom.

Compressed movie atom See “Compressed Movie Resources” for a discussion of compressed movie atoms.

Reference movie atom See “Reference Movies” for a discussion of reference movie atoms.

Instance Method Summary collapse

Methods inherited from QTBase

#add_chunk, #size, #to_s

Constructor Details

#initialize(options = nil) ⇒ QTMovie

Returns a new instance of QTMovie.



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/qtrefmovie.rb', line 143

def initialize( options = nil )
  super()
  @type = 'moov'
  unless options.nil?
    ref_movie = QTRefMovie.new
    options.each do |opt|
      movie_descriptor = QTRefMovieDescriptor.new
      movie_descriptor.add_chunk QTDataReference.new opt[:reference] unless opt[:reference].nil?
      movie_descriptor.add_chunk QTDataRate.new      opt[:data_rate] unless opt[:data_rate].nil?
      movie_descriptor.add_chunk QTCPUSpeed.new      opt[:cpu_speed] unless opt[:cpu_speed].nil?
      movie_descriptor.add_chunk QTQuality.new       opt[:quality  ] unless opt[:quality  ].nil?
      ref_movie.add_chunk movie_descriptor
    end
    add_chunk ref_movie
  end
end