4 x USB Cameras Live streaming

Post Reply
nitipongs
Posts: 4
Joined: Sun Jul 28, 2019 6:09 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

4 x USB Cameras Live streaming

Unread post by nitipongs » Sun Jul 28, 2019 6:16 pm

Can I connect 4 USB cameras to XU-4 and streaming 4 cameras simultaneously over WiFi to view on a tablet ?

Nitipong

User avatar
mad_ady
Posts: 6384
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 146 times
Been thanked: 107 times
Contact:

Re: 4 x USB Cameras Live streaming

Unread post by mad_ady » Sun Jul 28, 2019 6:26 pm

Yes, but may depend on the camera type. For mjpeg cameras you can install mjpeg_streamer and run 4 instances. You don't have 4 usb ports though.
If you want to encode mjpeg to h264 you can do so with ffmpeg, but I'm not sure you can use the hardware encoder with 4 streams.
One 720p mjpeg stream is about ~1MB/s.
Some ideas here: https://www.google.com/url?sa=t&source= ... m9k4htmb9Y

nitipongs
Posts: 4
Joined: Sun Jul 28, 2019 6:09 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: 4 x USB Cameras Live streaming

Unread post by nitipongs » Sun Jul 28, 2019 10:33 pm

There are only 3 USB ports , 1 will be used for WiFi USB and only 2 left. How to connect another 2 USB cameras ?
Have you tested it before over WiFi ?

Can it support 1080p or higher for 4 streams simultaneously ?

User avatar
mad_ady
Posts: 6384
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 146 times
Been thanked: 107 times
Contact:

Re: 4 x USB Cameras Live streaming

Unread post by mad_ady » Sun Jul 28, 2019 11:43 pm

You'll need a usb hub. Are your webcams usb2 or usb3? I'd go with a usb3 hub that can be optionally powered even if your cameras are usb2.

Streaming a webcam that supports mjpeg (most of them do) should be no load for the odroid. But mjpeg "costs" bandwidth. So it depends on the wifi conditions in your area. I'd go with 5GHz wifi if possible (in my tests it can sustain 15MB/s without issues at 5-10m).

If you're on 2.4GHz (or your tablet is) you can tweak the framerate, resolution and maybe compression to reduce the network load.

nitipongs
Posts: 4
Joined: Sun Jul 28, 2019 6:09 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: 4 x USB Cameras Live streaming

Unread post by nitipongs » Mon Jul 29, 2019 12:15 am

I will put these 4 cameras on a drone and view from a distance . Do you have a sample code for 4 cameras view/record/playback from a client ?

User avatar
mad_ady
Posts: 6384
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 146 times
Been thanked: 107 times
Contact:

Re: 4 x USB Cameras Live streaming

Unread post by mad_ady » Mon Jul 29, 2019 1:29 am

See the link I posted earlier. If you're going with mjpeg (which is better suited for real-time video than a software-encoded h264 stream) you can use mjpeg_streamer and create a simple web page that imports the streams (see the project webpage on how) and displays them in a 2x2 browser window (e.g. inside a html table).

nitipongs
Posts: 4
Joined: Sun Jul 28, 2019 6:09 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: 4 x USB Cameras Live streaming

Unread post by nitipongs » Mon Jul 29, 2019 9:04 am

you said you have tested with 5GHz WiFi 5-10 meters with no problem. You mean for > 10 meters there will be some problem ? my application need at least 200 meters distance.

User avatar
mad_ady
Posts: 6384
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 146 times
Been thanked: 107 times
Contact:

Re: 4 x USB Cameras Live streaming

Unread post by mad_ady » Mon Jul 29, 2019 1:05 pm

Hmm, 200 m is quite a distance for any wifi technology. 5GHz attenuates faster than 2.4GHz. I doubt any wifi band would be stable at 200m without directional/amplified antennas. The examples I've seen for long distance wifi were between fixed points (https://hackaday.com/2005/02/20/a-better-wifi-antenna/). Not sure how having a moving drone will affect reception...

Post Reply

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 0 guests