Skip to content

Replace FrameSource with lightweight PyAV decode for thumbnails#960

Merged
mprib merged 1 commit intomainfrom
fix/lightweight-thumbnails
Mar 9, 2026
Merged

Replace FrameSource with lightweight PyAV decode for thumbnails#960
mprib merged 1 commit intomainfrom
fix/lightweight-thumbnails

Conversation

@mprib
Copy link
Owner

@mprib mprib commented Mar 9, 2026

Summary

  • get_initial_thumbnails() was creating a full FrameSource per camera just to grab the first frame. FrameSource.__init__ runs a keyframe scan of the entire video file, which is unnecessary for thumbnails.
  • Now opens the container with av.open(), decodes one frame, and closes. No keyframe scan, no close-and-reopen cycle.
  • MultiCameraProcessingTab construction dropped from ~710ms to ~80ms on a 5-camera project.

get_initial_thumbnails() was creating a full FrameSource per camera,
which runs a keyframe scan of the entire video file. Thumbnails only
need the first frame. Now opens the container, decodes one frame,
and closes — no keyframe scan, no reopen cycle.
@mprib mprib merged commit af59e6c into main Mar 9, 2026
3 checks passed
@mprib mprib deleted the fix/lightweight-thumbnails branch March 9, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant