Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

AVAssetWriterInputMBS 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: You use an AVAssetWriterInput to append media samples packaged as CMSampleBuffer objects, or collections of metadata, to a single track of the output file of an AVAssetWriter object.
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.

Feedback, Comments & Corrections

This class has no sub classes.

Some methods using this class:

Some properties using for this class:

Some events for this class:

Some examples which use this class:

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

AVAssetWriterInputGroupMBS   -   AVAssetWriterInputPixelBufferAdaptorMBS

The biggest plugin in space...

MBS FileMaker blog