lysdexic-audio / n4m-handpose

Wraps MediaPipe HandPose inside electron and serves the detected parts via MaxAPI.
Apache License 2.0
41 stars 11 forks source link

this browser does not support video capture,or this device does not have a camera #8

Open electroMedia666 opened 2 years ago

electroMedia666 commented 2 years ago

Big fan of this tool, Thanks for sharing, but cannot get to recognize camera anymore.

Summary or problem After downloading modules i start the script. No user interface is visible and I receive this error after 1 minute: "this browser does not support video capture, or this device does not have a camera" I do not get this with facetracking tool which is working fine.

When I open 'developer tools' 1 error and 3 warnings : _shown in order of appearance__

Warning:

1) Platform browser has already been set. Overwriting the platform with [object Object]. Environment.setPlatform @ C:\Users\dante\Documents\Max 8\Packages\n4m-Bundler\n4m-handpose-master\n4m-handpose-master\node_modules\@tensorflow\tfjs-core\dist\environment.js:38

2) (electron) Security Warning: webFrame.executeJavaScript was called without worldSafeExecuteJavaScript enabled. This is considered unsafe. worldSafeExecuteJavaScript will be enabled by default in Electron 12. electron/js2c/renderer_init.js:15

3) Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security electron/js2c/renderer_init.js:135 Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security. electron/js2c/renderer_init.js:135

4) ERROR: Uncaught (in promise) DOMExecption: Could not start video source - n4m-handpose_camera.js 445

5) WARNING: DevTools failed to load SourceMap: Could not load content for file:///C:/Users/dante/Documents/Max%208/Packages/n4m-Bundler/n4m-handpose-master/n4m-handpose-master/node_modules/ajv.js.map: This warning occurs for every module (my guess) there are like a hundred all leading to the modules folder.

system Windows 11, Max 8.1.11

lysdexic-audio commented 2 years ago

Cheers for the report - haven’t done any Win11 testing yet. I’ll try to get a hold of Win 11 and try it out

On 24 Oct 2021, at 09:19, electroMedia666 @.***> wrote:

 Big fan of this tool, Thanks for sharing, but cannot get to recognize camera anymore.

Summary or problem After downloading modules i start the script. No user interface is visible and I receive this error after 1 minute: "this browser does not support video capture, or this device does not have a camera" I do not get this with facetracking tool which is working fine.

When I open 'developer tools' 1 error and 3 warnings : shown in order of appearance_

Warning:

Platform browser has already been set. Overwriting the platform with [object Object]. Environment.setPlatform @ C:\Users\dante\Documents\Max @.***\tfjs-core\dist\environment.js:38

(electron) Security Warning: webFrame.executeJavaScript was called without worldSafeExecuteJavaScript enabled. This is considered unsafe. worldSafeExecuteJavaScript will be enabled by default in Electron 12. electron/js2c/renderer_init.js:15

Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security electron/js2c/renderer_init.js:135 Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security. electron/js2c/renderer_init.js:135

ERROR: Uncaught (in promise) DOMExecption: Could not start video source - n4m-handpose_camera.js 445

WARNING: DevTools failed to load SourceMap: Could not load content for file:///C:/Users/dante/Documents/Max%208/Packages/n4m-Bundler/n4m-handpose-master/n4m-handpose-master/node_modules/ajv.js.map: This warning occurs for every module (my guess) there are like a hundred all leading to the modules folder.

system Windows 11,

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

electroMedia666 commented 2 years ago

I looked into it more, since its weird facetracker and posenet work and this one doesn't. Thinking maybe its a Max problem. fyi (There are duplicates of many objects in the patch program copied over each other) and the sketch,js needs to be renamed, but these don't seem to be the real problem. Anyway, I discovered if I don't have a webcam plugged in while starting the node script it successfully loads the user interface and I was seeing the OBS load screen. Then If I run OBS and start Virtual Cam I can get the video, but if change the device drop down from 'blank' to OBS Virtual Cam then the screen goes black and it doesn't work again. Sorry I can't help more I only know some python and glsl. Hope this helps you narrow down the problem.

redshouldrd commented 2 years ago

Hi. Amazing project! I'm excited to experiment connecting MediaPipe tools to my Max Projects.

However, I'm having a similar problem as @electroMedia666, but on my Mac (OS 12.0.1, Max 8.1.11) I open the patch, push the button that installs dependencies, which completes, but my camera doesn't turn on and no data seems to be running through the patch.

Electron window that opens up is blank, and when I check it with the dev tools it lists the same first 3 errors @electroMedia666 lists above (but not error 4+5). I tried their OBS work around, and unfortunately it didn't work for me.

There aren't any errors in the Max console about video capture etc, --However, there is one error in the Max console that says, "can't find sketch.js." It took me a while to figure it out, but in the main window of the patch, there are 2 copies of the subpatcher "p fingerPositions" stacked on top of each other, both are patched into the same inputs and outputs. In one of the copies (the one "underneath" the other copy), in the sub-subpatcher "drawHandToWorld" there is a js object labeled "js sketch.js" which when I click on it does not have any code in it. ...I'm not sure if this is an error that might be affecting the video window

Any suggestions?

Thank you!

lysdexic-audio commented 1 year ago

@redshouldrd nice catch - thanks! the old "hidden double-stacked patcher" is an easy one to miss! I've fixed that on the latest commit. Can you give it a shot?

I'll try a windows machine to see if I can repro any of @electroMedia666 's issues

lysdexic-audio commented 1 year ago

I just bumped electron to the latest stable release 25.0.1 which allows the script npm install script in the init subpatcher to complete. I wonder if this might solve your device issues?

can you pull the latest commits from master here and try again?

you may need to wipe your node_modules dir and package-lock.json file.

on a fresh install, MacOS 12:

Screen Shot 2023-06-05 at 2 43 35 pm