开发者

programatically capturing images from built in mac web cam

I'm working on a webcam for my imac. When someone has the web page open, I want to send the page a new snap shot from the web cam every 5 seconds or so. I have <head><title>Live Webcam page</title><meta http-equiv="refresh" content="5" /><meta http-equiv="expires" conten开发者_Go百科t="0" /></head> so the page is reloaded every 5 seconds. Here is a history of my attempts so far:

  1. tried using isightcapture. This works fine when I run it in the terminal, but not otherwise.
  2. tried using imagesnap. This, again works fine from the terminal, but almost always generates a solid green image otherwise.
  3. tried using qt-capture. Again, works fine from the terminal, but not otherwise.
  4. tried putting these commands in a script, then running the script. No difference.

I understand apple has been making it progressively more difficult to programatically operate the camera, for "security reasons", possibly causing these problems. Anyone have a solution?


You don't say how you are attempting to invoke the image capture for use by the web page.

Can you explain what you are doing in more detail? What is the entire content of the web page? Are you opening it in the browser directly from the file system, or are you using a web server and some sort of server-side language/framework to serve the page and the image?


OK, I found that apple wants the web cam to be operated by the "current user", so these tools need to be run from a shell, opened by the current user. I can put them in a script, then run the script myself, and they work. I can't run the script from a webpage however.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