Mp4Muxer.Builder


public final class Mp4Muxer.Builder


A builder for Mp4Muxer instances.

Summary

Public constructors

Builder(FileOutputStream fileOutputStream)

Creates a Builder instance with default values.

Public methods

Mp4Muxer

Builds an Mp4Muxer instance.

Mp4Muxer.Builder

Sets the AnnexBToAvccConverter to be used by the muxer to convert H.264 and H.265 NAL units from the Annex-B format (using start codes to delineate NAL units) to the AVCC format (which uses length prefixes).

Mp4Muxer.Builder

Sets the LastFrameDurationBehavior for the video track.

Public constructors

Builder

public Builder(FileOutputStream fileOutputStream)

Creates a Builder instance with default values.

Parameters
FileOutputStream fileOutputStream

The FileOutputStream to write the media data to.

Public methods

build

public Mp4Muxer build()

Builds an Mp4Muxer instance.

setAnnexBToAvccConverter

@CanIgnoreReturnValue
public Mp4Muxer.Builder setAnnexBToAvccConverter(AnnexBToAvccConverter annexBToAvccConverter)

Sets the AnnexBToAvccConverter to be used by the muxer to convert H.264 and H.265 NAL units from the Annex-B format (using start codes to delineate NAL units) to the AVCC format (which uses length prefixes).

The default value is DEFAULT.

setLastFrameDurationBehavior

@CanIgnoreReturnValue
public Mp4Muxer.Builder setLastFrameDurationBehavior(
    @Mp4Muxer.LastFrameDurationBehavior int lastFrameDurationBehavior
)

Sets the LastFrameDurationBehavior for the video track.

The default value is LAST_FRAME_DURATION_BEHAVIOR_INSERT_SHORT_FRAME.