8

I want to have multiple USB webcams running on a single Raspberry Pi. I will put them through a powered hub. I want the webcams to take stills simultaneously (or as simultaneously as possible - a second or two delay isn't a big deal) and save the images to a memory stick, each image will have the same name beginning but then cam1, cam2, cam3 etc. to differentiate them from each other.

Is this possible? If so, what number of webcams am I limited to? Also, how would I address them, can fswebcam control more than one webcam?

If it isn't possible, can anyone tell me why not?

1

2 Answers 2

6

Theoretically, yes. It's possible to connect as many webcams as you can as long as they're powered up as per their requirements.

How do you address them ?

Each usb web cam that you connect gets listed under /dev/video<n> where n = 0,1,2 .. as number of video devices increase. Ie, if I connect two webcams to my system, I would be able to see two entries /dev/video0 and /dev/video1 when I fire ls /dev/video*.

I've not used fswebcam personally but its documentation suggests that using -d flag you can specify a particular webcam. Default is /dev/video0. You can run multiple instances of fswebcam to capture images from all the cams simultaneously.

However, USB bandwidth bottleneck is entirely a different issue as you keep on adding devices.

Hope it helps.

3
  • Fantastic answer, thank you. I will crack on and see if I can make it work. Jul 24, 2015 at 23:50
  • @MattHowarth Glad that it helped. You may want to upvote / mark it as the right answer if it answers your query. :) Jul 25, 2015 at 5:46
  • Hi Dastaan, I have given it the tick, but I can't increase the vote because I'm new to the group, I will up vote it as soon as I can. It definitely answers my questions, thanks again: ) Jul 25, 2015 at 11:39
2

thank you dastaan, your answer help me so much, finally I take a picture with fswebcam --device <device> <filename>

here is the example, I'm gonna take a picture and save it to image.jpg:

my first webcam

fswebcam --device /dev/video0 image.jpg

and my second webcam

fswebcam --device /dev/video1 image.jpg

you can check your device with

ls /dev/

hope it helped for the others

1
  • Hello and welcome. I have edited your answer according to some formatting styles we use here... and removed the . which I thought wrong. If something does not add up with the edit feel free to roll back or correct.
    – Ghanima
    May 15, 2016 at 23:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.