Multiple Webcams

LOONASCRIPT.ls's icon

Hello!

Currently working on a project where I would like to use multiple camera feeds (ideally 4-5). I am testing out 3 webcams at the moment to see if it works. When I use two it's fine, but once I connect all three, the framerate for all three of them drops significantly.

I am using 3 instances of jit.grab found from the help file, and (ultimately) using a midi controller to swap through the three camera feeds. I also found that making the metro value attached to the jit.grab higher when a camera isn't being used has helped, but once the third camera is on, the framerate is still ridiculously slow.

Hardware/Flow:

Using a USB hub to connect two cameras to the laptop through one of the USB-C port, and then connecting the third camera through the second USB-C port.

2 Logitech c922

1 Logitech c920

Mac Air M2, Tahoe 26.6

Max 9

multicam_test.maxpat
Max Patch

LSka's icon
  1. Use one single qmetro to drive all three jit.grab

  2. use the attribute @unique 1 for jit.grab, so they'll output only new frames

  3. use textures instead of matrices (look here: https://cycling74.com/tutorials/best-practices-in-jitter-part-1)

TFL's icon
  1. Use your [gate] to route bangs from the single [qmetro] to the desired [jit.grab] instead of routing outputs of the various [jit.grab], since you want to use only one at a time anyway.

Wil's icon
  1. If you use jit.world you dont need a qmetro at all.

Here is a patch I grab three different cameras at the same time . Each one running independently and drawing to different areas of the window. Frame rate well over 100fps.

Change the [s grabber1] to 2 and 3 to render /mix/affect /effect each one differently.

Max Patch
Copy patch and select New From Clipboard in Max.

Robert Ramirez's icon

and even with all these good tips, I'd be surprised if you can get more than 3 webcams going on a single machine. would be happy to hear about any experiences to the contrary.

LOONASCRIPT.ls's icon

Thanks all of y'all for the help. I got four web cams running now with crisp feeds.