Remuxer

expect object Remuxer

Lossless container rewrite: ffmpeg -c copy. Packets move from input to output without touching a decoder or encoder, so a full-length movie remuxes in seconds and bit-exact quality is preserved. Use it to change containers (mp4 → mkv), strip streams, cut on keyframes, or re-wrap after a download.

actual object Remuxer

Lossless container rewrite: ffmpeg -c copy. Packets move from input to output without touching a decoder or encoder, so a full-length movie remuxes in seconds and bit-exact quality is preserved. Use it to change containers (mp4 → mkv), strip streams, cut on keyframes, or re-wrap after a download.

actual object Remuxer

Lossless container rewrite: ffmpeg -c copy. Packets move from input to output without touching a decoder or encoder, so a full-length movie remuxes in seconds and bit-exact quality is preserved. Use it to change containers (mp4 → mkv), strip streams, cut on keyframes, or re-wrap after a download.

actual object Remuxer

Lossless container rewrite: ffmpeg -c copy. Packets move from input to output without touching a decoder or encoder, so a full-length movie remuxes in seconds and bit-exact quality is preserved. Use it to change containers (mp4 → mkv), strip streams, cut on keyframes, or re-wrap after a download.

Functions

Link copied to clipboard
expect suspend fun remux(input: String, output: String, streamIndices: List<Int>? = null, startMicros: Long = 0, endMicros: Long = Long.MAX_VALUE, metadata: Map<String, String> = emptyMap(), dispatcher: CoroutineDispatcher? = null, onProgress: (packetsWritten: Long) -> Unit? = null)

Copy streamIndices (default: every stream the demuxer understands) from input into a fresh container at output. Format inferred from the output extension.

expect suspend fun remux(input: String, inputOptions: Map<String, String>, output: String, streamIndices: List<Int>? = null, startMicros: Long = 0, endMicros: Long = Long.MAX_VALUE, metadata: Map<String, String> = emptyMap(), dispatcher: CoroutineDispatcher? = null, onProgress: (packetsWritten: Long) -> Unit? = null)

remux with pre-open options for input, applied the way MediaSource.open applies them. On Android this reads a file the user picked without copying it: pass "fd:" as input and the descriptor number as the fd option. Every other parameter is as in the path overload.

expect suspend fun remux(input: () -> MediaByteSource, output: MediaByteSink, format: String, outputOptions: Map<String, String> = emptyMap(), streamIndices: List<Int>? = null, startMicros: Long = 0, endMicros: Long = Long.MAX_VALUE, metadata: Map<String, String> = emptyMap(), dispatcher: CoroutineDispatcher? = null, onProgress: (packetsWritten: Long) -> Unit? = null)

remux from bytes the caller supplies into bytes the caller keeps, with no path at either end. Every other parameter is as in the path overload.

actual suspend fun remux(input: String, output: String, streamIndices: List<Int>?, startMicros: Long, endMicros: Long, metadata: Map<String, String>, dispatcher: CoroutineDispatcher?, onProgress: (packetsWritten: Long) -> Unit?)
actual suspend fun remux(input: String, inputOptions: Map<String, String>, output: String, streamIndices: List<Int>?, startMicros: Long, endMicros: Long, metadata: Map<String, String>, dispatcher: CoroutineDispatcher?, onProgress: (packetsWritten: Long) -> Unit?)
actual suspend fun remux(input: () -> MediaByteSource, output: MediaByteSink, format: String, outputOptions: Map<String, String>, streamIndices: List<Int>?, startMicros: Long, endMicros: Long, metadata: Map<String, String>, dispatcher: CoroutineDispatcher?, onProgress: (packetsWritten: Long) -> Unit?)
actual suspend fun remux(input: String, output: String, streamIndices: List<Int>?, startMicros: Long, endMicros: Long, metadata: Map<String, String>, dispatcher: CoroutineDispatcher?, onProgress: (packetsWritten: Long) -> Unit?)

Copy streamIndices (default: every stream the demuxer understands) from input into a fresh container at output. Format inferred from the output extension.

actual suspend fun remux(input: String, inputOptions: Map<String, String>, output: String, streamIndices: List<Int>?, startMicros: Long, endMicros: Long, metadata: Map<String, String>, dispatcher: CoroutineDispatcher?, onProgress: (packetsWritten: Long) -> Unit?)

remux with pre-open options for input, applied the way MediaSource.open applies them. On Android this reads a file the user picked without copying it: pass "fd:" as input and the descriptor number as the fd option. Every other parameter is as in the path overload.

actual suspend fun remux(input: () -> MediaByteSource, output: MediaByteSink, format: String, outputOptions: Map<String, String>, streamIndices: List<Int>?, startMicros: Long, endMicros: Long, metadata: Map<String, String>, dispatcher: CoroutineDispatcher?, onProgress: (packetsWritten: Long) -> Unit?)

remux from bytes the caller supplies into bytes the caller keeps, with no path at either end. Every other parameter is as in the path overload.

actual suspend fun remux(input: String, output: String, streamIndices: List<Int>?, startMicros: Long, endMicros: Long, metadata: Map<String, String>, dispatcher: CoroutineDispatcher?, onProgress: (packetsWritten: Long) -> Unit?)

Copy streamIndices (default: every stream the demuxer understands) from input into a fresh container at output. Format inferred from the output extension.

actual suspend fun remux(input: String, inputOptions: Map<String, String>, output: String, streamIndices: List<Int>?, startMicros: Long, endMicros: Long, metadata: Map<String, String>, dispatcher: CoroutineDispatcher?, onProgress: (packetsWritten: Long) -> Unit?)

remux with pre-open options for input, applied the way MediaSource.open applies them. On Android this reads a file the user picked without copying it: pass "fd:" as input and the descriptor number as the fd option. Every other parameter is as in the path overload.

actual suspend fun remux(input: () -> MediaByteSource, output: MediaByteSink, format: String, outputOptions: Map<String, String>, streamIndices: List<Int>?, startMicros: Long, endMicros: Long, metadata: Map<String, String>, dispatcher: CoroutineDispatcher?, onProgress: (packetsWritten: Long) -> Unit?)

remux from bytes the caller supplies into bytes the caller keeps, with no path at either end. Every other parameter is as in the path overload.