0

I'm a semi-new user to the raspberry pi USB webcam world, although I'm used to the RPi camera. My question is, can I use two cameras taking pictures at the same time without the pictures being overwritten by the other camera? Would I be able to use the RPi command or do I have to use C or cron? Any help would be appreciated.

0

You can't use the RPi camera commands with a webcam. Those only work with the pi camera. However, there are other options for reading input from a webcam. One of the most commonly used tools for this is fswebcam. There are other options too, though.

Install fswebcam with sudo apt install fswebcam. Then, you can use it with command

fswebcam image.jpg --no-banner -i 0

To use the second webcam, just change the -i or --input switch to -i 1 instead of -i 0.

Fswebcam has some other options as well, such as the -r switch to change the resolution, or the -l switch to take an image every x seconds. You can find the fswebcam documentation here.

And yes, the cameras should work together. They should each mount at different files: /dev/video0 and /dev/video1.

Hope this answer helps!

  • 1
    I used the same but it shows error like this pi@raspberrypi:~ $ fswebcam image.jpg --no-banner -i 1 --- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. Unrecognised input "1" I tried using fswebcam image.jpg --no-banner -i 2, but it shows same error. What to do to run two webcam together? Thanks. – Naseeb Gill Jun 12 '19 at 11:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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