Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webcam light still on after cam.release()

I am using opencv and Python3 to read webcam.

The webcam light keeps on even though I released the webcam.

I am doing:

webcam = cv2.VideoCapture(0)
webcam.release()

After the release command, if I try to read the cam I get: (False, None) but the webcam itself is still <VideoCapture 0EE62DC0>. I don't know if this is the issue, but the light keeps on until I kill all python script or python terminal.

I am on a Windows 10, python 3.5, opencv 4.0.1. Am I doing something wrong?

like image 667
Gabrielle Avatar asked Aug 22 '18 20:08

Gabrielle


People also ask

Why is my camera light on even though my camera is off?

Whenever your webcam light is on, it indicates that it's in use. If you're not using the webcam, but the light is on, it can show that another app is using it. You should identify that app and cut its access to the webcam.

How do I turn off webcam in Python?

You can press the Esc key to exit.


1 Answers

I had exactly the same problem. Was using python3.6 and opencv 3.4.2 (also on Windows10), reinstalled opencv-python version to 3.4.0.14. That worked for me.

Seems that there is a problem with opencv 3.4.2.

That specific version you can install by running the command:

pip install opencv-python==3.4.0.14

like image 70
Isabel Avatar answered Oct 19 '22 06:10

Isabel