Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

AVExport.ExportSession

Creates a new export session.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
AVExport 6.1 Yes No Yes, macOS only No No

MBS( "AVExport.ExportSession"; Asset; Preset )

Parameters

Parameter Description Example value
Asset The reference number of the asset. Please use AVAsset.OpenContainer, AVAsset.OpenFile or AVAsset.OpenURL function to get asset reference. $asset
Preset The preset name to use.
Can be one of the presets returned by AVExport.AllExportPresets or one of the predefined ones:
"640x480"

Result

Returns reference number or error.

Description

Creates a new export session.
Returns a reference number for the new AVAsset export session for the specified source asset and preset.

Presets:
These export options can be used to produce movie files with video size appropriate to the device. The export will not scale the video up from a smaller size. The video will be compressed using H.264 and the audio will be compressed using AAC.

LowQualityLow QualityOS X 10.11 and newer
MediumQualityMedium QualityOS X 10.11 and newer
HighestQualityHigh QualityOS X 10.11 and newer

These export options can be used to produce movie files with the specified video size.
The export will not scale the video up from a smaller size. The video will be compressed using H.264 and the audio will be compressed using AAC. Some devices cannot support some sizes.

640x480VGA Resolution, 640 x 480 PixelOS X 10.7 and newer
960x540 Half HD Resolution, 960 x 540 PixelOS X 10.7 and newer
1280x720 720p Resolution, 1280 x 720 PixelOS X 10.7 and newer
1920x1080Full HD Resolution, 1920 x 1080 Pixel, OS X 10.7 and newer
3840x21604K Resolution, 3840 x 2160OS X 10.10 and newer

These export options are used to produce files that can be played on the specified Apple devices. These presets are available for Desktop export only. The files should have .m4v extensions (or .m4a for exports with audio only sources).

AppleM4VCellularCelluarOS X 10.7 and newer
AppleM4ViPodiPodOS X 10.7 and newer
AppleM4V480pSD480p SDOS X 10.7 and newer
AppleM4VAppleTVAppleTVOS X 10.7 and newer
AppleM4VWiFiWifiOS X 10.7 and newer
AppleM4V720pHD720p HDOS X 10.7 and newer
AppleM4V1080pHD1080p HDOS X 10.8 and newer

Passthrough export option will cause the media of all tracks to be passed through to the output exactly as stored in the source asset, except for tracks for which passthrough is not possible, usually because of constraints of the container format as indicated by the specified outputFileType. This option is not included in the arrays returned by AVExport.AllExportPresets.

PassthroughPass through data if possible.OS X 10.7 and newer
AppleM4AAudio-only .m4a file with appropriate iTunes gapless playback dataOS X 10.7 and newer
AppleProRes422LPCMQuickTime movie with Apple ProRes 422 video and LPCM audio.OS X 10.7 and newer

Examples

Create export session:

If [not IsEmpty($$AVExport)]
    Show Custom Dialog ["We have a session already!?"]
    Exit Script []
End If
Set Variable [$Asset; Value:MBS( "AVAsset.OpenFile"; AVAsset Export Session::Input File Path )]
Set Variable [$$AVExport; Value:MBS( "AVExport.ExportSession"; $Asset; AVAsset Export Session::PresetName )]
If [MBS("IsError")]
    Set Variable [$r; Value:MBS( "AVAsset.Release"; $Asset)]
    Show Custom Dialog ["Failed to create export sessio…"; MBS("Text.RemovePrefix"; $$AVExport; "[MBS] ")]
    Exit Script []
End If
Set Variable [$r; Value:MBS( "AVAsset.Release"; $Asset)]
Set Field [AVAsset Export Session::Duration; MBS( "AVExport.Duration"; $$AVExport )]
Set Field [AVAsset Export Session::SupportedFileTypes; MBS( "AVExport.SupportedFileTypes"; $$AVExport )]

See also

Example Databases


AVExport.ExportAsynchronously   -   AVExport.ExportSessionMerge

Feedback: Report problem or ask question.




Links
MBS Xojo PDF Plugins