NextLevelSessionExporter
public class NextLevelSessionExporter: NSObject
🔄 NextLevelSessionExporter, export and transcode media in Swift
-
Input asset for export, provided when initialized.
Declaration
Swift
public var asset: AVAsset? -
Enables video composition and parameters for the session.
Declaration
Swift
public var videoComposition: AVVideoComposition? -
Enables audio mixing and parameters for the session.
Declaration
Swift
public var audioMix: AVAudioMix? -
Output file location for the session.
Declaration
Swift
public var outputURL: URL? -
Output file type. UTI string defined in
AVMediaFormat.h.Declaration
Swift
public var outputFileType: AVFileType? = AVFileType.mp4 -
Time range or limit of an export from
kCMTimeZerotokCMTimePositiveInfinityDeclaration
Swift
public var timeRange: CMTimeRange -
Indicates if an export session should expect media data in real time.
Declaration
Swift
public var expectsMediaDataInRealTime: Bool = false -
Indicates if an export should be optimized for network use.
Declaration
Swift
public var optimizeForNetworkUse: Bool = false -
Metadata to be added to an export.
Declaration
Swift
public var metadata: [AVMetadataItem]? -
Video input configuration dictionary, using keys defined in
<CoreVideo/CVPixelBuffer.h>Declaration
Swift
public var videoInputConfiguration: [String : Any]? -
Video output configuration dictionary, using keys defined in
<AVFoundation/AVVideoSettings.h>Declaration
Swift
public var videoOutputConfiguration: [String : Any]? -
Audio output configuration dictionary, using keys defined in
<AVFoundation/AVAudioSettings.h>Declaration
Swift
public var audioOutputConfiguration: [String : Any]? -
Export session status state.
Declaration
Swift
public var status: AVAssetExportSession.Status -
Session exporting progress from 0 to 1.
Declaration
Swift
public var progress: Float
-
Initializes a session with an asset to export.
Declaration
Swift
public convenience init(withAsset asset: AVAsset)Parameters
assetThe asset to export.
-
Completion handler type for when an export finishes.
Declaration
Swift
public typealias CompletionHandler = (_ status: AVAssetExportSession.Status) -> Void -
Progress handler type
Declaration
Swift
public typealias ProgressHandler = (_ progress: Float) -> Void -
Render handler type for frame processing
Declaration
Swift
public typealias RenderHandler = (_ renderFrame: CVPixelBuffer, _ presentationTime: CMTime, _ resultingBuffer: CVPixelBuffer) -> Void -
Initiates an export session.
Throws
Failure indication thrown when an error has occurred during export.Declaration
Swift
public func export(renderHandler: RenderHandler? = nil, progressHandler: ProgressHandler? = nil, completionHandler: CompletionHandler? = nil) throwsParameters
completionHandlerHandler called when an export session completes.
-
Cancels any export in progress.
Declaration
Swift
public func cancelExport()
View on GitHub
NextLevelSessionExporter Class Reference