Git Product home page Git Product logo

Comments (46)

GertjanBiasino avatar GertjanBiasino commented on July 30, 2024 1

Hi,

I had the same issue where the webcam list wouldn't update and the mediapipe tox would keep loading. And only somethimes after a while the webcam list would update.

I found out that if i change 1 line in the websocket1_callbacks i got it to work but I'm not a good coder so i don't know if that is a good sollution:

I saw that the webcam_list dat was not updating.

so in the websocket1_callbacks I saw the line: op('webcam_list').text = json.dumps(data['devices'])
If i add this line to "if 'error' in data:" The list updates.

def onReceiveText(dat, rowIndex, message):
	if(message == 'ping'):
		dat.sendText('pong')
		return
	if not message:
		return

	try:
		data = json.loads(message)
		if 'type' in data:
			op('webcam_list').text = json.dumps(data['devices'])
		
		if 'error' in data:

			op('webcam_list').text = json.dumps(data['devices']) 

			if (data['error'] == 'webcamStartFail'):
				print('Webcam failed to start, please ensure camera input is 720p, 8 bit. Component reloading')
				op('webBrowser1').allowCooking = False
				op('webBrowser1').par.Address = op('current_url').text
				run("me.parent().op('webBrowser1').allowCooking = True", delayMilliSeconds = 3000)
				me.parent().addScriptError('Webcam failed to start, please ensure camera input is 720p, 8 bit. Component reloading')

	except Exception as e:
		return
		#print("Error processing JSON: ", e)
	
	return

I don't know if its a good idea to do this but it seems to work now.

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

Hi @duemo I have the same issue on my laptop- I can either use my webcam in MediaPipe or a VideoDeviceIn TOP, but not both at the same time.

To get around this, I use SpoutCam. The chain you have there is used for this. The Video Device In TOP is used for your webcam, that gets sent to Syphon Spout Out TOP. You then run SpoutCam to receive that video, and select SpoutCam as the source in MediaPipe.

Take a look at our intro video for how to set it up 😊

from mediapipe-touchdesigner.

morphesgit avatar morphesgit commented on July 30, 2024

