aimc
Posts: 36
Joined: Mon Jun 30, 2014 2:58 am

Two webcams

Mon Jul 06, 2015 7:20 pm

Hello,
I have successfully set up a motion security camera, i can even watch it from my browser and all that.

For another different project, i would need to be able to "switch" between two USB webcams connected to the pi. Do you think this is possible?

From what i understand, the USB bandwidth would be a problem, but the idea is to turn off one of the USB cameras (if necessary) while the other one is being used, so that each webcam records at its best.

(sorry my horrible english , i'm not a native speaker)

gordon77
Posts: 5133
Joined: Sun Aug 05, 2012 3:12 pm

Re: Two webcams

Mon Jul 06, 2015 8:18 pm

It's possible
viewtopic.php?f=43&t=96657&p=671902#p671902

I posted some python later in this thread

aimc
Posts: 36
Joined: Mon Jun 30, 2014 2:58 am

Re: Two webcams

Tue Jul 07, 2015 2:10 am

Great, i understand the code, the most relevant part here is just what i needed:

Code: Select all

camera = 0
cam = pygame.camera.Camera("/dev/video" +str(camera),(640,480))

Return to “Advanced users”