pub fn cache_frames(
path: impl AsRef<Path>,
ranges: &[(u64, u64)],
) -> Result<Vec<Frame>>Expand description
Decodes ranges of the film at path into the frames a FrameCache
for those ranges wants — what Controls::add_cached
takes.
Each range costs a seek to the keyframe before it and decoding forward;
files import writes have a keyframe every two seconds, so that is short.
§Errors
Whatever opening or decoding the file refuses, Error::Unsupported for a
file with no frame rate, and Error::Decode for a range that runs past
the end of the film.