Transcoder

expect object Transcoder

High-level pipeline: open input → decode → optionally filter → encode → mux. The equivalent of ffmpeg -ss 12 -to 45 -i in.mp4 -vf "scale=…" -c:v libx264 -c:a aac out.mp4 as one Kotlin call with proper cancellation and typed errors.

All selected streams are demuxed in a single pass. Their packets are interleaved into the output as they are produced, so memory use stays constant regardless of input length.

actual object Transcoder

High-level pipeline: open input → decode → optionally filter → encode → mux. The equivalent of ffmpeg -ss 12 -to 45 -i in.mp4 -vf "scale=…" -c:v libx264 -c:a aac out.mp4 as one Kotlin call with proper cancellation and typed errors.

All selected streams are demuxed in a single pass. Their packets are interleaved into the output as they are produced, so memory use stays constant regardless of input length.

actual object Transcoder

High-level pipeline: open input → decode → optionally filter → encode → mux. The equivalent of ffmpeg -ss 12 -to 45 -i in.mp4 -vf "scale=…" -c:v libx264 -c:a aac out.mp4 as one Kotlin call with proper cancellation and typed errors.

All selected streams are demuxed in a single pass. Their packets are interleaved into the output as they are produced, so memory use stays constant regardless of input length.

actual object Transcoder

High-level pipeline: open input → decode → optionally filter → encode → mux. The equivalent of ffmpeg -ss 12 -to 45 -i in.mp4 -vf "scale=…" -c:v libx264 -c:a aac out.mp4 as one Kotlin call with proper cancellation and typed errors.

All selected streams are demuxed in a single pass. Their packets are interleaved into the output as they are produced, so memory use stays constant regardless of input length.

Functions

Link copied to clipboard
expect suspend fun transcode(input: String, output: String, spec: VideoEncoderSpec? = null, videoFilter: String? = null, videoCopy: Boolean = false, audioSpec: AudioEncoderSpec? = null, audioFilter: String? = null, audioCopy: Boolean = false, subtitleCopy: Boolean = false, startMicros: Long = 0, endMicros: Long = Long.MAX_VALUE, metadata: Map<String, String> = emptyMap(), onProgress: (TranscodeProgress) -> Unit? = null)

Run a transcode end-to-end. Suspends until done.

actual suspend fun transcode(input: String, output: String, spec: VideoEncoderSpec?, videoFilter: String?, videoCopy: Boolean, audioSpec: AudioEncoderSpec?, audioFilter: String?, audioCopy: Boolean, subtitleCopy: Boolean, startMicros: Long, endMicros: Long, metadata: Map<String, String>, onProgress: (TranscodeProgress) -> Unit?)

Run a transcode end-to-end. Suspends until done.

actual suspend fun transcode(input: String, output: String, spec: VideoEncoderSpec?, videoFilter: String?, videoCopy: Boolean, audioSpec: AudioEncoderSpec?, audioFilter: String?, audioCopy: Boolean, subtitleCopy: Boolean, startMicros: Long, endMicros: Long, metadata: Map<String, String>, onProgress: (TranscodeProgress) -> Unit?)

Run a transcode end-to-end. Suspends until done.

actual suspend fun transcode(input: String, output: String, spec: VideoEncoderSpec?, videoFilter: String?, videoCopy: Boolean, audioSpec: AudioEncoderSpec?, audioFilter: String?, audioCopy: Boolean, subtitleCopy: Boolean, startMicros: Long, endMicros: Long, metadata: Map<String, String>, onProgress: (TranscodeProgress) -> Unit?)

Run a transcode end-to-end. Suspends until done.