Unfortunately this method does not work on my M1 :( I'm on Sonoma 14.0.
Screenshot 2023-10-12 at 3 40 53 PM
Screenshot 2023-10-12 at 3 40 39 PM

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

Hi @vassmal the Media Pipe component currently requires 1280 x 720, 8 bit video to work. If you make sure your OBS output is that size, it should work

from mediapipe-touchdesigner.

duemo avatar duemo commented on July 30, 2024

Hi again,
thank you for pointing this out.
I managed to use Spout to make it work via OBS in virtual camera.
But not with SpoutCam only.

Another issue, I can't reopen my projects, I have to drag a new MediaPipe.tox component each time.
MediaPipeNotConnected

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

Hi @duemo can you take a screengrab of the error on the MediaPipe component to see what it says?

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

We just released yet another bug fix update to the plugin that may address this issue https://github.com/torinmb/mediapipe-touchdesigner/releases/tag/v0.3.2

from mediapipe-touchdesigner.

Celebryani avatar Celebryani commented on July 30, 2024

Same issue on Mac running 13.4.1. MediaPipe not able to use camera. I think see a bit of possible Torin's stuff? "T's iPhone Camera" - also the rest of the cameras listed in dropdown I am assuming are from testing. I did try pulsing the reset button in media pipe component, as well as deactivating the VideoFileIn. I have issues on Windows 10 as well, but will document them separately in this ticket.

MacBook Pro - Intel; 13.4.1
TD build .33910
MediaPipe release 0.3.2

image image

from mediapipe-touchdesigner.

Celebryani avatar Celebryani commented on July 30, 2024

disregard the Mac issue - I upgraded touch designer and works great now and only shows my cameras. I am a little alarmed that one of the devices listed is my iPhone camera and it turned on automatically.

But I do have issues on Windows 10 running 35320 where I can either have MediaPipe defined as camera, or videofilein. Sometimes on project open I get the "red river of errors" as duemo showed. The mediaPipe error is the same as my Mac error above (script errors, error (parameter menu source: Webcam). Only my Logitech is listed as available webcam.

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

Hi @Celebryani it sounds like the issue might be because you (maybe only occasionally, maybe only on your Windows machine) have something else running on the same network port that Media Pipe is using. It defaults to 3002 and if you change it to something else (3003 should do it) then that may fix your issues.

image

I've put a change into the code that will auto-select a free port that will be in future builds, so this shouldn't be a problem in the future, but for now manually picking another port should get things working more reliably.

from mediapipe-touchdesigner.

StudioBeneden avatar StudioBeneden commented on July 30, 2024

Same issue on Mac running 13.4.1. MediaPipe not able to use camera. I think see a bit of possible Torin's stuff? "T's iPhone Camera" - also the rest of the cameras listed in dropdown I am assuming are from testing. I did try pulsing the reset button in media pipe component, as well as deactivating the VideoFileIn. I have issues on Windows 10 as well, but will document them separately in this ticket.

MacBook Pro - Intel; 13.4.1 TD build .33910 MediaPipe release 0.3.2

image image

I have got this exact same issue, the list won't update to my own devices. (I just get the Ts iPhone etc. list) while de videodeviceIn1 in in the example does. I'm on build 35320 Mac osX 13.6, the latest MP release already tried changing the network port as well.

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

Hi @StudioBeneden if you try changing the MediaPipe port from 3002 to something else (3003 should work) does it fix your issue?

from mediapipe-touchdesigner.

StudioBeneden avatar StudioBeneden commented on July 30, 2024

Hi @StudioBeneden if you try changing the MediaPipe port from 3002 to something else (3003 should work) does it fix your issue?

sadly, changing the port number doesn't help :( both when I open the .toe example or add the 'MediaPipe.tox' to a new project and change the port, I always get the 'test' camera list as mentioned before. The 'webcam_list' Table DAT in the MediPipe container lists these camera's. from your project, I can't really tell what should make or force this table te update to the camera list of my system.

Screenshot 2023-11-20 at 22 43 10

when I look into the 'info1' DAT that's within the 'webBrowser1' Container, I see a discrepancy between the title (port 3003) and the URL (3002) that is called...

Screenshot 2023-11-20 at 22 53 03

atm for me it's really hard to tell if there's something wrong with the code or that I'm doing something totally wrong myself...

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

Thanks for the extra info @StudioBeneden

Internally the plugin is using a web server and Chromium browser to host all the MediaPipe tools. That error 102 from Chromium means "connection refused", so it looks like the port the web server is running on is either being blocked by something else using that exact port (seems unlikely if you already tried another port), or some kind of antivirus or firewall you may be running.

from mediapipe-touchdesigner.

StudioBeneden avatar StudioBeneden commented on July 30, 2024

hm.. this is a strange situation. I'm not running any antivirus / local firewall as far as I'm aware. The connection with the web server doesn't work on any of the port numbers I select. however, setting up a simple localhost OSC connection works fine on all selected port numbers. So as far as I can tell, the ports are not blocked. When I change the port number and pulse 'reset' on the 'MediaPipe' container textport starts putting out the messages below:

Screenshot 2023-11-21 at 00 12 59

Probably the 'webcam failed to start' is triggered by the fact that the camera is not recognised and therefore the webserver receives an empty or NULL canvas... (the 'data change send...' flipping from '0' '1' a number of times is probably me pushing the 'Reset' button repeatedly :)) Looks like it's trying random ports in the 64000 range for something, but I hope these messages are more telling to you.

I'm really curious what's happening here. I have successfully had the plugin working on this same machine before. As far as I know there have been no drastic changes to the computer (when it comes to OS versions or other media pipe installs)

Thank you for your help and effort!

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

Ah ok, so that's progress - the page is loading and it just can't start a webcam.

Can you disable the Video Device In TOP at the bottom of the project? I suspect you've got a webcam that can only be used in one place at a time, and the Video Device In TOP and MediaPipe are trying to use it at the same time, so it's not working and loading properly.

from mediapipe-touchdesigner.

StudioBeneden avatar StudioBeneden commented on July 30, 2024

Hi again :) sorry for the delay.. I already tried that. Disabling (or even deleting) the videoDeviceIn and refreshing the MediaPipe container does not help. The Webcam device list just doesn't get populated with my own devices. I've just tried the 0.31 version (which has been working on this same computer before). there the MediaPipe comp returns an 'index out of range' maing it look like it fiends no camera's at all on the system. This begins to look a lot like something is blocking the chromium browser from accessing any webcams. (just like apple was doing on any processing made projects before..) 'regular' applications that use webam are working fine. I'll dive into this later.
Uploading Screenshot 2023-11-23 at 08.48.03.png…

from mediapipe-touchdesigner.

duemo avatar duemo commented on July 30, 2024

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

Glad you got it all working @duemo and yes please use the component in your work! If you can tag us in whatever you post that would be great, then we can see all the cool things people are making with the plugin :)

from mediapipe-touchdesigner.

StudioBeneden avatar StudioBeneden commented on July 30, 2024

