MediaSink

expect class MediaSink : AutoCloseable

An open output file (muxer). Add every encoder first, video and audio, because the muxer's header freezes the stream list. Then push frames through the encoders. Close the sink to write the trailer and flush buffers.

actual class MediaSink : AutoCloseable

An open output file (muxer). Add every encoder first, video and audio, because the muxer's header freezes the stream list. Then push frames through the encoders. Close the sink to write the trailer and flush buffers.

actual class MediaSink : AutoCloseable

An open output file (muxer). Add every encoder first, video and audio, because the muxer's header freezes the stream list. Then push frames through the encoders. Close the sink to write the trailer and flush buffers.

actual class MediaSink : AutoCloseable

An open output file (muxer). Add every encoder first, video and audio, because the muxer's header freezes the stream list. Then push frames through the encoders. Close the sink to write the trailer and flush buffers.

Types

Link copied to clipboard
expect object Companion
actual object Companion
actual object Companion
actual object Companion

Functions

Link copied to clipboard

Add an audio encoder. Must be called before any frame is written.

Add an audio encoder. Must be called before any frame is written.

Add an audio encoder. Must be called before any frame is written.

Add an audio encoder. Must be called before any frame is written.

Link copied to clipboard
expect fun addCopyStream(source: MediaSource, stream: StreamInfo): CopyStream

Add an output stream that copies stream's packets verbatim from source: no decode, no re-encode, only timestamp rescaling into the output's time-base (ffmpeg -c copy). Bitstream filters are not applied, so format pairs that need one (e.g. h264 in mp4 → MPEG-TS Annex B) are not yet supported.

actual fun addCopyStream(source: MediaSource, stream: StreamInfo): CopyStream

Add an output stream that copies stream's packets verbatim from source: no decode, no re-encode, only timestamp rescaling into the output's time-base (ffmpeg -c copy). Bitstream filters are not applied, so format pairs that need one (e.g. h264 in mp4 → MPEG-TS Annex B) are not yet supported.

actual fun addCopyStream(source: MediaSource, stream: StreamInfo): CopyStream

Add an output stream that copies stream's packets verbatim from source: no decode, no re-encode, only timestamp rescaling into the output's time-base (ffmpeg -c copy). Bitstream filters are not applied, so format pairs that need one (e.g. h264 in mp4 → MPEG-TS Annex B) are not yet supported.

actual fun addCopyStream(source: MediaSource, stream: StreamInfo): CopyStream

Add an output stream that copies stream's packets verbatim from source: no decode, no re-encode, only timestamp rescaling into the output's time-base (ffmpeg -c copy). Bitstream filters are not applied, so format pairs that need one (e.g. h264 in mp4 → MPEG-TS Annex B) are not yet supported.

Link copied to clipboard

Add a video encoder. Must be called before any frame is written.

Add a video encoder. Must be called before any frame is written.

Add a video encoder. Must be called before any frame is written.

Add a video encoder. Must be called before any frame is written.

Link copied to clipboard
expect open override fun close()

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

actual open override fun close()

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

actual open override fun close()

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

actual open override fun close()

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

Link copied to clipboard
expect fun setMetadata(metadata: Map<String, String>)

Container-level metadata tags (title, artist, comment, …). Call this before any frame or packet is written, because the tags are stored in the header.

actual fun setMetadata(metadata: Map<String, String>)

Container-level metadata tags (title, artist, comment, …). Call this before any frame or packet is written, because the tags are stored in the header.

actual fun setMetadata(metadata: Map<String, String>)

Container-level metadata tags (title, artist, comment, …). Call this before any frame or packet is written, because the tags are stored in the header.

actual fun setMetadata(metadata: Map<String, String>)

Container-level metadata tags (title, artist, comment, …). Call this before any frame or packet is written, because the tags are stored in the header.