Deep-Live-Cam icon indicating copy to clipboard operation
Deep-Live-Cam copied to clipboard

Macbook Air M1 Sequoia 15.4.1 OpenCV: out device of bound (0-0): 1 | OpenCV: out device of bound (0-0): 1

Open brunoaduarte opened this issue 7 months ago • 4 comments

Macbook Air M1, 2020
macOS Sequoia 15.4.1 (24E263)
15.4.1 (24E263)

When I try to run DeepLiveCam the camera led goes green for 1-2 seconds and then turn off and I get this error

python3.10 run.py --execution-provider coreml     
OpenCV: out device of bound (0-0): 1
OpenCV: camera failed to properly initialize!
OpenCV: out device of bound (0-0): 2
OpenCV: camera failed to properly initialize!

Image

brunoaduarte avatar Apr 20 '25 18:04 brunoaduarte

I commented the code from https://github.com/hacksider/Deep-Live-Cam/blob/181144ce3396533d89eb919ceb443643ef2f5173/modules/ui.py lines 850-855

            # 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()

And the error stopped.

brunoaduarte avatar Apr 20 '25 23:04 brunoaduarte

Is there any investigation to this ? I have the same error on my M3 mac. I followed the installation steps for mac from the readme and ran from a VENV from a terminal opened in my editor. Logs: Frame processor face_enhancer not found OpenCV: out device of bound (0-0): 1 OpenCV: camera failed to properly initialize! [04/30 16:35:45.675746][info][421803][Context.cpp:69] Context created with config: default config! [04/30 16:35:45.675795][info][421803][Context.cpp:74] Context work_dir= [04/30 16:35:45.675800][info][421803][Context.cpp:77] - SDK version: 1.9.4 [04/30 16:35:45.675803][info][421803][Context.cpp:78] - SDK stage version: main [04/30 16:35:45.675808][info][421803][Context.cpp:82] get config EnumerateNetDevice:false [04/30 16:35:45.675814][info][421803][MacPal.cpp:36] createObPal: create MacPal! [04/30 16:35:45.680323][info][421803][MacPal.cpp:104] Create PollingDeviceWatcher! [04/30 16:35:45.680346][info][421803][DeviceManager.cpp:15] Current found device(s): (0) [04/30 16:35:45.680354][info][421803][Pipeline.cpp:15] Try to create pipeline with default device. [04/30 16:35:45.680359][warning][421803][ObException.cpp:5] No device found, fail to create pipeline! [04/30 16:35:45.681620][info][421803][Context.cpp:90] Context destroyed [ WARN:[email protected]] global cap.cpp:323 open VIDEOIO(OBSENSOR): raised unknown C++ exception!

RockyDesigne avatar Apr 30 '25 13:04 RockyDesigne

DEPRECATION WARNING: The system version of Tk is deprecated and may be removed in a future release. Please don't rely on it. Set TK_SILENCE_DEPRECATION=1 to suppress this warning.
OpenCV: out device of bound (0-0): 1
OpenCV: camera failed to properly initialize!
[05/03 17:14:35.476794][info][2200696][Context.cpp:69] Context created with config: default config!
[05/03 17:14:35.476815][info][2200696][Context.cpp:74] Context work_dir=/Users/tuananh/my-working-space/os/Deep-Live-Cam
[05/03 17:14:35.476818][info][2200696][Context.cpp:77]  - SDK version: 1.9.4
[05/03 17:14:35.476819][info][2200696][Context.cpp:78]  - SDK stage version: main
[05/03 17:14:35.476821][info][2200696][Context.cpp:82] get config EnumerateNetDevice:false
[05/03 17:14:35.476823][info][2200696][MacPal.cpp:36] createObPal: create MacPal!
[05/03 17:14:35.477674][info][2200696][MacPal.cpp:104] Create PollingDeviceWatcher!
[05/03 17:14:35.477681][info][2200696][DeviceManager.cpp:15] Current found device(s): (0)
[05/03 17:14:35.477684][info][2200696][Pipeline.cpp:15] Try to create pipeline with default device.
[05/03 17:14:35.477686][warning][2200696][ObException.cpp:5] No device found, fail to create pipeline!
[05/03 17:14:35.478733][info][2200696][Context.cpp:90] Context destroyed
[ WARN:[email protected]] global cap.cpp:323 open VIDEOIO(OBSENSOR): raised unknown C++ exception!


OpenCV: out device of bound (0-0): 2
OpenCV: camera failed to properly initialize!
[05/03 17:14:35.490868][info][2200696][Context.cpp:69] Context created with config: default config!
[05/03 17:14:35.490886][info][2200696][Context.cpp:74] Context work_dir=/Users/tuananh/my-working-space/os/Deep-Live-Cam
[05/03 17:14:35.490888][info][2200696][Context.cpp:77]  - SDK version: 1.9.4
[05/03 17:14:35.490889][info][2200696][Context.cpp:78]  - SDK stage version: main
[05/03 17:14:35.490892][info][2200696][Context.cpp:82] get config EnumerateNetDevice:false
[05/03 17:14:35.490893][info][2200696][MacPal.cpp:36] createObPal: create MacPal!
[05/03 17:14:35.491076][info][2200696][MacPal.cpp:104] Create PollingDeviceWatcher!
[05/03 17:14:35.491083][info][2200696][DeviceManager.cpp:15] Current found device(s): (0)
[05/03 17:14:35.491086][info][2200696][Pipeline.cpp:15] Try to create pipeline with default device.
[05/03 17:14:35.491088][warning][2200696][ObException.cpp:5] No device found, fail to create pipeline!
[05/03 17:14:35.491217][info][2200696][Context.cpp:90] Context destroyed
[ WARN:[email protected]] global cap.cpp:323 open VIDEOIO(OBSENSOR): raised unknown C++ exception!

i also got exception like @RockyDesigne when ran on Apple M1 Pro - Sequoia 15.3.2

nguyenviettuananh avatar May 03 '25 10:05 nguyenviettuananh

After some investigation, it seems this error happens when the laptop only has one camera, it doesn't seem to affect functionality of the app. The real thing that makes it unusable on macos, is that it doesn't use the gpu for hardware acceleration, so i only get 1 FPS sadly.

RockyDesigne avatar May 04 '25 08:05 RockyDesigne