"if 'error': just do whatever you should be doing without the error..." It's kind of brute force, but it get's the job done for now :) Thank you so much for this workaraound! Still curious what's going wrong here (and glad that I wasn't the only one facing this..) it seems the error message is caused / called by something else than the camera list. Yet prevents MediaPipe from loading the list (at least how it's in the code)... some mismatch in communication / sync? For now I can continue with my projcet, thanks again!

from mediapipe-touchdesigner.

StudioBeneden avatar StudioBeneden commented on July 30, 2024

Totally off topic: GertJan, I only just now read who the sender was :) We've met a couple of times (isadora werkstatt Berlin, Interactive Performance lab Amsterdam (with the microsocope)). I'm Job, (Dutch guy from HKU). Hope to meet again!

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

Thanks so much for taking the time to dig into this issue! I used your findings as a starting point and figured out what was going on.

I put a change in the last version that says "if the webcam fails to start, throw up an error, kill the Chromium browser instance, wait a few seconds, and restart it". That's a decent way of fixing a frozen webcam issue that I'd been seeing, but it had an unintended consequence... Whenever you open the plugin, TD remembers the webcams from last time it was run and tries to start that webcam again. That works fine most of the time, but when you're running the plugin for the first time on a new machine (e.g. when you run it after Torin last ran it to make the build), none of those webcams exist, so it will always fail to start the webcam. You then got stuck in the loop of killing the instance and reloading trying to get it to work.

It took a bit of head scratching, but I put a fix into the Javascript side of things so now Chromium checks to see if the webcam it's being asked to load actually exists. If it doesn't, then it skips the webcam startup bit and loads the rest of the page. That in turn sends the list of actual webcams back to TD, TD picks a new webcam to use, now it all works.

And if the webcam does exist and fails to start, my originally intended error and reload thing still works. This is useful if you've got the webcam running elsewhere - once you disable the webcam elsewhere, the MediaPipe plugin will reload and now the camera will work without you having to do anything.

While I was in there I also updated the webcam failed to start message so it now ask "is it being used elsewhere?" as that seems to be the most common reason for the webcam failing to start inside MediaPipe.

I pushed the change into main, so it will get scooped up next time we do a build. In the mean-time, the workaround @GertjanBiasino posted is fine - it means it won't give you an error and auto-reload if the webcam does fail to start, but you can just pulse the reset button manually if you get a forever loading screen.

from mediapipe-touchdesigner.

vbrvxvs avatar vbrvxvs commented on July 30, 2024

I can't change my webcam resolution. I use logitech c615 hd webcam, and i can see it in devices. I can see image inside the mediapipe comp, but deafult resolution is 640x480, which is lower, the required. Where can i change the desired resolution, like i can do it in videodevicein TOP?
image

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

@vbrvxvs if your webcam image is appearing in the MediaPipe window then everything is already working at 720p - there's nothing to do.

I might update the 720p message, as it's really only going to be an issue when using OBS or SpoutCam

from mediapipe-touchdesigner.

Ayeshmantha-Maduranga avatar Ayeshmantha-Maduranga commented on July 30, 2024

Screenshot 2023-12-04 043316
how to fix this error

from mediapipe-touchdesigner.

vbrvxvs avatar vbrvxvs commented on July 30, 2024

@vbrvxvs if your webcam image is appearing in the MediaPipe window then everything is already working at 720p - there's nothing to do.

I might update the 720p message, as it's really only going to be an issue when using OBS or SpoutCam
Thx for the reply!

It might be automtically fitting, but its definately not 720p, due to the aspect change in preview. You can see it on screenshot:
image
The camera launches in the lowest default resolution and i can't change it. Due to different aspect, the overlaying skeleton is shifted to the side.

Is there a way to use a texture for tracking directly from Touchdesigner? I want to mask the unwanted parts of image, so they can't be seen in mediapipe module.

from mediapipe-touchdesigner.

vbrvxvs avatar vbrvxvs commented on July 30, 2024

I've just figured out, that my camera has two 720p modes, one is 4:3 and the second is 16:9. So it looks like module gets from camera right resolution, but wrong aspect.

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

Ohhh interesting - thanks for taking the time to dig into that one further @vbrvxvs . I didn't realise 4:3 720p was even a thing! I will add in another requirement to the code that starts the webcam to specify both 720p and 16:9 aspect ratio, which will get scooped up into our next release.

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

@Ayeshmantha-Maduranga does this solve your issue? #45 (comment)

from mediapipe-touchdesigner.

corlangerak avatar corlangerak commented on July 30, 2024

