Skip to main content

copy_packets

Function copy_packets 

Source
pub fn copy_packets(
    copy: &PacketCopy,
    output: &Path,
    container: Container,
    audio: CopyAudio<'_>,
    cancel: &CancelToken,
    progress: &mut dyn FnMut(u64),
) -> Result<PacketCopyReport, EncodeError>
Expand description

Writes copy’s runs, back to back, into a new container file at output, with audio. The runs were planned for container (PacketCopyRequest::container).

The output is transactional, as every export’s is: it is written beside output and renamed into place only when complete, and a failure or a cancel removes it. Encoded audio is interleaved with the video as it is written, a little ahead of it, so neither stream piles up in the muxer. progress is called with the video packets written.

§Errors

Returns an adapter failure for an existing output, a partial a running export holds, a read or write failure, a failed mix, audio the plan does not copy, or a cancel.