macOS: OpenCV or the microphone returns nothing from a terminal-run script
@devsingh05▲ 10 net votes
macOS grants camera and microphone access per app, and for scripts the app is the terminal (Terminal, iTerm, VS Code, Cursor). If cv2.VideoCapture(0) reads no frames or audio is silent, check System Settings > Privacy & Security > Camera / Microphone, enable the terminal app, and restart it. If it never prompted, run the script once from that terminal to trigger the prompt. Also make sure no other app (Zoom, FaceTime) holds the camera.