Skip to main content

Module transcode

Module transcode 

Source
Expand description

Single-file transcode: arbitrary input → AV1 + audio MP4.

Pipeline shape (no S3 / SQS / multi-variant — this is the single-shot path; for segmented CMAF-HLS or an ABR ladder, drive the container and codec crates directly):

input bytes → demux_streaming → header/audio extraction
            → create_decoder (GPU dispatch: NVDEC / QSV)
            → for each video sample: push_sample → decode_next loop
                → colorspace::convert_to_yuv420p_bt709
                → encoder.send_frame → receive_packet → muxer.add_packet
            → drain decoder → flush encoder → muxer.finalize
            → output bytes

Audio is handled per source codec: AAC / Opus / AC-3 / E-AC-3 pass through verbatim; MP3 / Vorbis are transcoded to Opus; anything else is dropped (video-only output) with a warning.

Structs§

TranscodeOutcome
Outcome of a single in-memory transcode.

Enums§

AudioHandling
What happened to the source audio track.

Functions§

transcode_bytes
Transcode an in-memory input buffer to an AV1/MP4 output buffer.
transcode_file
Read input, transcode to AV1/MP4, and write the result to output.