pub(crate) fn decode_frames_seeking(video_path: impl AsRef<Path>) -> Result<()>
Expand description
Decodes one frame per second by seeking to specific timestamps.
This experimental function uses precise seeking to extract exactly one frame per second of video. It’s more accurate for consistent temporal sampling but significantly slower due to seek overhead. Uses rayon for parallel PNG saving to improve performance.
§Approach
- Calculate video duration and determine target timestamps (1s, 2s, 3s, …)
- Seek to each timestamp and decode one frame
- Save all frames in parallel using rayon
§Limitations
- Seek accuracy depends on video keyframe spacing
- May skip frames in areas with sparse keyframes
- Higher CPU usage due to seeking overhead