Grab single frame from webcam on Windows

Node-RED version: v4.0.2
Node.js version: v20.7.0
Windows_NT 10.0.19045 x64 LE

I'm running the following command in an exec node D:\PortablePrograms\Cam2ip\cam2ip.exe with the additional parameters -width 1920 -height 1080 -bind-addr ":4567" -nowebgl included.

It used to work fine but since updating it seems to spawn a console window regardless of if the Hide console option is checked of not. I tried setting a timeout but that only seems to kill the main process/PID that the node reports. However, that PID does not seem to match the running executable (cam2ip.exe) so it doesn't get killed properly nor does the console window process.

Now, I'm assuming that is because the console window is a subprocess. What are my options here? Can I run it backgrounded somehow? Or at least kill the processes automatically after a short delay?

I'm basically just using it to grab a single frame from my webcam then kill the process. Does anyone know of a simple alternative program or method to achieve a similar result?

What version of Node and node-RED did you use before.

There was a change in how Node spawns processes in V18.x that might somehow be related.


As for your issue - cam2ip has a URL that returns a single image. So if you run cam2ip in the background then you should be able to use the HTTP request node to grab an image at any time from http://localhost:56000/jpeg

I recently upgraded from:
Node-RED version: v3.0.2
Node.js version: 18.15.0

And as you suspected, I was using it with a HTTP request node to grab it

However, I also updated cam2ip, and It does spawn a console window even when launched outside of Node-RED so I'm lead to believe that it's not just a "Node.js" change?

I was hoping not not have to leave it running all the time, but if I have to make that compromise than so be it.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.