Repository navigation
feat(multi-camera): pick cameras and record them one at a time - #200
Merged
Merged
Conversation
Each row of the Multi-Camera window's status table now has a checkbox and its own Record/Stop button. - Unticking a camera disconnects it (frees its USB bandwidth), so it is neither previewed nor recorded. The choice persists in ~/.glider/camera_selection.json, and the camera panel's Multi-Camera mode honours it too, so an experiment run does not record those cameras. A camera with a file open cannot be switched off. - A row's button starts or stops that camera alone. MultiVideoRecorder gains start_camera()/stop_camera(); a run lasts from the first camera starting to the last one stopping. A stopped camera's file is finished on a worker thread so the other previews keep running; stop() waits for any still saving and returns every file of the run. - Record All adds the cameras not yet recording to a run already going instead of doing nothing; Stop All stops every camera. - Each camera has its own take time. A restart within the same second writes _take2 rather than overwriting the first take. - Enumeration can skip indices already open, so Refresh Cameras does not probe streaming cameras (which can refuse a second open and end the scan early). - Cameras are listed in number order (cam_2 before cam_10), row buttons fill their cells under the tool theme's item padding, and the preview tiles show each camera's fps.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Multi-Camera window can now switch individual cameras off, and record each camera on its own.
Each row of the status table has a checkbox and its own Record / Stop button.
~/.glider/camera_selection.json.How
MultiVideoRecorder.start_camera()/stop_camera(). A run lasts from the first camera starting until the last one stops. A stopped camera's file is drained, closed and frame-rate-corrected on a worker thread, so the other previews keep running.stop()waits for any file still saving, and returns every file of the run, including cameras stopped earlier._take2instead of opening the first take's file over the top (filenames carry a one-second timestamp).enumerate_cameras(skip_indices=...): Refresh Cameras no longer probes cameras that are already streaming. Those can refuse a second open, read as missing, and end the scan before a switched-off camera further up.set_camera_labelsis now accepted mid-run. Files already open keep their names, but a camera started later uses its new one.Testing
CameraManagerup is real: the Windows connect path, capture threads, the window clicked with a real mouse, the recorder, and real.mp4files. Onlycv2.VideoCaptureis replaced. The simulated cameras run at their own rates (one at 25 fps), can only be opened once at a time, one ignores the requested size (800x600), and there is a gap in the numbering. All 53 checks passed, including:_take2was written on a same-second restart.Not yet tested on real cameras. Reconnecting a real DirectShow camera after switching it off and on, and real USB bandwidth, need a run on the rig.