简体   繁体   English

在服务器中部署代码后,无法访问本地网络摄像头

[英]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.

相关问题 从BB仿真器访问部署在本地jboss服务器上的Web服务 - Access webservices deployed on a local jboss server from bb simulator 如何从服务器上部署的Java Web服务访问本地文件? - How can I access a local file from a Java webservice deployed on a server? 无法访问在wso2应用程序服务器上部署的基于axis2框架的服务 - Unable to access axis2 framework based service deployed on wso2 application server Restlet代码在本地有效,但在部署时无效(在Openshift上) - Restlet code works on local but not when deployed (on Openshift) 无法测试服务器上部署的Web服务 - Unable to test web service deployed on server 无法使用通过 Tomcat 部署的 Spring 应用程序访问本地 MySQL 数据库 - Unable to local MySQL database with Spring app deployed through Tomcat Eclipse Tomcat Server启动,但代码未部署 - Eclipse Tomcat Server starting but code is not getting deployed 部署到服务器后的 Whitelabel 错误页面错误 - Whitelabel Error Page Error after deployed on server 如何从已部署的Web应用程序访问本地文件系统上的文件? - how to access files on local file system from deployed web app? 除本地计算机上之外,无法访问已部署的Web应用程序 - Not able to access deployed web application other than on local computer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM