InAppMp4Muxer.Factory


class InAppMp4Muxer.Factory : Muxer.Factory


Muxer.Factory for InAppMp4Muxer.

Summary

Public constructors

Creates an instance with default values.

Creates an instance.

Public functions

InAppMp4Muxer!
create(path: String!)

Returns a new Muxer.

ImmutableList<String!>!

Returns the supported sample MIME types for the given C.TrackType.

InAppMp4Muxer.Factory!

Sets the amount of free space (in bytes) to be reserved after the File Type box in the MP4 file.

InAppMp4Muxer.Factory!

Sets the duration of the video track (in microseconds) in the output.

Boolean

Whether the muxer supports writing negative timestamps into an edit list to instruct players to ignore these samples.

Public constructors

Factory

Factory()

Creates an instance with default values.

Factory

Factory(metadataProvider: InAppMp4Muxer.MetadataProvider?)

Creates an instance.

Parameters
metadataProvider: InAppMp4Muxer.MetadataProvider?

A MetadataProvider.

Public functions

create

fun create(path: String!): InAppMp4Muxer!

Returns a new Muxer.

Parameters
path: String!

The path to the output file.

Throws
androidx.media3.muxer.MuxerException

If an error occurs opening the output file for writing.

getSupportedSampleMimeTypes

fun getSupportedSampleMimeTypes(@C.TrackType trackType: Int): ImmutableList<String!>!

Returns the supported sample MIME types for the given C.TrackType.

setFreeSpaceAfterFileTypeBoxBytes

@CanIgnoreReturnValue
fun setFreeSpaceAfterFileTypeBoxBytes(freeSpaceAfterFileTypeBoxBytes: Int): InAppMp4Muxer.Factory!

Sets the amount of free space (in bytes) to be reserved after the File Type box in the MP4 file. The amount of free space that gets reserved is handled by experimentalSetFreeSpaceAfterFileTypeBox.

Parameters
freeSpaceAfterFileTypeBoxBytes: Int

The free space after file type box in the output.

Returns
InAppMp4Muxer.Factory!

This factory.

setVideoDurationUs

@CanIgnoreReturnValue
fun setVideoDurationUs(videoDurationUs: Long): InAppMp4Muxer.Factory!

Sets the duration of the video track (in microseconds) in the output.

Only the duration of the last sample is adjusted to achieve the given duration. Duration of the other samples remains unchanged.

The default is TIME_UNSET to not set any duration in the output. In this case the video track duration is determined by the samples written to it and the duration of the last sample will be same as that of the sample before that.

Parameters
videoDurationUs: Long

The duration of the video track (in microseconds) in the output, or TIME_UNSET to not set any duration. Only applicable when a video track is added.

Returns
InAppMp4Muxer.Factory!

This factory.

supportsWritingNegativeTimestampsInEditList

fun supportsWritingNegativeTimestampsInEditList(): Boolean

Whether the muxer supports writing negative timestamps into an edit list to instruct players to ignore these samples.