Function read_ffmpeg

Source
pub fn read_ffmpeg(stdout: &str, seconds: u32) -> Result<Fingerprint, String>
Expand description

Reads what ffmpeg’s chromaprint muxer wrote to its output.

Split out so the parsing is tested without running anything: the muxer writes the base64 fingerprint and nothing else, and the empty answer — a file too short to fingerprint, or one that decoded to silence — has to be a refusal rather than an empty fingerprint sent to a service that would match it against everything.