Module convert

Source
Expand description

“Convert To…”: transcode a media file to another container/format with ffmpeg (no compositor): video ↔ gif, mp4 ↔ mov/mkv/webm, audio extraction (mp3/wav/m4a/flac), optional rescale with a chosen scaler. Runs on a background thread, reports through engine::export::Progress, never writes the destination until done (temp + rename, same as exports), never touches the source.

Structs§

ConvertOptions

Constants§

AUDIO_BPS 🔒
Audio allowance subtracted from a size target, bits per second. Matches codec_args’ AAC default.
TARGETS
Output extensions offered by the converter UI.

Functions§

probe_duration 🔒
Container duration in seconds via ffprobe.
probe_seconds
Container duration in seconds via ffprobe (used by the Compress window to size a bitrate).
run_convert 🔒
start_convert
Start a conversion; progress 0..1 by parsing ffmpeg -progress pipe:1 (out_time_us) against the input duration from ffprobe. codec_args(ext, ...) from export.rs picks the codecs; gif gets fps=<gif_fps>[,scale=...:flags=<scaler>],split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse.
strip_quality 🔒
Remove -crf N / -qp N / -cq N pairs so an explicit bitrate is not fighting a quality target.
target_bitrate
Video bitrate (bits/s) that lands target bytes over dur seconds, leaving room for the audio. None when the numbers make no sense (no duration, or the target is smaller than the audio track).