简体   繁体   English

使用three.js渲染IP CAMERA流

[英]Render IP CAMERA stream with three.js

I'm trying to render video stream from an IP Camera to a three.js texture, but I cannot find how to. 我正在尝试将IP摄像机的视频流呈现为three.js纹理,但是我找不到方法。 I am trying something like this: 我正在尝试这样的事情:

....
var video   = document.createElement('video');
video.crossOrigin="anonymous";
video.width = 320;
video.height    = 240;
video.autoplay  = true;
video.loop  = true;

//This works, but it is not from an IP Camera
//video.src="http://video.webmfiles.org/big-buck-bunny_trailer.webm";

//This does not work
video.src="http://webcam01.bigskyresort.com/mjpg/video.mjpg";

this._video = video
var texture;
texture = new THREE.Texture( video );
....

Any idea? 任何想法?

Many thanks in advance! 提前谢谢了!

In Windows, paste this command in run window 在Windows中,将此命令粘贴到运行窗口中

chrome.exe --user-data-dir="C:/Chrome dev session" --disable-web-security

this will open a new chrome browser which allow access to no 'access-control-allow-origin' header request. 这将打开一个新的Chrome浏览器,该浏览器不允许访问“ access-control-allow-origin”标头请求。

It has security implications and should only be used for testing. 它具有安全性 ,应仅用于测试。

Without --user-data-dir= path , everyone (every website) will be able to interact in your name with your banking, social or another website where you have an account, and that everyone (every website) will be able to read your mails from your providers website, without any security blocking them. 没有--user-data-dir= path ,每个人(每个网站)都将能够以您的名字与您拥有银行帐户的银行,社交网站或其他网站进行交互,并且每个人(每个网站)都将能够阅读您从提供商网站发送的邮件,没有任何安全措施阻止它们。 So do not use your current session for that, create a new one. 因此,请勿为此使用当前会话,而要创建一个新会话。

Or maybe you can install another instance of a browser, and use it only for opening the page. 或者,也许您可​​以安装浏览器的另一个实例,并将其仅用于打开页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM