[英]unable to the access the local webcam after the code is deployed in server
I am using webcam to capture the images from my program. 我正在使用网络摄像头从程序中捕获图像。 When i run the locally on my machine webcam of my local laptop is getting opened .
当我在计算机上本地运行时,本地笔记本电脑的网络摄像头被打开。 But when i deploy the code in server ....Webcam is not opening .
但是当我在服务器中部署代码时.... Webcam无法打开。
Is it trying to open the webcam of server system? 是否正在尝试打开服务器系统的网络摄像头?
I am using the following code open the camera 我正在使用以下代码打开相机
webcam = Webcam.getWebcams().get(0);
Dimension size = WebcamResolution.QVGA.getSize();
webcam.setViewSize(size);
panel = new WebcamPanel(webcam);
panel.setPreferredSize(size);
panel.setFPSDisplayed(true);
panel.start();
I believe your code invoke by Servlet or related API which is server-side implementation, and that will work for specific server only. 我相信您的代码是由Servlet或相关API调用的,后者是服务器端的实现,仅适用于特定的服务器。 But if you have to access client Cams and send it over your system then you have to implement same functionality with JS or Type script, exp: Angular, Any Js based frame work.
但是,如果必须访问客户端Cams并通过系统发送它,则必须使用JS或Type脚本(例如:Angular,任何基于Js的框架)来实现相同的功能。
Below I m sharing discussion for how to do it in Angular: How do I get a webcam working with AngularJS? 下面,我分享了有关如何在Angular中进行操作的讨论: 如何使用AngularJS使用网络摄像头?
Hope this will help!! 希望这会有所帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.