Class: AVAssetTrack

Inherits:
NSObject show all

Overview

An AVAssetTrack object provides provides the track-level inspection interface for all assets.

Direct Known Subclasses

AVCompositionTrack

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from NSObject

#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version

Constructor Details

This class inherits a constructor from NSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NSObject

Instance Attribute Details

- (AVAsset) asset (readonly)

The asset of which the track is a part. (read-only)

Returns:

- (Array) availableMetadataFormats (readonly)

An array containing the metadata formats available for the track. (read-only) 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.

Returns:

- (Array) commonMetadata (readonly)

An array of AVMetadataItem objects for each common metadata key for which a value is available. (read-only)

Returns:

- (Boolean) enabled (readonly)

Indicates whether the track is enabled according to state stored in its container or construct. (read-only) You can change the presentation state using AVPlayerItem.

Returns:

  • (Boolean)

- (Float) estimatedDataRate (readonly)

The estimated data rate of the media data referenced by the track, in bits per second. (read-only)

Returns:

- (String) extendedLanguageTag (readonly)

The language tag associated with the track, as an RFC 4646 language tag. (read-only) The value may be nil if no language tag is indicated.

Returns:

- (Array) formatDescriptions (readonly)

The formats of media samples referenced by the track. (read-only) 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.

Returns:

- (String) languageCode (readonly)

The language associated with the track, as an ISO 639-2/T language code. (read-only) The value may be nil if no language is indicated.

Returns:

- (String) mediaType (readonly)

The media type for the track. (read-only) For possible values, see “Media Types” in AV Foundation Constants Reference.

Returns:

- (CGSize) naturalSize (readonly)

The natural dimensions of the media data referenced by the track. (read-only)

Returns:

- (CMTimeScale) naturalTimeScale (readonly)

A timescale in which time values for the track can be operated upon without extraneous numerical conversion. (read-only)

Returns:

  • (CMTimeScale)

- (Float) nominalFrameRate (readonly)

The frame rate of the track, in frames per second. (read-only)

Returns:

- (Boolean) playable (readonly)

Indicates whether the track is playable in the current environment. (read-only) 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.

Returns:

  • (Boolean)

- (CGAffineTransform) preferredTransform (readonly)

The transform specified in the track’s storage container as the preferred transformation of the visual media data for display purposes. (read-only) The value of this property is often, but not always, CGAffineTransformIdentity.

Returns:

- (Float) preferredVolume (readonly)

The volume specified in the track’s storage container as the preferred volume of the audible media data. (read-only)

Returns:

- (Array) segments (readonly)

The time mappings from the track’s media samples to the timeline of the track. (read-only) 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.

Returns:

- (Boolean) selfContained (readonly)

Indicates whether the track references sample data only within its storage container. (read-only) The value is YES if the track references sample data only within its storage container, otherwise it is NO.

Returns:

  • (Boolean)

- (CMTimeRange) timeRange (readonly)

The time range of the track within the overall timeline of the asset. (read-only) A track with CMTimeCompare(timeRange.start, kCMTimeZero) == 1 will initially present an empty time range.

Returns:

  • (CMTimeRange)

- (Integer) totalSampleDataLength (readonly)

The total number of bytes of sample data required by the track. (read-only)

Returns:

- (CMPersistentTrackID) trackID (readonly)

The persistent unique identifier for this track of the asset. (read-only)

Returns:

  • (CMPersistentTrackID)

Instance Method Details

- (Boolean) hasMediaCharacteristic(mediaCharacteristic)

Returns a Boolean value that indicates whether the track references media with the specified media characteristic.

Parameters:

  • mediaCharacteristic (String)

    The media characteristic of interest.For possible values, see “Media Characteristics” in AV Foundation Constants Reference, for example AVMediaCharacteristicVisual, AVMediaCharacteristicAudible, or AVMediaCharacteristicLegible.

Returns:

  • (Boolean)

    YES if the track references media with the specified characteristic, otherwise NO.

- (Array) metadataForFormat(format)

An array of metadata items, one for each metadata item in the container of the specified format. You can call this method without blocking after availableMetadataFormats has been loaded.

Parameters:

  • format (String)

    The metadata format for which items are requested.

Returns:

  • (Array)

    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.

- (CMTime) samplePresentationTimeForTrackTime(trackTime)

Maps the specified track time through the appropriate time mapping and returns the resulting sample presentation time.

Parameters:

  • trackTime (CMTime)

    The track time for which a sample presentation time is requested.

Returns:

  • (CMTime)

    The sample presentation time corresponding to trackTime; the value will be invalid if trackTime is out of range.

- (AVAssetTrackSegment) segmentForTrackTime(trackTime)

The track segment that corresponds to the specified track time.

Parameters:

  • trackTime (CMTime)

    The track time for which you want the segment.

Returns:

  • (AVAssetTrackSegment)

    The track segment from the segments array that corresponds to trackTime, or nil if trackTime is out of range.