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.
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.
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.
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
Run a transcode end-to-end. Suspends until done.
transcode 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.
transcode 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.
Run a transcode end-to-end. Suspends until done.
transcode 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.
transcode 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.
Run a transcode end-to-end. Suspends until done.
transcode 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.
transcode 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.