close

expect open override fun close()

Flushes every encoder, writes the trailer, and frees the muxer.

The flush matters: encoders buffer (x264's lookahead holds tens of frames), so closing without draining them would silently truncate the end of the output. The flush is best-effort (if an encoder fails here, a trailer is still written for the data already muxed). It does nothing for encoders already drained by VideoEncoder.drive or AudioEncoder.drive.

Throws

when the trailer fails. The file on disk is then broken, for example an mp4 whose moov atom was never written.

actual open override fun close()

Flushes every encoder, writes the trailer, and frees the muxer.

The flush matters: encoders buffer (x264's lookahead holds tens of frames), so closing without draining them would silently truncate the end of the output. The flush is best-effort (if an encoder fails here, a trailer is still written for the data already muxed). It does nothing for encoders already drained by VideoEncoder.drive or AudioEncoder.drive.

Throws

when the trailer fails. The file on disk is then broken, for example an mp4 whose moov atom was never written.

actual open override fun close()

Flushes every encoder, writes the trailer, and frees the muxer.

The flush matters: encoders buffer (x264's lookahead holds tens of frames), so closing without draining them would silently truncate the end of the output. The flush is best-effort (if an encoder fails here, a trailer is still written for the data already muxed). It does nothing for encoders already drained by VideoEncoder.drive or AudioEncoder.drive.

Throws

when the trailer fails. The file on disk is then broken, for example an mp4 whose moov atom was never written.

actual open override fun close()

Flushes every encoder, writes the trailer, and frees the muxer.

The flush matters: encoders buffer (x264's lookahead holds tens of frames), so closing without draining them would silently truncate the end of the output. The flush is best-effort (if an encoder fails here, a trailer is still written for the data already muxed). It does nothing for encoders already drained by VideoEncoder.drive or AudioEncoder.drive.

Throws

when the trailer fails. The file on disk is then broken, for example an mp4 whose moov atom was never written.