Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

AVAssetExportSessionMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: The AVFoundation class for media export.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.m4v")
dim a as AVAssetMBS = AVAssetMBS.assetWithFile(f)
dim p as string = AVAssetExportSessionMBS.AVAssetExportPresetAppleM4VCellular
dim e as new AVAssetExportSessionMBS(a, p)

dim FileTypes() as string = e.supportedFileTypes
e.outputFileType = FileTypes(0)
e.OutputFile = SpecialFolder.Desktop.Child("small.m4v")
e.exportAsynchronously

// instead of waiting for event, we simply wait for it to finish
do
app.YieldToNextThread
loop until e.status <> e.AVAssetExportSessionStatusExporting
Notes:
An AVAssetExportSession object transcodes the contents of an AVAsset source object to create an output of the form described by a specified export preset.

Prior to initializing an instance of AVAssetExportSession, you can use allExportPresets to get the complete list of presets available. Use exportPresetsCompatibleWithAsset to get a list of presets that are compatible with a specific asset.

After you have initialized an export session with the asset that contains the source media, the export preset name (presetName), and the output file type (outputFileType), you can start the export running by invoking exportAsynchronously. Because the export is performed asynchronously, this method returns immediately—you can use progress to check on the progress. Depending on the capabilities of the device, some exports may be queued when multiple exports are attempted. When this happens, the status of a queued export will indicate that it's waiting (AVAssetExportSessionStatusWaiting).

The exportAsynchronouslyCompleted event on AVFoundationMBS is called whether the export fails, completes, or is cancelled. Upon completion, the status property indicates whether the export has completed successfully. If it has failed, the value of the error property supplies additional information about the reason for the failure.
Available in OS X v10.7 and later.

Feedback, Comments & Corrections

Status Constants

Constant Value Description
AVAssetExportSessionStatusCancelled 5 Indicates that the export session was cancelled.
AVAssetExportSessionStatusCompleted 3 Indicates that the export session completed successfully.
AVAssetExportSessionStatusExporting 2 Indicates that the export session is in progress.
AVAssetExportSessionStatusFailed 4 Indicates that the export session failed.
AVAssetExportSessionStatusUnknown 0 Indicates that the status is unknown.
AVAssetExportSessionStatusWaiting 1 Indicates that the session is waiting to export more data.

This class has no sub classes.

Some events for this class:

Some examples which use this class:


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


AvahiTypeBrowserMBS   -   AVAssetImageGeneratorMBS




Links
MBS FileMaker blog