Forums > MaxMSP

Multiple cameras?

February 4, 2009 | 8:02 pm

Hey everyone,

We’re on the startingpoint of a new project and I’m orientating about how to get this to work. The idea is to have 3 (web)cams, randomly switch between them and use it in a video-montage/layering. Is this possible to switch between usb-ports from inside Max? Is this possible at all? Where should I start looking for info?

Thanks in advance!
J.


February 5, 2009 | 2:34 am

Quote: Jpunt wrote on Wed, 04 February 2009 14:02
—————————————————-
> Hey everyone,
>
> We’re on the startingpoint of a new project and I’m orientating about how to get this to work. The idea is to have 3 (web)cams, randomly switch between them and use it in a video-montage/layering. Is this possible to switch between usb-ports from inside Max? Is this possible at all? Where should I start looking for info?
>
> Thanks in advance!
> J.
—————————————————-

I’d be very curious if you can get this to work. Look into the jit.qt.grab or jit.dx.grab (Windows) and see whether you can have three of these objects running simultaneously for the three different inputs. I seem to remember seeing "a grabber component is already open" and it not working, but my setup was different…

If it does work, you wouldn’t have to switch USB ports or anything at all. Instead use switches and gates in Max to only grab the one you want at the time, or modify the rate you grab each to conserve processing (three cameras is considerable grab-itude). Don’t use more resolution than you need (or that the cameras can provide) since that really gobbles up the CPU, and keep the aspect ratios the same if you scale up or down. Maybe scale a 640 x 480 down to 320 x 240, this would help a lot. For a montage-type effect, you might do well with grabbing frames from certain cameras infrequently rather than constantly, which will free up processing for effects etc.

Another option is to use one jit.qt.grab and switch between inputs, which requires a "close", select the new camera, then "open", which can be done but it takes a few seconds. This may not be a problem for a montage, as you could grab whatever frames you want into a jit.matrixset before closing one camera, then use these stored frames to mix with input from the next one—look into jit.xfade for simple fading, or you can use the video as GL textures on videoplanes that can move around, etc.

Sounds like a cool project!


February 5, 2009 | 7:25 pm

use a separate jit.dx.grab object for each digitizer, and route the
bangs to random ones.

On Feb 4, 2009, at 9:34 PM, Seejay James wrote:

>
> Quote: Jpunt wrote on Wed, 04 February 2009 14:02
> —————————————————-
>> Hey everyone,
>>
>> We’re on the startingpoint of a new project and I’m orientating
>> about how to get this to work. The idea is to have 3 (web)cams,
>> randomly switch between them and use it in a video-montage/
>> layering. Is this possible to switch between usb-ports from inside
>> Max? Is this possible at all? Where should I start looking for info?
>>
>> Thanks in advance!
>> J.
> —————————————————-
>
> I’d be very curious if you can get this to work. Look into the
> jit.qt.grab or jit.dx.grab (Windows) and see whether you can have
> three of these objects running simultaneously for the three
> different inputs. I seem to remember seeing "a grabber component is
> already open" and it not working, but my setup was different…
>
> If it does work, you wouldn’t have to switch USB ports or anything
> at all. Instead use switches and gates in Max to only grab the one
> you want at the time, or modify the rate you grab each to conserve
> processing (three cameras is considerable grab-itude). Don’t use
> more resolution than you need (or that the cameras can provide)
> since that really gobbles up the CPU, and keep the aspect ratios the
> same if you scale up or down. Maybe scale a 640 x 480 down to 320 x
> 240, this would help a lot. For a montage-type effect, you might do
> well with grabbing frames from certain cameras infrequently rather
> than constantly, which will free up processing for effects etc.
>
> Another option is to use one jit.qt.grab and switch between inputs,
> which requires a "close", select the new camera, then "open", which
> can be done but it takes a few seconds. This may not be a problem
> for a montage, as you could grab whatever frames you want into a
> jit.matrixset before closing one camera, then use these stored
> frames to mix with input from the next one—look into jit.xfade for
> simple fading, or you can use the video as GL textures on
> videoplanes that can move around, etc.
>
> Sounds like a cool project!
>
>
> –
> Interactive Media :: Concepts | Creation | Learning
> http://www.third-space-mind.com/


