Platforms to show: All Mac Windows Linux Cross-Platform

Back to AVCaptureFileOutputMBS class.

AVCaptureFileOutputMBS.Constructor   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The private constructor.

AVCaptureFileOutputMBS.EnableEvents

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Enables the events for this output.

Those are normally handled automatically, but if you add event with AddHandler you need to call this method.

AVCaptureFileOutputMBS.isRecording as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Indicates whether recording is in progress.

The value of this property is true when the file output currently has a file to which it is writing new samples, false otherwise.

Some examples using this method:

AVCaptureFileOutputMBS.isRecordingPaused as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Indicates whether recording to the current output file is paused.

This property indicates recording to the file returned by outputFileURL has been previously paused using the pauseRecording method. When a recording is paused, captured samples are not written to the output file, but new samples can be written to the same file in the future by calling resumeRecording.

AVCaptureFileOutputMBS.maxRecordedDuration as CMTimeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
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 AVFoundationMBS.captureOutputDidFinishRecordingToOutputFileAtURL event is invoked with an appropriate error. The default value of this property is kCMTimeInvalid, which indicates no limit.
(Read and Write computed property)

AVCaptureFileOutputMBS.maxRecordedFileSize as Int64

Type Topic Plugin Version macOS Windows Linux iOS Targets
property AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
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 AVFoundationMBS captureOutputDidFinishRecordingToOutputFileAtURL event is invoked with an appropriate error. The default value of this property is 0, which indicates no limit.
(Read and Write computed property)

AVCaptureFileOutputMBS.minFreeDiskSpaceLimit as Int64

Type Topic Plugin Version macOS Windows Linux iOS Targets
property AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
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 AVFoundationMBS captureOutputDidFinishRecordingToOutputFileAtURL event is invoked with an appropriate error.
(Read and Write computed property)

AVCaptureFileOutputMBS.outputFileURL as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The URL to which output is directed. (read-only)

Some examples using this method:

AVCaptureFileOutputMBS.pauseRecording

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Pauses recording to the current output file.

This method causes the receiver to stop writing captured samples to the current output file returned by outputFileURL, but leaves the file open so that samples can be written to it in the future, if resumeRecording is called. This allows you to record multiple media segments that are not contiguous in time to a single file.

In OS X, if this method is called within the AVFoundationMBS captureOutputDidFinishRecordingToOutputFileAtURL event, 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.

AVCaptureFileOutputMBS.recordedDuration as CMTimeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
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.

AVCaptureFileOutputMBS.recordedFileSize as Int64

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
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.

AVCaptureFileOutputMBS.resumeRecording

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Resumes recording to the current output file after it was previously paused using pauseRecording.

This method causes the receiver to resume writing captured samples to the current output file returned by outputFileURL, after recording was previously paused using pauseRecording. This allows you to record multiple media segments that are not contiguous in time to a single file.

In OS X, if this method is called within the AVFoundationMBS captureOutputDidFinishRecordingToOutputFileAtURL event, the first samples written to the current file are guaranteed to be those contained in the sample buffer passed to that method.

AVCaptureFileOutputMBS.startRecordingToOutputFile(file as folderitem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Starts recording to a given file.

Same as startRecordingToOutputFileURL, but with folderitem.

AVCaptureFileOutputMBS.startRecordingToOutputFileURL(URL as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Starts recording to a given URL.

URL: The URL of the output file. This method throws an NSInvalidArgumentException if the URL is not a valid file 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.

In OS X, you do not need to call stopRecording before calling this method while another recording is in progress. 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.

In iOS, this frame accurate file switching is not supported. You must call stopRecording before calling this method again to avoid any errors.

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 AVFoundationMBS captureOutputDidFinishRecordingToOutputFileAtURL event. 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 AVFoundationMBS captureOutputDidOutputSampleBuffer event, 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 without filetype.

AVCaptureFileOutputMBS.stopRecording

Type Topic Plugin Version macOS Windows Linux iOS Targets
method AVFoundation MBS AVFoundation Plugin 13.2 ✅ Yes ❌ No ❌ No ✅ Yes All
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 with the new file URL.

When recording is stopped either by calling this method, by changing files using startRecordingToOutputFileURL, 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 is notified when all data has been written to the file using the AVFoundationMBS.captureOutputDidFinishRecordingToOutputFileAtURL method.

In OS X, if this method is called within the AVFoundationMBS captureOutputDidOutputSampleBuffer event, 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.

Some examples using this method:

The items on this page are in the following plugins: MBS AVFoundation Plugin.


The biggest plugin in space...