diff --git a/modules/ui.py b/modules/ui.py index de99731..9c817ca 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -3,7 +3,6 @@ import webbrowser import customtkinter as ctk from typing import Callable, Tuple import cv2 -from cv2_enumerate_cameras import enumerate_cameras # Add this import from modules.gpu_processing import gpu_cvt_color, gpu_resize, gpu_flip from PIL import Image, ImageOps import time @@ -971,21 +970,13 @@ def get_available_cameras(): camera_indices = [] camera_names = [] - if platform.system() == "Darwin": # macOS specific handling - # Try to open the default FaceTime camera first - cap = cv2.VideoCapture(0) - if cap.isOpened(): - camera_indices.append(0) - camera_names.append("FaceTime Camera") - cap.release() - - # On macOS, additional cameras typically use indices 1 and 2 - for i in [1, 2]: - cap = cv2.VideoCapture(i) - if cap.isOpened(): - camera_indices.append(i) - camera_names.append(f"Camera {i}") - cap.release() + if platform.system() == "Darwin": + # Do NOT probe cameras with cv2.VideoCapture on macOS — probing + # invalid indices triggers the OBSENSOR backend and causes SIGSEGV. + # Default to indices 0 and 1 (covers FaceTime + one USB camera). + # The user can select the correct index from the UI dropdown. + camera_indices = [0, 1] + camera_names = ["Camera 0", "Camera 1"] else: # Linux camera detection - test first 10 indices for i in range(10):