Class

AVMovie

An object that represents the audiovisual containers that conform to a QuickTime or ISO-based media file format.

Declaration

class AVMovie : AVAsset

Overview

AVMovie supports operations involving the format-specific portions of the QuickTime movie model that aren't supported by AVAsset. For instance, retrieving the movie header from an existing QuickTime movie file. You can also use AVMovie to write a movie header into a new file, thereby creating a reference movie.

Topics

Initializing a Movie

init(url: URL, options: [String : Any]?)

Creates a movie object from a movie header stored in a QuickTime movie file of ISO base media file.

init(data: Data, options: [String : Any]?)

Creates a movie object from a movie stored in an NSData object.

Accessing Movie Information

var url: URL?

The URL used to initialize the movie instance.

var canContainMovieFragments: Bool

A Boolean value that indicates whether the movie file can be extended by fragments.

var containsMovieFragments: Bool

A Boolean value that indicates whether the movie file is extended by at least one movie fragment.

var data: Data?

The data block used to initialize the movie.

var defaultMediaDataStorage: AVMediaDataStorage?

The default storage container for media data added to a movie.

var tracks: [AVMovieTrack]

An array of tracks in a movie.

class func movieTypes() -> [AVFileType]

Returns the file types the AVMovie class can process.

Creating Movie Tracks

func track(withTrackID: CMPersistentTrackID) -> AVMovieTrack?

Provides a movie track associated with the specified track ID.

func tracks(withMediaCharacteristic: AVMediaCharacteristic) -> [AVMovieTrack]

Provides the movie tracks of the specified media characteristic associated with an asset.

func tracks(withMediaType: AVMediaType) -> [AVMovieTrack]

Provides the movie tracks of the specified media type associated with an asset.

Creating and Writing Headers

func makeMovieHeader(fileType: AVFileType) -> Data

Creates a data object containing the movie header for a movie object.

struct AVMovieWritingOptions

A set of options to control the writing of a movie header to a destination URL.

func `is`(compatibleWithFileType: AVFileType) -> Bool

Returns a Boolean value that indicates whether a movie header of the specified type can be created.

See Also

QuickTime and ISO-Related Media

class AVMovieTrack

A track that conforms to a QuickTime or ISO-based media file format.

class AVFragmentedMovie

An object used to handle fragmented movie files.

class AVFragmentedMovieTrack

An object used to handle the tracks of fragmented movie files.

class AVFragmentedMovieMinder

An object used to check whether additional movie fragments have been appended to a fragmented movie file.

class AVMediaDataStorage

An object used to create a sample data file.