Hi @Celebryani it sounds like the issue might be because you (maybe only occasionally, maybe only on your Windows machine) have something else running on the same network port that Media Pipe is using. It defaults to 3002 and if you change it to something else (3003 should do it) then that may fix your issues.

image

I've put a change into the code that will auto-select a free port that will be in future builds, so this shouldn't be a problem in the future, but for now manually picking another port should get things working more reliably.

@domisjustanumber
Thank you for your sollution, however even when I change the line in the code. my table with 'webcam_list' still does not update with my own devices... Do I need to pulse or reset anything other then the websocket?

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

Hi @corlangerak can you try the latest release from a couple of days ago, as this includes the fixes I mentioned above?
https://github.com/torinmb/mediapipe-touchdesigner/releases/tag/v0.3.3

If it still doesn't work, can you open the text port (Ctrl T) to show me what it says in there?
It would also be useful to see the contents of the Chromium log. If you can open a Chrome browser and go to http://localhost:9222 that should give a bunch of debug too.

from mediapipe-touchdesigner.

corlangerak avatar corlangerak commented on July 30, 2024

Hi thank you for your reply!
I am using the latest version release.
This is what the textport shows.
Uploading Screenshot 2023-12-06 at 12.12.54.png…

However, if I go to the Link you send me, I see a blank page saying: "Inspectable WebContents"

from mediapipe-touchdesigner.

corlangerak avatar corlangerak commented on July 30, 2024

@domisjustanumber and then this:
Screenshot 2023-12-06 at 12 17 31

Thanks a lot fro your help!

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

Thanks for the textport image @corlangerak . That's a new error on me, so that Chromium log would be really useful. When you go to the url I provided, you should get a black page with a big long link on it that starts with http://localhost:......

If you click that, the debug console should come up. If you can get a screenshot of that, it might help me see what is going on.

from mediapipe-touchdesigner.

corlangerak avatar corlangerak commented on July 30, 2024
Screenshot 2023-12-06 at 16 45 11

This is what I see..

from mediapipe-touchdesigner.

Sungugu-OwO avatar Sungugu-OwO commented on July 30, 2024

Hi, Torin and Dom,
I'm running your plugin on my window, but TouchDesigne seems to be having a lot of problems with errors.
Snipaste_2023-12-28_23-45-45

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

Hi @Sungugu-OwO can you move your mouse over the MediaPipe component to see what the error message says?

If you also press Alt T it will open the text port with more debug information

from mediapipe-touchdesigner.

Sungugu-OwO avatar Sungugu-OwO commented on July 30, 2024

Worry.jpg
image
image

嗨,您可以将鼠标移到 MediaPipe 组件上以查看错误消息的内容吗?

如果您还按 Alt T,它将打开包含更多调试信息的文本端口

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

Ahh ok, I think the problem might be the same one found here: #60

I'm not sure how to work around it, but I put a fix in for the next release that will (hopefully) fix it.

from mediapipe-touchdesigner.

kikikida avatar kikikida commented on July 30, 2024
2e70a21a35f2d7f5318f5380656b7a4 Hello I want to ask why I have my spoutcam in downside videodivein but cannt find it in webcam in mediapipe

from mediapipe-touchdesigner.

kikikida avatar kikikida commented on July 30, 2024

And mine seems a little different like I cannr change mediapipe port I just open it directly after download thank you si much if you can help me

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

Hi @kikikida you can change the MediaPipe port if you disable "Auto select port number"

Do any of the webcams work correctly in mediapipe? Or is the problem just SpoutCam not appearing in the drop down?

from mediapipe-touchdesigner.

kikikida avatar kikikida commented on July 30, 2024

It seems that the spoutcam appear it the device in videodivein but not in mediapipe webcam I download different types seems all have the same problem

from mediapipe-touchdesigner.

kikikida avatar kikikida commented on July 30, 2024

2548759634256781
mine always look like this

from mediapipe-touchdesigner.

kikikida avatar kikikida commented on July 30, 2024

881265441190787380
and its the error mediapipe report

from mediapipe-touchdesigner.

domisjustanumber avatar domisjustanumber commented on July 30, 2024

Anyone having issues with:

  • Webcam not starting
  • Webcam starting with a black bar down the side / wrong resolution
  • tdu.TableMenu error (shown in previous post screengrab)
  • MediaPipe plugin sitting there loading forever

I would like to suggest you try the new release as I did a bunch of fixes to try and resolve those issues https://github.com/torinmb/mediapipe-touchdesigner/releases/tag/v0.4.1

If you are still encountering issues please start a new Issue with as much detail as you can and we'll take a look at what's going on.

from mediapipe-touchdesigner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.