February 12, 2009 | 6:46 am

Ok, thanks for the replys!
The project is now officially started and I hope I’ve managed some extra cams by next week. The single webcam (build in isight in my macbookpro) is working, which wasn’t such a big operation. I’ll keep you posted on this!

J.


February 13, 2009 | 11:14 am

Little update about this.. it doesn’t seem to be rocket science! :)

{
"boxes" : [ {
"box" : {
"maxclass" : "message",
"text" : "1",
"patching_rect" : [ 684.0, 225.0, 32.5, 18.0 ],
"id" : "obj-23",
"fontname" : "Arial",
"numinlets" : 2,
"numoutlets" : 1,
"fontsize" : 12.0,
"outlettype" : [ "" ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "0",
"patching_rect" : [ 645.0, 225.0, 32.5, 18.0 ],
"id" : "obj-22",
"fontname" : "Arial",
"numinlets" : 2,
"numoutlets" : 1,
"fontsize" : 12.0,
"outlettype" : [ "" ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "metro 2",
"patching_rect" : [ 165.0, 75.0, 51.0, 20.0 ],
"id" : "obj-21",
"fontname" : "Arial",
"numinlets" : 2,
"numoutlets" : 1,
"fontsize" : 12.0,
"outlettype" : [ "bang" ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "vdevice $1",
"patching_rect" : [ 270.0, 285.0, 68.0, 18.0 ],
"id" : "obj-10",
"fontname" : "Arial",
"numinlets" : 2,
"numoutlets" : 1,
"fontsize" : 12.0,
"outlettype" : [ "" ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "t clear",
"patching_rect" : [ 375.0, 219.0, 43.0, 20.0 ],
"id" : "obj-14",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 1,
"fontsize" : 12.0,
"outlettype" : [ "clear" ]
}

}
, {
"box" : {
"maxclass" : "umenu",
"patching_rect" : [ 270.0, 255.0, 100.0, 20.0 ],
"id" : "obj-18",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 3,
"fontsize" : 12.0,
"outlettype" : [ "int", "", "" ],
"types" : [ ],
"items" : [ "DVCPRO HD (1080i50)", ",", "DVCPRO HD (1080i60)", ",", "DVCPRO HD (720p60)", ",", "DVCPRO HD (720p25/50)", ",", "DV Video", ",", "IIDC FireWire Video", ",", "USB Video Class Video" ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "prepend append",
"patching_rect" : [ 270.0, 219.0, 98.0, 20.0 ],
"id" : "obj-19",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 1,
"fontsize" : 12.0,
"outlettype" : [ "" ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "iter",
"patching_rect" : [ 270.0, 195.0, 27.0, 20.0 ],
"id" : "obj-20",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 1,
"fontsize" : 12.0,
"outlettype" : [ "" ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "close",
"patching_rect" : [ 264.0, 75.0, 39.0, 18.0 ],
"id" : "obj-8",
"fontname" : "Arial",
"numinlets" : 2,
"numoutlets" : 1,
"fontsize" : 12.0,
"outlettype" : [ "" ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "input $1",
"patching_rect" : [ 435.0, 285.0, 53.0, 18.0 ],
"id" : "obj-7",
"fontname" : "Arial",
"numinlets" : 2,
"numoutlets" : 1,
"fontsize" : 12.0,
"outlettype" : [ "" ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "getvdevlist",
"patching_rect" : [ 311.0, 75.0, 67.0, 18.0 ],
"id" : "obj-17",
"fontname" : "Arial",
"numinlets" : 2,
"numoutlets" : 1,
"fontsize" : 12.0,
"outlettype" : [ "" ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "t clear",
"patching_rect" : [ 540.0, 219.0, 43.0, 20.0 ],
"id" : "obj-16",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 1,
"fontsize" : 12.0,
"outlettype" : [ "clear" ]
}

}
, {
"box" : {
"maxclass" : "umenu",
"patching_rect" : [ 435.0, 255.0, 100.0, 20.0 ],
"id" : "obj-15",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 3,
"fontsize" : 12.0,
"outlettype" : [ "int", "", "" ],
"types" : [ ],
"items" : [ "Logitech Camera", ",", "Built-in iSight" ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "prepend append",
"patching_rect" : [ 435.0, 219.0, 98.0, 20.0 ],
"id" : "obj-13",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 1,
"fontsize" : 12.0,
"outlettype" : [ "" ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "iter",
"patching_rect" : [ 435.0, 195.0, 27.0, 20.0 ],
"id" : "obj-12",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 1,
"fontsize" : 12.0,
"outlettype" : [ "" ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "route vdevlist inputlist",
"patching_rect" : [ 270.0, 165.0, 125.0, 20.0 ],
"id" : "obj-11",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 3,
"fontsize" : 12.0,
"outlettype" : [ "", "", "" ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "getinputlist",
"patching_rect" : [ 390.0, 75.0, 68.0, 18.0 ],
"id" : "obj-6",
"fontname" : "Arial",
"numinlets" : 2,
"numoutlets" : 1,
"fontsize" : 12.0,
"outlettype" : [ "" ]
}

}
, {
"box" : {
"maxclass" : "jit.fpsgui",
"patching_rect" : [ 165.0, 855.0, 60.0, 35.0 ],
"id" : "obj-9",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 2,
"fontsize" : 11.595187,
"outlettype" : [ "", "" ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "open",
"patching_rect" : [ 219.0, 75.0, 37.0, 18.0 ],
"id" : "obj-5",
"fontname" : "Arial",
"numinlets" : 2,
"numoutlets" : 1,
"fontsize" : 12.0,
"outlettype" : [ "" ]
}

}
, {
"box" : {
"maxclass" : "toggle",
"patching_rect" : [ 165.0, 45.0, 20.0, 20.0 ],
"id" : "obj-4",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "int" ]
}

}
, {
"box" : {
"maxclass" : "jit.pwindow",
"patching_rect" : [ 165.0, 360.0, 640.0, 480.0 ],
"id" : "obj-3",
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "", "" ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "jit.qt.grab 640 480",
"patching_rect" : [ 165.0, 129.0, 107.0, 20.0 ],
"id" : "obj-2",
"fontname" : "Arial",
"numinlets" : 1,
"numoutlets" : 2,
"fontsize" : 12.0,
"outlettype" : [ "jit_matrix", "" ]
}

}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-11", 0 ],
"destination" : [ "obj-14", 0 ],
"hidden" : 0,
"midpoints" : [ 279.5, 190.0, 320.0, 190.0, 320.0, 210.0, 384.5, 210.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-11", 0 ],
"destination" : [ "obj-20", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-14", 0 ],
"destination" : [ "obj-18", 0 ],
"hidden" : 0,
"midpoints" : [ 384.5, 250.0, 378.0, 250.0, 378.0, 250.0, 279.5, 250.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-19", 0 ],
"destination" : [ "obj-18", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-20", 0 ],
"destination" : [ "obj-19", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-18", 0 ],
"destination" : [ "obj-10", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-15", 0 ],
"destination" : [ "obj-7", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-3", 0 ],
"destination" : [ "obj-9", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-12", 0 ],
"destination" : [ "obj-13", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-11", 1 ],
"destination" : [ "obj-12", 0 ],
"hidden" : 0,
"midpoints" : [ 332.5, 190.0, 444.5, 190.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-13", 0 ],
"destination" : [ "obj-15", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-11", 1 ],
"destination" : [ "obj-16", 0 ],
"hidden" : 0,
"midpoints" : [ 332.5, 190.0, 549.5, 190.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-16", 0 ],
"destination" : [ "obj-15", 0 ],
"hidden" : 0,
"midpoints" : [ 549.5, 250.0, 543.0, 250.0, 543.0, 250.0, 444.5, 250.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-4", 0 ],
"destination" : [ "obj-21", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-22", 0 ],
"destination" : [ "obj-15", 0 ],
"hidden" : 0,
"midpoints" : [ 654.5, 248.0, 444.5, 248.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-23", 0 ],
"destination" : [ "obj-15", 0 ],
"hidden" : 0,
"midpoints" : [ 693.5, 246.0, 444.5, 246.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-6", 0 ],
"destination" : [ "obj-2", 0 ],
"hidden" : 0,
"midpoints" : [ 399.5, 110.0, 174.5, 110.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-17", 0 ],
"destination" : [ "obj-2", 0 ],
"hidden" : 0,
"midpoints" : [ 320.5, 110.0, 174.5, 110.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-8", 0 ],
"destination" : [ "obj-2", 0 ],
"hidden" : 0,
"midpoints" : [ 273.5, 110.0, 174.5, 110.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-5", 0 ],
"destination" : [ "obj-2", 0 ],
"hidden" : 0,
"midpoints" : [ 228.5, 110.0, 174.5, 110.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-21", 0 ],
"destination" : [ "obj-2", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-2", 0 ],
"destination" : [ "obj-3", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-2", 1 ],
"destination" : [ "obj-11", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-7", 0 ],
"destination" : [ "obj-2", 0 ],
"hidden" : 0,
"midpoints" : [ 444.5, 317.0, 623.0, 317.0, 623.0, 120.0, 174.5, 120.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-10", 0 ],
"destination" : [ "obj-2", 0 ],
"hidden" : 0,
"midpoints" : [ 279.5, 321.0, 628.0, 321.0, 628.0, 116.0, 174.5, 116.0 ]
}

}
]
}


February 13, 2009 | 11:37 am

>Hey everyone,
>
>We’re on the startingpoint of a new project and I’m orientating
>about how to get this to work. The idea is to have 3 (web)cams,
>randomly switch between them and use it in a video-montage/layering.
>Is this possible to switch between usb-ports from inside Max? Is
>this possible at all? Where should I start looking for info?

sorry for the late answer (I was touring) but I did a few projects
with multiple cameras (using either jitter of softVNS). I always used
the unibrain Fire-I cameras
(http://www.unibrain.com/Products/VisionImg/Fire_i_DC.htm) and
basically never had any serious problems with them. They were all
dasy-chained (and went to Fire-Wire input) and I could either have
(in one case) all 3 of the cameras displayed, and
activated/deactivated from my computer (a mac) or (another project) 4
of them where 1 of those was switched ON, the other OFF, but the ON
one was changed at random (a little bit like the cams in shops)

With those cameras this part of the process always was easy

hope it stil helps (even if your project seems to be already working)

kasper

Kasper T. Toeplitz
noise, composition, bass, computer

http://www.sleazeArt.com

http://www.myspace.com/sleazeart


February 13, 2009 | 11:52 am

Hey!
Yesterday we’ve bought a Logitech (usb), but now were thinking about returning it and go for these Fire-i’s. What’s your experience with the delay while switching between cams? For my iSight and Logitech it’s about a second, but when it’s seamless with these fw-cams, we’re sold :)

J.


February 13, 2009 | 1:23 pm

>Hey!
>Yesterday we’ve bought a Logitech (usb), but now were thinking about
>returning it and go for these Fire-i’s. What’s your experience with
>the delay while switching between cams? For my iSight and Logitech
>it’s about a second, but when it’s seamless with these fw-cams,
>we’re sold :)

I am just having a look at the patch i did (it was a long time ago,
don’t remember it so well…….) but it seems (and that’s my
memories) that since I can see all 4 cams on my mac at once, at all
times, switching (on another screen, another jit.pwindow) the image
seen is no more than a router or similar object….
in any case 1 second seems long (maybe there was a glitch in images,
but no wait)

throught the years I bought probably between 7 or 10 Fire-I, now
(only) one is broken…….. and they eve were used in inslatts,
concerts, on the road

hope it helps

kasper


Kasper T. Toeplitz
noise, composition, bass, computer

http://www.sleazeArt.com

http://www.myspace.com/sleazeart


February 13, 2009 | 1:45 pm

Sounds great dude! Did you remember the resolution you were working with? And one final question.. :) Do you think the quality is good enough for some keying?

Thanks for your support!


February 13, 2009 | 2:08 pm

>Sounds great dude! Did you remember the resolution you were working with?

the final image was 640×480 – but showed fullscreen. Not sure why I
came with this… it was actually someone else’s project, I have
never seen (but i did the patch)

>And one final question.. :) Do you think the quality is good enough
>for some keying?

here it is my english….. keying? what do you mean?

best

kasper

Kasper T. Toeplitz
noise, composition, bass, computer

http://www.sleazeArt.com

http://www.myspace.com/sleazeart


February 13, 2009 | 2:20 pm

http://en.wikipedia.org/wiki/Chroma_key

In other words, use a green background and filter all that color out so you can give it a different background (see attachment for a patch). Fortunately our concept doesn’t need a 100% professional key, but it would be nice if the webcam gives a clear webcam with the least motion-blur as possible.

Just curiosity: Where are you from?


February 13, 2009 | 6:40 pm

Quote: Jpunt wrote on Fri, 13 February 2009 08:20
—————————————————-
> http://en.wikipedia.org/wiki/Chroma_key
>
> In other words, use a green background and filter all that color out so you can give it a different background (see attachment for a patch). Fortunately our concept doesn’t need a 100% professional key, but it would be nice if the webcam gives a clear webcam with the least motion-blur as possible.

—————————————————-

Should be no problem with jit.chromakey. You can use any color you want, not just green. Put a [suckah] over the source video so you can click on the green area to choose the color. Another trick if you don’t have a green screen is to use a projector that’s not putting out any image, just the "standby" blue color (without any menu words etc. on there). If this is projected onto a white wall and the ambient light is low, this will work great, though the overall light might not be enough for you otherwise.

Also, if your subjects are wearing black, you can "reverse-chromakey" it: you click the blue and you get standard keying, but if you click the black subjects you get the reverse—that is, the person becomes transparent against the blue and you can see the second video through it. A nice effect, plus once it’s keyed, you can convert the blue to white (jit.unpack just the blue channel and send it to all three RGB using a jit.pack) and it’ll become white. Then you can use jit.scalebias to turn the white to any color you want.


February 13, 2009 | 6:43 pm

I already know how keying works (take a look at the attached patch). I was asking about this specific webcam and its quality and thus its capability of keying. But thanks anyway!


February 13, 2009 | 6:55 pm

Quote: Jpunt wrote on Fri, 13 February 2009 12:43
—————————————————-
> I already know how keying works (take a look at the attached patch). I was asking about this specific webcam and its quality and thus its capability of keying. But thanks anyway!
—————————————————-

No problem, hope it’s good enough for what you need. I haven’t tried a webcam with this but my DV camcorder works quite well for keying, plus it’s nice with the zoom etc. of course it’s more pricey though :

also if you have dual core processors (or more) you should patch to take advantage of this, especially with multiple cameras as inputs, to speed things up. My understanding is that you put the heavy-lifting processing in separate poly~s and they’ll get distributed to each core. so probably put a grab-plus-movie keying element in each poly~, then the outputs get combined/displayed/recorded in the main patch level. I haven’t tested this regarding frame rate increase, but the docs specifically recommend doing it if possible.


February 13, 2009 | 7:06 pm

Oh wow, that’s interesting. I’m not familiar with this poly-stuff, but I’ll defiantly take a look at it since there will be a lot more going on while recording the feed as well. I’m running on a Intel Core2Duo, so it would be great to take advantage of the multicore-setup indeed!
I’ve tested this keying with my build-in webcam, witch was fine for us, but before buying an extra cam I wanted to check if that one is good enough as well :)
Does someone has some feedback about the Fire-i?


February 13, 2009 | 7:17 pm

Nevermind. I’ve done some googling and everyone’s telling me it’s quality is as good as the old firewire-iSights. I’m convinced, so tomorrow I’ll order some of these! :)


April 16, 2009 | 10:42 am

Guess what, I’m back! Smile

We’ve had the Fire-i webcams, but the quality was extremely disappointing. So now we’ve managed some regular miniDV-cams (well, one of them is a brand new Sony HDV, that downscales the feed to DVPAL). My patch worked great with the Fire-i’s linked trough each other, but with these two DV-cams linked trough a firewire-hub things are breaking down. It seems it’s not possible anymore to have the two cams as separate inputs simultaneously, so it only works when I unplug one of them. Is there something I can try to fix this?

Thanks!
J.


April 16, 2009 | 12:22 pm

Nevermind (again..). I’ve just discovered that multiple instances of videoinput is NOT supported for DV (http://www.cycling74.com/twiki/bin/view/FAQs/JitterCameras#Can_I_use_more_than_one_video_in). Guess we’ll use the builtin iSight as one of the cams.. Sad


Viewing 18 posts - 1 through 18 (of 18 total)