[英]programatically capturing images from built in mac web cam
I'm working on a webcam for my imac. 我正在为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.
当有人打开网页时,我想每5秒钟左右从网络摄像头向该页面发送一次新快照。 I have
<head><title>Live Webcam page</title><meta http-equiv="refresh" content="5" /><meta http-equiv="expires" content="0" /></head>
so the page is reloaded every 5 seconds. 我有
<head><title>Live Webcam page</title><meta http-equiv="refresh" content="5" /><meta http-equiv="expires" content="0" /></head>
因此每5秒钟重新加载一次页面。 Here is a history of my attempts so far: 这是到目前为止我的尝试历史:
isightcapture
. isightcapture
。 This works fine when I run it in the terminal, but not otherwise. imagesnap
. imagesnap
。 This, again works fine from the terminal, but almost always generates a solid green image otherwise. qt-capture
. qt-capture
。 Again, works fine from the terminal, but not otherwise. 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?
您是在浏览器中直接从文件系统直接打开它,还是在使用Web服务器和某种服务器端语言/框架来提供页面和图像?
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. 好的,我发现Apple希望网络摄像头由“当前用户”操作,因此这些工具需要从当前用户打开的外壳中运行。 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.
但是,我无法从网页运行脚本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.