Class: AVAssetImageGenerator
Overview
An AVAssetImageGenerator object provides thumbnail or preview images of assets independently of playback.
Instance Attribute Summary (collapse)
-
- apertureMode
Specifies the aperture mode for the generated image.
-
- appliesPreferredTrackTransform
Specifies whether to apply the track matrix (or matrices) when extracting an image from the asset.
-
- asset
readonly
The instance of AVAsset with which the AVAssetImageGenerator was initialized.
-
- maximumSize
Specifies the maximum dimensions for generated image.
-
- requestedTimeToleranceAfter
The maximum length of time after a requested time for which an image may be generated.
-
- requestedTimeToleranceBefore
The maximum length of time before a requested time for which an image may be generated.
-
- videoComposition
The video composition to use when extracting images from assets with multiple video tracks.
Class Method Summary (collapse)
-
+ assetImageGeneratorWithAsset:
Returns an image generator for use with a specified asset.
Instance Method Summary (collapse)
-
- cancelAllCGImageGeneration
Cancels all pending image generation requests.
-
- copyCGImageAtTime:actualTime:error:
Returns a CGImage for the asset at or near a specified time.
-
- generateCGImagesAsynchronouslyForTimes:completionHandler:
Creates a series of CGImage objects for an asset at or near specified times.
-
- initWithAsset:
Initializes an image generator for use with a specified asset.
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
- (String) apertureMode
Specifies the aperture mode for the generated image. The default value is AVAssetImageGeneratorApertureModeCleanAperture.
- (Boolean) appliesPreferredTrackTransform
Specifies whether to apply the track matrix (or matrices) when extracting an image from the asset. The default is NO. AVAssetImageGenerator only supports rotation by 90, 180, or 270 degrees.This property is ignored if you set a value for the videoComposition property.
- (AVAsset) asset (readonly)
The instance of AVAsset with which the AVAssetImageGenerator was initialized. (read-only)
- (CGSize) maximumSize
Specifies the maximum dimensions for generated image. The default value is CGSizeZero, which specifies the asset’s unscaled dimensions.AVAssetImageGenerator scales images such that they fit within the defined bounding box. Images are never scaled up. The aspect ratio of the scaled image is defined by the apertureMode property.
- (CMTime) requestedTimeToleranceAfter
The maximum length of time after a requested time for which an image may be generated. The default value is kCMTimePositiveInfinity.Set the values of requestedTimeToleranceBefore and requestedTimeToleranceAfter to kCMTimeZero to request frame-accurate image generation; this may incur additional decoding delay.
- (CMTime) requestedTimeToleranceBefore
The maximum length of time before a requested time for which an image may be generated. The default value is kCMTimePositiveInfinity.Set the values of requestedTimeToleranceBefore and requestedTimeToleranceAfter to kCMTimeZero to request frame-accurate image generation; this may incur additional decoding delay.
- (Object) videoComposition
The video composition to use when extracting images from assets with multiple video tracks. If no video composition is specified, only the first enabled video track will be used. If a video composition is specified, the appliesPreferredTrackTransform property is ignored.
Class Method Details
+ (AVAssetImageGenerator) assetImageGeneratorWithAsset(asset)
Returns an image generator for use with a specified asset. This method may succeed even if the asset possesses no visual tracks at the time of initialization.
Instance Method Details
- (Object) cancelAllCGImageGeneration
Cancels all pending image generation requests. This method calls the handler block with AVAssetImageGeneratorCancelled for each image time in every previous invocation of generateCGImagesAsynchronouslyForTimes:completionHandler: for which images have not yet been supplied.
- (CGImageRef) copyCGImageAtTime(requestedTime, actualTime:actualTime, error:outError)
Returns a CGImage for the asset at or near a specified time. This method returns the image synchronously.
- (Object) generateCGImagesAsynchronouslyForTimes(requestedTimes, completionHandler:handler)
Creates a series of CGImage objects for an asset at or near specified times. This method uses an efficient “batch mode” to get images in time order.The client receives exactly one handler callback for each requested time in requestedTimes. Changes to the generator’s properties (snap behavior, maximum size, and so on) do not affect pending asynchronous image generation requests.
- (Object) initWithAsset(asset)
Initializes an image generator for use with a specified asset. This method may succeed even if the asset possesses no visual tracks at the time of initialization.