Eddie9827
Posts: 1
Joined: Wed Nov 02, 2016 8:53 pm

raspberry pi 3 multiple cameras with recording function

Wed Nov 02, 2016 8:58 pm

I'm doing a surveillance system project of multiple cameras on a Raspberry Pi with a recording function. Is it possible to record video from two or more cameras at the same time from a single Raspberry Pi board?

I bought a multiplexer from ivmech, but only one of the cameras can be switched on at a time.
http://www.ivmech.com/magaza/en/develop ... lexer-p-90

Is there any solution for recording video simultaneously from either Raspberry Pi cameras or USB cameras? Any kind of help will be appreciated.

pootle
Posts: 436
Joined: Wed Sep 04, 2013 10:20 am
Location: Staffordshire

Re: raspberry pi 3 multiple cameras with recording function

Wed Nov 02, 2016 11:35 pm

even a pi3 would struggle to record video from 2 usb webcams simultaneously I expect - mostly to do with the fact there is only 1 usb channel into the cpu. I suspect the best answer would be to use raspberry pi cameras on pi zero's.

When you say record, what are you recording to? recording to the sd card will limit the amount recording you can keep and you would need to check that your sd card is up to the job. sd cards vary widely when used as computer 'disc' drives - and price is no guarantee of performance .

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 13235
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: raspberry pi 3 multiple cameras with recording function

Thu Nov 03, 2016 11:46 am

If the USB webcam is doing the video encoding (eg https://en.wikipedia.org/wiki/List_of_c ... ompression), then you have a chance. H264 is better than MJPEG. Taking multiple YUV streams from the webcams to the Pi is unlikely to work.

The Compute Module exposes the 2 camera interfaces on the BCM283x SoC - that's all there are on the chip. All the software supports running both cameras, but you're limited to a combined encode equivalent to one 1080P30 stream, so 2 x 720P30 should be fine, but 1 x 1080P30 and 1 x 720P30 wouldn't be.

Pootle is right though that storing the data may also pose you a problem. From my days working on phones, getting SD cards to write a 15Mbit/s stream for any length of time could be hit and miss even on good brands of card.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

doughboy
Posts: 51
Joined: Tue Nov 01, 2016 12:04 pm

Re: raspberry pi 3 multiple cameras with recording function

Thu Nov 03, 2016 2:15 pm

Eddie9827 wrote:I'm doing a surveillance system project of multiple cameras on a Raspberry Pi with a recording function. Is it possible to record video from two or more cameras at the same time from a single Raspberry Pi board?
Data is the issue when using a Rpi. The CPU can only process so much data, so if you have 3 high resolution cams, the cpu could struggle to process all the data from all 3 cams at the same time. It depends on how good the cams are, ie are they high definition cams for example?

If you lowered the cam resolution sufficiently, the cpu has less data to process and could potentially handle the data from the 3 cams, if the multiplexer allows it.

I'm guessing the cams will be looking in different places? If so and if redundancy is also a requirement as its a surveillance project, would 1 cam per Rpi be an option?

Probably not what you want to hear if you have spent money on a multiplexer, but its an alternative route that still lets you monitor all 3 cams at the highest resolution the Rpi can handle, whilst introducing a level of redundancy which could be a weak point for some surveillance applications/requirements.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 13235
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: raspberry pi 3 multiple cameras with recording function

Thu Nov 03, 2016 2:42 pm

That multiplexer also does not allow independent AGC and AWB control loops for each camera - the same settings get adopted for all of them. If they are looking at significantly different scenes then they'll constantly fight each other.

CPU load is more applicable to USB cameras as all data is passed through it. With the Pi Camera most of the work is done within the GPU side and the encoded data copied by the GPU into memory. The CPU still has to ship the data out to whatever storage, but not deal with receiving it.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

RpiName
Posts: 742
Joined: Sat Jul 06, 2013 3:14 am

Re: raspberry pi 3 multiple cameras with recording function

Sat Nov 12, 2016 5:53 pm

Eddie9827 wrote:Is there any solution for recording video simultaneously from either Raspberry Pi cameras or USB cameras? Any kind of help will be appreciated.
UV4L supports audio and/or video recording from within any browser (client side) and from the Rpi itself thanks to VideoConferencing OS. Both usb and rpi cameras are supported.

See here for more informations:
http://www.linux-projects.org/rpi-video ... e-demo-os/

Return to “General discussion”