Function of

Source
pub fn of(by: By, path: &Path, seconds: u32) -> Result<Fingerprint, String>
Expand description

Computes the fingerprint of one file.

seconds is the length the catalog holds, used only on the ffmpeg path, which emits no duration of its own. fpcalc states one and its answer wins: it measured what it actually decoded, and a header that disagrees with the stream is exactly the kind of file this whole feature exists for.

The path must resolve to a regular local file. It is canonicalized before invoking either helper, so relative names cannot become options or URLs. Directories, devices and other special files are refused before a helper can block reading them.