freemocap / freemocap

Free Motion Capture for Everyone 💀✨
https://freemocap.org
GNU Affero General Public License v3.0
3.37k stars 261 forks source link

Camera Detection #604

Open Shwerm opened 5 months ago

Shwerm commented 5 months ago

I am trying to connect some cameras to Skelly, I have tried using a canon DSLR and a goPro hero but neither get detected by freemocap software. The only camera which gets detected is gthe built in webcam at index 1. I cam the closest to it working with the goPro where it connected as a webcam for a second but then disconnected.

the is the output from the anaconda terminal:

[2024-05-22T14:42:36.237448] [Δt:20.848252s] [ INFO] [skellycam.gui.qt.skelly_cam_widget] [skelly_cam_widget:disconnect_from_cameras():196] [PID:27204:MainProcess TID:23024:MainThread ] Disconnecting from cameras 2024-05-22 14:42:36,237 - skellycam.gui.qt.skelly_cam_widget - INFO - Disconnecting from cameras [2024-05-22T14:42:36.237448] [Δt:0.000000s] [ INFO] [skellycam.gui.qt.skelly_cam_widget] [skelly_cam_widget:_clear_camera_grid_view():301] [PID:27204:MainProcess TID:23024:MainThread ] No camera view widgets to clear 2024-05-22 14:42:36,237 - skellycam.gui.qt.skelly_cam_widget - INFO - No camera view widgets to clear [2024-05-22T14:42:36.237448] [Δt:0.000000s] [ INFO] [skellycam.gui.qt.workers.camera_group_thread_worker] [camera_group_thread_worker:close():161] [PID:27204:MainProcess TID:23024:MainThread ] Closing camera group 2024-05-22 14:42:36,237 - skellycam.gui.qt.workers.camera_group_thread_worker - INFO - Closing camera group [2024-05-22T14:42:36.237448] [Δt:0.000000s] [ INFO] [skellycam.gui.qt.skelly_cam_widget] [skelly_cam_widget:detect_available_cameras():172] [PID:27204:MainProcess TID:23024:MainThread ] Connecting to cameras 2024-05-22 14:42:36,237 - skellycam.gui.qt.skelly_cam_widget - INFO - Connecting to cameras [2024-05-22T14:42:36.237448] [Δt:0.000000s] [ INFO] [skellycam.gui.qt.workers.detect_cameras_worker] [detect_cameras_worker:run():17] [PID:27204:MainProcess TID:9000:Dummy-4 ] Starting detect cameras thread worker 2024-05-22 14:42:36,237 - skellycam.gui.qt.workers.detect_cameras_worker - INFO - Starting detect cameras thread worker [2024-05-22T14:42:36.237448] [Δt:0.000000s] [ DEBUG] [skellycam.opencv.config.determine_backend] [determine_backend:determine_backend():11] [PID:27204:MainProcess TID:9000:Dummy-4 ] Windows machine detected - using backend cv2.CAP_DSHOW [2024-05-22T14:42:36.984361] [Δt:0.747911s] [ DEBUG] [skellycam.detection.private.detect_possible_cameras] [detect_possible_cameras:find_available_cameras():45] [PID:27204:MainProcess TID:9000:Dummy-4 ] Camera 2 appears to be return identical non-black frames -its probably a virtual camera, skipping [2024-05-22T14:42:42.443666] [Δt:5.458306s] [ DEBUG] [skellycam.detection.private.detect_possible_cameras] [detect_possible_cameras:find_available_cameras():67] [PID:27204:MainProcess TID:9000:Dummy-4 ] Deleting caps_list [] [2024-05-22T14:42:42.443666] [Δt:0.000000s] [ INFO] [skellycam.detection.private.detect_possible_cameras] [detect_possible_cameras:find_available_cameras():70] [PID:27204:MainProcess TID:9000:Dummy-4 ] Found cameras: [] 2024-05-22 14:42:42,443 - skellycam.detection.private.detect_possible_cameras - INFO - Found cameras: [] [2024-05-22T14:42:42.445669] [Δt:0.002003s] [ INFO] [skellycam.gui.qt.skelly_cam_widget] [skelly_cam_widget:_handle_detected_cameras():243] [PID:27204:MainProcess TID:23024:MainThread ] No cameras detected 2024-05-22 14:42:42,445 - skellycam.gui.qt.skelly_cam_widget - INFO - No cameras detected [2024-05-22T14:42:42.445669] [Δt:0.000000s] [ INFO] [skellycam.gui.qt.skelly_cam_widget] [skelly_cam_widget:_show_no_cameras_found_message():125] [PID:27204:MainProcess TID:23024:MainThread ] Showing no cameras found message 2024-05-22 14:42:42,445 - skellycam.gui.qt.skelly_cam_widget - INFO - Showing no cameras found message [2024-05-22T14:42:42.445669] [Δt:0.004157s] [ INFO] [skellycam.gui.qt.skelly_cam_widget] [skelly_cam_widget:_clear_camera_grid_view():301] [PID:27204:MainProcess TID:23024:MainThread ] No camera view widgets to clear 2024-05-22 14:42:42,445 - skellycam.gui.qt.skelly_cam_widget - INFO - No camera view widgets to clear

aaroncherian commented 5 months ago

Hey there - so we use OpenCV for our camera-related operations at the moment. I believe that natively, opencv is best suited to just recognize and capture video from your normal USB webcams. Anything more than that (particularly things like GoPros or DSLRs, which have a bunch more things going on with them), and there would need to be some custom-codework to get it to work with those cameras.

You can however use your GoPro/DSLR to record video for use in FreeMoCap without having to connect it to the software. The Import Videos option in the GUI lets you import in externally recorded videos for use in the software:

image

If you record external videos, you either need to make sure that they're synchronized and all have the same number of frames before you import them in (say in Adobe Premiere or another video recording software), or we also have a Synchronize option in the import menu that will try and audio sync the videos and clip them to be equal length.