Repository navigation
Streaming batch API, scheduling that keeps every drive busy, and lower memory use.
Added
generateHashesStream(for:maxConcurrentTasks:)yields each file's result as it finishes, with its original index. Cancellation stops the producer.- Signpost intervals for each hashing stage (subsystem
com.videohash), one signpost ID per video. Tools/classify-volumes.swift: a standalone, read-only tool that classifies drives as internal, ext-fast, ext-med or ext-slow, with an optional 5-second read test.hash-benchmarkhas a newstreammode.
Changed
- Volume-balanced scheduling (batch and stream): each freed slot takes the next file from the volume with the fewest files in progress. Before, a fixed interleaved order could leave a slow drive holding every slot while a fast drive sat idle.
- Slow-path files get an extra slot (stream): when a file falls back to frame-by-frame extraction, the batch starts one more file until that one finishes, at most doubling
maxConcurrentTasks. - ffmpeg frame extraction runs its input groups one at a time, up to 10 inputs per process, decoding with VideoToolbox (
-hwaccel videotoolbox). - Lower memory use: validated assets are reused, decoded frames are streamed into the sprite, and ffmpeg exit is awaited asynchronously. Peak memory is about 49% lower for two concurrent videos.
- Cancellation propagates through extraction, and temporary frames are cleaned up.
Hash values
- The memory work keeps every recorded hash identical. The reference parity tests (
PHashReferenceParityTests) also pass with VideoToolbox decoding.
Tests
- New tests cover the stream API, volume-balanced and slow-path scheduling, unsupported colour conversions, extraction lifecycle and fallback.