eduardolundgren / tracking.js

A modern approach for Computer Vision on the web
http://trackingjs.com
Other
9.44k stars 1.45k forks source link

Demo with camera don't work #352

Open cecchisandrone opened 5 years ago

cecchisandrone commented 5 years ago

When I try to open camera examples on the website I always have the following error: image I'm on Windows 10 with latest Chrome. I tried also MS Edge and Firefox.

murat-aka commented 5 years ago

269

bettysteger commented 5 years ago

https://trackingjs.com/examples/face_camera.html

got the same error on my own page. It just stopped working out of nowhere?

bartlomiejzuber commented 5 years ago

Same here and I have same error in console as @cecchisandrone

Thromshall commented 5 years ago

Yup this isn't working for me either.

GautamUpreti123 commented 5 years ago

You are facing this issue because tracking js is not able to find the video stream. for your video html element use an id or query selector like: In html

var videoElement = document.getElementById("video") videoElement.srcObject= stream; //stream is a var in which we have our video streaming

let me know if it's still not resolved. There might be some other issues with way you are streaming your video.

bettysteger commented 5 years ago

//stream is a var in which we have our video streaming

@GautamUpreti123 and where is this coming from?

GautamUpreti123 commented 5 years ago

you can use: MediaDevice api Use following link to get video stream ( https://developer.mozilla.org/enUS/docs/Web/API/MediaDevices/getUserMedia )

var contraints = { audio: true, video: { facingMode: "user" } } Navigator.mediaDevices.getUserMedia(contraints).then((stream)=>{ var videoStream = stream;
})

Please do let me know if your issue gets resolved or not.

bettysteger commented 5 years ago

@GautamUpreti123 thanks that fixed it.

See my commit for the solution: https://github.com/lpsBetty/fakehappy/commit/a20b07aa55c600229123a774c118a81634374b32

GautamUpreti123 commented 5 years ago

Always happy to help. Let me know if any other issues you faced in tracking objects.

Zibri commented 4 years ago

the demo on website still does not work

GautamUpreti123 commented 4 years ago

the demo on website still does not work

I can help you in fixing your website. Can't help with demo website.

netgfx commented 4 years ago

See my solution here: https://github.com/moemoe89/simple-login-qrcode-webcam-php/issues/2#issuecomment-600204683