37

How do I find out which application has the camera open on an iMac (Running Leopard)? The green light is on indicating the camera is in use as well as photo booth can't connect to the camera. The only other apps running are Safari and Finder (as best as I can tell), neither of which seem to be using the camera.

If this was Windows, I'd use Process Explorer, what can I do on a Mac to see who has a particular device open?

EDIT: using the suggestion of NSD, I nearly have a solution with

    lsof | grep "USBVDC"

That shows all the apps trying to use the camera, but not the one that actually owns it. Probably close enough.

Cfinley
  • 1,435
Tony Lee
  • 730

7 Answers7

24

My best guess would be that iChat Agent was running in the background.

If not, then try:

lsof | grep -i "AppleCamera"

In previous versions of OS X (before Yosemite), this should be used:

lsof | grep -i "iSight"
slhck
  • 235,242
Hasaan Chop
  • 4,906
19

In 2014, VDC works as an lsof search term for this:

$ lsof | grep VDC
FaceTime  1097 user  txt      REG                1,4    405264    2934 /System/Library/Frameworks/CoreMediaIO.framework/Versions/A/Resources/VDC.plugin/Contents/MacOS/VDC
Mattie B
  • 391
  • 3
  • 11
7

lsof is a good bet. Grepping for 'VDC' gives me the best results, but in older versions of OSX you may have to use other terms 'AppleCamera', 'iSight'.

Then you have a list, and you see that a couple of programs are using the cam. You could try to kill them one by one, but what if one is in the browser and you have a million tabs open?

Usually this trick works for me:

  • open ActivityMonitor,
  • search VDC, VDCAssistant is listed,
  • force quit VDCAssistant.

Result is that all processes trying to use the camera are temporarily disconnected. This takes care of processes that kept using the camera because of some glitch. The VDCAssistant is restarted automatically.

This trick also works great if a program cannot access the camera.

iwein
  • 173
4

I've just found that having Facetime minimised causes the iSight LED to come on every so often. Close FaceTime by clicking the red button in the top left hand corner. You'll still receive FaceTime calls but the camera will only be turned on when they come in.

1

you can also use the oversight app: https://objective-see.com/products/oversight.html

oversight app can detect whether some other apps are using your camera or microphone, alert you, then you can choose to block it, leave it, or add it to whitelist.

0

iSight/AppleCamera is now renamed to FaceTime

lsof | grep -i "FaceTime"

may be as root, just in case some one else is using it. Usually it is facetime minimized which is the issue. Open it and quit it.

0

Borrowing the excellent solution that iwein proposed, but streamlining it and making it scriptable, you can do this:

sudo pkill 'VDCAssistant'

You could then put this into a function to make it easier to remember:

repocam () {
    sudo pkill 'VDCAssistant'
}

You can put that function in your .zshrc file or .bashrc or whatever you use.

Out of scope but worth pursuing:

You could even set up a cron job or launchd agent or whatever you want (Google for details!) to run it every so often. If you can figure out which app (such as HipShat) is triggering the problem, you might be able to figure out a way to run it upon exiting the app.

It's also possible to trigger scripts when your computer wakes up or goes to sleep.

iconoclast
  • 3,449