mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-24 18:18:17 -06:00
Problem: probe() and MediaPool's movie sources called std::fs::read and then filmcraft_codecs::open_bytes, so a clip cost its full size in memory, twice while probing (a 245 MiB MP4 peaked at 494 MiB just to import). Fix: container footage on disk is opened through a positional-read ByteReader (stream::FileReader) and FilmCraft's reader openers (filmcraft_media::reader::open_reader; MP4/MOV, Matroska/WebM, MXF, Ogg, MPEG-PS/TS), which read the index and then single samples. Probing takes this path only when nothing probed before containers (still/model extensions, PSD/SVG/PDF, image magic) claims the file; everything else, whole-file audio formats, in-memory files (add_bytes) and wasm32 builds keep the byte path. Regression test: probing and decoding a frame and audio of a movie with a 256 MiB tail grows peak RSS by <64 MiB (512 MiB before), same results. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>