pub fn convert(
ffmpeg: &str,
source: &Path,
destination: &Path,
target: Target,
quality: Option<Quality>,
) -> Result<(), String>Expand description
Converts one file, and reports what went wrong in words rather than in an exit status.
The metadata travels from the input’s global and first audio-stream tags, and the embedded cover is copied as a picture stream where the container takes one. Neither is perfect — no two tag formats hold quite the same fields, and a Vorbis comment with three values for one field cannot be an ID3 frame that holds one — but losing the artist and the title on the way to a player is not a trade anybody would accept, and ffmpeg’s mapping is what beets relies on for the same reason.
Sources must resolve to ordinary local files. Output is encoded in an isolated temporary directory, then atomically replaces an ordinary target; final symlinks and the source itself are refused. A different hard-link alias is replaced without writing through to the original source inode.