Contents

mediaDataLocation

Specifies how the input lays out and interleaves media data.

Declaration

var mediaDataLocation: AVAssetWriterInput.MediaDataLocation { get set }

Discussion

Use this property to optimize tracks that contain a small amount of data that you need all at once, such as chapter tracks. Setting the value to beforeMainMediaDataNotInterleaved causes the asset writer to try to write the media data for this track before interleaved inputs. For file types that support preloading media data, such as QuickTime files, setting this value also writes an indicator to the file to preload its media data.

Set the value to interleavedWithMainMediaData for tracks whose media data you need only as it approaches its presentation time, or when multiple inputs exist that supply media data that plays concurrently.

You can’t set this value after writing starts.

See Also

Configuring media data layout