Platforms to show: All Mac Windows Linux Cross-Platform
AVAssetWriterInputMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
When there are multiple inputs, AVAssetWriter tries to write media data in an ideal interleaving pattern for efficiency in storage and playback. Each of its inputs signals its readiness to receive media data for writing according to that pattern via the value of readyForMoreMediaData. If readyForMoreMediaData is true, an input can accept additional media data while maintaining appropriate interleaving. If media data is appended to an input after readyForMoreMediaData becomes false, AVAssetWriter may need to write media data to its output without regard for ideal interleaving.
You can only append media data to an input while its readyForMoreMediaData property is true.
- If you're writing media data from a non-real-time source, such as an instance of AVAssetReader, you should hold off on generating or obtaining more media data to append to an input when the value of readyForMoreMediaData is false. To help with control of the supply of non-real-time media data, you can use requestMediaDataWhenReadyOnQueue:usingBlock: to specify a block that the input should invoke whenever it's ready for input to be appended.
- If you're writing media data from a real-time source, you should set the input's expectsMediaDataInRealTime property to true to ensure that the value of readyForMoreMediaData is calculated appropriately. When expectsMediaDataInRealTime is true, readyForMoreMediaData will become false only when the input cannot process media samples as quickly as they are being provided by the client. If readyForMoreMediaData becomes false for a real-time source, the client may need to drop samples or consider reducing the data rate of appended samples.
The value of readyForMoreMediaData will often change from false to true asynchronously, as previously-supplied media data is processed and written to the output. It is possible for all of an asset writer's inputs temporarily to return false for readyForMoreMediaData.
- 11 properties
- property expectsMediaDataInRealTime as boolean
- property extendedLanguageTag as String
- property Handle as Integer
- property isReadyForMoreMediaData as boolean
- property languageCode as String
- property marksOutputTrackAsEnabled as Boolean
- property mediaTimeScale as Integer
- property mediaType as string
- property naturalSize as CGSizeMBS
- property preferredVolume as Double
- property transform as CGAffineTransformMBS
- 12 methods
- method addTrackAssociationWithTrackOfInput(input as AVAssetWriterInputMBS, trackAssociationType as string)
- method appendSampleBuffer(sampleBuffer as CMSampleBufferMBS) as boolean
- method canAddTrackAssociationWithTrackOfInput(input as AVAssetWriterInputMBS, trackAssociationType as string) as Boolean
- method Constructor(MediaType as string, outputSettings as dictionary = nil)
- method Constructor(MediaType as string, outputSettings as dictionary, sourceFormatHint as CMFormatDescriptionMBS)
- method markAsFinished
- method metadata as AVMetadataItemMBS()
- method outputSettings as dictionary
- method requestMediaDataWhenReadyOnQueue(assetWriterInput as AVAssetWriterInputMBS, AssetReaderOutput as AVAssetReaderOutputMBS, tag as Variant = nil)
- method requestMediaDataWhenReadyOnQueue(tag as Variant = nil)
- method setMetadata(items() as AVMetadataItemMBS)
- method sourceFormatHint as CMFormatDescriptionMBS
- 3 shared methods
- shared method assetWriterInputWithMediaType(MediaType as string, outputSettings as dictionary = nil) as AVAssetWriterInputMBS
- shared method assetWriterInputWithMediaType(MediaType as string, outputSettings as dictionary, sourceFormatHint as CMFormatDescriptionMBS) as AVAssetWriterInputMBS
- shared method available as boolean
This class has no sub classes.
Some methods using this class:
- AVAssetWriterInputGroupMBS.assetWriterInputGroupWithInputs(inputs() as AVAssetWriterInputMBS, defaultInput as AVAssetWriterInputMBS) as AVAssetWriterInputGroupMBS
- AVAssetWriterInputGroupMBS.Constructor(inputs() as AVAssetWriterInputMBS, defaultInput as AVAssetWriterInputMBS)
- AVAssetWriterInputGroupMBS.inputs as AVAssetWriterInputMBS()
- AVAssetWriterInputPixelBufferAdaptorMBS.assetWriterInput as AVAssetWriterInputMBS
- AVAssetWriterInputPixelBufferAdaptorMBS.assetWriterInputPixelBufferAdaptorWithAssetWriterInput(input as AVAssetWriterInputMBS, sourcePixelBufferAttributes as dictionary) as AVAssetWriterInputPixelBufferAdaptorMBS
- AVAssetWriterInputPixelBufferAdaptorMBS.Constructor(input as AVAssetWriterInputMBS, sourcePixelBufferAttributes as dictionary)
- AVAssetWriterMBS.addInput(input as AVAssetWriterInputMBS)
- AVAssetWriterMBS.canAddInput(input as AVAssetWriterInputMBS) as boolean
- AVAssetWriterMBS.inputs as AVAssetWriterInputMBS()
Some properties using for this class:
- AVAssetWriterInputGroupMBS.defaultInput as AVAssetWriterInputMBS
Some events using this class:
- AVFoundationMBS.requestMediaDataWhenReadyOnQueueCompleted(assetWriterInput as AVAssetWriterInputMBS, tag as Variant)
- AVFoundationMBS.requestMediaDataWhenReadyOnQueueFinished(assetWriterInput as AVAssetWriterInputMBS, assetReaderOutput as AVAssetReaderOutputMBS, tag as Variant)
- AVFoundationMBS.requestMediaDataWhenReadyOnQueueProgress(assetWriterInput as AVAssetWriterInputMBS, assetReaderOutput as AVAssetReaderOutputMBS, convertedByteCount as Int64, LastBuffer as CMSampleBufferMBS, tag as Variant)
Some examples using this class:
- /AVFoundation/Make Video From Images
- /AVFoundation/Make Video From Images with transparency
- /AVFoundation/Transcode
- /AVFoundation/Transcode batch
- /AVFoundation/Transcode parallel
Xojo Developer Magazine
The items on this page are in the following plugins: MBS AVFoundation Plugin.
AVAssetWriterInputGroupMBS - AVAssetWriterInputPixelBufferAdaptorMBS