AVAssetTrack Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AVFoundation.framework |
| Availability | Available in OS X v10.7 and later. |
| Companion guide | |
| Declared in | AVAssetTrack.h |
Overview
An AVAssetTrack object provides provides the track-level inspection interface for all assets.
AVAssetTrack adopts the AVAsynchronousKeyValueLoading protocol. You should use methods in the protocol to access a track’s properties without blocking the current thread. To cancel load requests for all keys of AVAssetTrack you must message the parent AVAsset object (for example, [track.asset cancelLoading]).
Tasks
Basic Properties
-
assetproperty -
trackIDproperty -
mediaTypeproperty -
– hasMediaCharacteristic: -
formatDescriptionsproperty -
enabledproperty -
playableproperty -
selfContainedproperty -
totalSampleDataLengthproperty
Temporal Properties
-
timeRangeproperty -
naturalTimeScaleproperty -
estimatedDataRateproperty
Track Language Properties
-
languageCodeproperty -
extendedLanguageTagproperty
Visual Characteristics
-
naturalSizeproperty -
preferredTransformproperty
Audible Characteristics
-
preferredVolumeproperty
Frame-Based Characteristics
-
nominalFrameRateproperty
Track Segments
Managing Metadata
-
commonMetadataproperty -
– metadataForFormat: -
availableMetadataFormatsproperty
Properties
asset
The asset of which the track is a part. (read-only)
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.havailableMetadataFormats
An array containing the metadata formats available for the track. (read-only)
Discussion
The array contains NSString objects, one for each metadata format that’s available for the track (such as QuickTime user data). For possible values, see AVMetadataItem.
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.hcommonMetadata
An array of AVMetadataItem objects for each common metadata key for which a value is available. (read-only)
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.henabled
Indicates whether the track is enabled according to state stored in its container or construct. (read-only)
Discussion
You can change the presentation state using AVPlayerItem.
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.hestimatedDataRate
The estimated data rate of the media data referenced by the track, in bits per second. (read-only)
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.hextendedLanguageTag
The language tag associated with the track, as an RFC 4646 language tag. (read-only)
Discussion
The value may be nil if no language tag is indicated.
Availability
- Available in OS X v10.7 and later.
See Also
Declared In
AVAssetTrack.hformatDescriptions
The formats of media samples referenced by the track. (read-only)
Discussion
The array contains CMFormatDescriptions (see CMFormatDescriptionRef), each of which indicates the format of media samples referenced by the track. A track that presents uniform media (for example, encoded according to the same encoding settings) will provide an array with a count of 1.
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.hlanguageCode
The language associated with the track, as an ISO 639-2/T language code. (read-only)
Discussion
The value may be nil if no language is indicated.
Availability
- Available in OS X v10.7 and later.
See Also
Declared In
AVAssetTrack.hmediaType
The media type for the track. (read-only)
Discussion
For possible values, see “Media Types” in AV Foundation Constants Reference.
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.hnaturalSize
The natural dimensions of the media data referenced by the track. (read-only)
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.hnaturalTimeScale
A timescale in which time values for the track can be operated upon without extraneous numerical conversion. (read-only)
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.hnominalFrameRate
The frame rate of the track, in frames per second. (read-only)
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.hplayable
Indicates whether the track is playable in the current environment. (read-only)
Discussion
If the value of this property is YES, an AVPlayerItemTrack of an AVPlayerItem initialized with the the track’s asset can be enabled for playback.
Availability
- Available in OS X v10.8 and later.
Declared In
AVAssetTrack.hpreferredTransform
The transform specified in the track’s storage container as the preferred transformation of the visual media data for display purposes. (read-only)
Discussion
The value of this property is often, but not always, CGAffineTransformIdentity.
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.hpreferredVolume
The volume specified in the track’s storage container as the preferred volume of the audible media data. (read-only)
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.hsegments
The time mappings from the track’s media samples to the timeline of the track. (read-only)
Discussion
The array contains instances of AVAssetTrackSegment.
Empty edits (that is, time ranges for which no media data is available to be presented) have source.start and source.duration equal to kCMTimeInvalid.
Availability
- Available in OS X v10.7 and later.
See Also
Declared In
AVAssetTrack.hselfContained
Indicates whether the track references sample data only within its storage container. (read-only)
Discussion
The value is YES if the track references sample data only within its storage container, otherwise it is NO.
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.htimeRange
The time range of the track within the overall timeline of the asset. (read-only)
Discussion
A track with CMTimeCompare(timeRange.start, kCMTimeZero) == 1 will initially present an empty time range.
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.htotalSampleDataLength
The total number of bytes of sample data required by the track. (read-only)
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.htrackID
The persistent unique identifier for this track of the asset. (read-only)
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.hInstance Methods
hasMediaCharacteristic:
Returns a Boolean value that indicates whether the track references media with the specified media characteristic.
Parameters
- mediaCharacteristic
The media characteristic of interest.
For possible values, see “Media Characteristics” in AV Foundation Constants Reference, for example
AVMediaCharacteristicVisual,AVMediaCharacteristicAudible, orAVMediaCharacteristicLegible.
Return Value
YES if the track references media with the specified characteristic, otherwise NO.
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.hmetadataForFormat:
An array of metadata items, one for each metadata item in the container of the specified format.
Parameters
- format
The metadata format for which items are requested.
Return Value
An array of AVMetadataItem objects, one for each metadata item in the container of the format specified by format, or nil if there is no metadata of the specified format.
Discussion
You can call this method without blocking after availableMetadataFormats has been loaded.
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.hsamplePresentationTimeForTrackTime:
Maps the specified track time through the appropriate time mapping and returns the resulting sample presentation time.
Parameters
- trackTime
The track time for which a sample presentation time is requested.
Return Value
The sample presentation time corresponding to trackTime; the value will be invalid if trackTime is out of range.
Availability
- Available in OS X v10.7 and later.
Declared In
AVAssetTrack.hsegmentForTrackTime:
The track segment that corresponds to the specified track time.
Parameters
- trackTime
The track time for which you want the segment.
Return Value
The track segment from the segments array that corresponds to trackTime, or nil if trackTime is out of range.
Availability
- Available in OS X v10.7 and later.
See Also
Declared In
AVAssetTrack.h© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-10-12)