2

I am trying to run a OpenCV tutorial that uses the cv.VideoCapture(0). This does require permission from terminal to access the camera. Here is a blog description showing that they see the terminal app included in the Applications list:

enter image description here

But for me the Terminal is not provided as an optional App:

enter image description here

That is actually not at all surprising. But then how to add Terminal? The apple docs only show this: https://support.apple.com/guide/mac-help/control-access-to-your-camera-on-mac-mchlf6d108da/mac :

enter image description here

No mention of how to add other apps is included. So how to add Terminal? (Actually I would also be interested in adding for iTerm2 ..)

1
  • Try to tccutil reset Camera from your system terminal (not iTerm2). And then run iTerm2 again, it should ask for the permission to access your Camera. Commented May 25, 2019 at 6:50

1 Answer 1

2

You can force your terminal to request access to your Camera.

I used the following commands (these are meant to click a picture from your MacBook's camera):

ffmpeg -f avfoundation -list_devices true -i ""

List the devices attached to your computer. Get the device ID of your camera


ffmpeg -ss 0.5 -f avfoundation -i "0" -t 1 capture.jpg

Capture the photo.


Although this did not click a picture (returned an error), but it did force the terminal to ask permission to access the Camera.

P.S: You need to have the ffmpeg package installed. You can do brew install ffmpeg

I got these commands from this stackoverflow answer

Update by Question Asker This does work and here is the screenshot

enter image description here

1
  • 1
    This worked: nice idea. I have updated your answer with the screenshot Commented Jul 28, 2020 at 15:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .