Class: AVCaptureFileOutput

Inherits:
AVCaptureOutput show all

Overview

AVCaptureFileOutput is an abstract sub-class of AVCaptureOutput that describes a file output destination to an AVCaptureSession. You use an instance of its concrete subclass, , to save capture output to a QuickTime movie file. The concrete subclasses of AVCaptureFileOutput are AVCaptureMovieFileOutput, which records media to a QuickTime movie file, and AVCaptureAudioFileOutput, which writes audio media to a variety of audio file formats.

Direct Known Subclasses

AVCaptureMovieFileOutput

Instance Attribute Summary (collapse)

Attributes inherited from AVCaptureOutput

#connections

Instance Method Summary (collapse)

Methods inherited from AVCaptureOutput

#connectionWithMediaType:, #transformedMetadataObjectForMetadataObject:connection:

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

- (CMTime) maxRecordedDuration

The longest duration allowed for the recording. This property specifies a hard limit on the duration of recorded files. Recording is stopped when the limit is reached and the captureOutput:didFinishRecordingToOutputFileAtURL:fromConnections:error: delegate method is invoked with an appropriate error. The default value of this property is kCMTimeInvalid, which indicates no limit.

Returns:

  • (CMTime)

- (Integer) maxRecordedFileSize

The maximum size, in bytes, of the data that should be recorded by the receiver. This property specifies a hard limit on the data size of recorded files. Recording is stopped when the limit is reached and the captureOutput:didFinishRecordingToOutputFileAtURL:fromConnections:error: delegate method is invoked with an appropriate error. The default value of this property is 0, which indicates no limit.

Returns:

- (Integer) minFreeDiskSpaceLimit

The minimum amount of free space, in bytes, required for recording to continue on a given volume. This property specifies a hard lower limit on the amount of free space that must remain on a target volume for recording to continue. Recording is stopped when the limit is reached and the captureOutput:didFinishRecordingToOutputFileAtURL:fromConnections:error: delegate method is invoked with an appropriate error.

Returns:

- (NSURL) outputFileURL (readonly)

The URL to which output is directed. (read-only)

Returns:

- (CMTime) recordedDuration (readonly)

Indicates the duration of the media recorded to the current output file. (read-only) If recording is in progress, this property returns the total time recorded so far.

Returns:

  • (CMTime)

- (Integer) recordedFileSize (readonly)

Indicates the size, in bytes, of the data recorded to the current output file. (read-only) If a recording is in progress, this property returns the size in bytes of the data recorded so far.

Returns:

- (Boolean) recording (readonly)

Indicates whether recording is in progress. The value of this property is YES when the file output currently has a file to which it is writing new samples, NO otherwise.

Returns:

  • (Boolean)

Instance Method Details

- (Object) startRecordingToOutputFileURL(outputFileURL, recordingDelegate:delegate)

Starts recording to a given URL. The method sets the file URL to which the receiver is currently writing output media. If a file at the given URL already exists when capturing starts, recording to the new file will fail.You do not need to call stopRecording before calling this method while another recording is in progress. In OS X, if this method is invoked while an existing output file was already being recorded, no media samples will be discarded between the old file and the new file.When recording is stopped either by calling stopRecording, by changing files using this method, or because of an error, the remaining data that needs to be included to the file will be written in the background. Therefore, you must specify a delegate that will be notified when all data has been written to the file using the captureOutput:didFinishRecordingToOutputFileAtURL:fromConnections:error: method. The recording delegate can also optionally implement methods that inform it when data starts being written, when recording is paused and resumed, and when recording is about to be finished.In OS X, if this method is called within the captureOutput:didOutputSampleBuffer:fromConnection: delegate method, the first samples written to the new file are guaranteed to be those contained in the sample buffer passed to that method.Note: AVCaptureAudioFileOutput does not support startRecordingToOutputFileURL:recordingDelegate:. Use startRecordingToOutputFileURL:outputFileType:recordingDelegate: instead.

Parameters:

  • outputFileURL (NSURL)

    An NSURL object containing the URL of the output file.This method throws an NSInvalidArgumentException if the URL is not a valid file URL.

  • delegate (Object)

    A object to serve as delegate for the recording session.

Returns:

- (Object) stopRecording

Tells the receiver to stop recording to the current file. You can call this method when they want to stop recording new samples to the current file, and do not want to continue recording to another file. If you want to switch from one file to another, you should not call this method. Instead you should simply call startRecordingToOutputFileURL:recordingDelegate: with the new file URL.When recording is stopped either by calling this method, by changing files using startRecordingToOutputFileURL:recordingDelegate:, or because of an error, the remaining data that needs to be included to the file will be written in the background. Therefore, before using the file, you must wait until the delegate that was specified in startRecordingToOutputFileURL:recordingDelegate: is notified when all data has been written to the file using the captureOutput:didFinishRecordingToOutputFileAtURL:fromConnections:error: method.In OS X, if this method is called within the captureOutput:didOutputSampleBuffer:fromConnection: delegate method, the last samples written to the current file are guaranteed to be those that were output immediately before those in the sample buffer passed to that method.

Returns: