Connecting multiple USB Cameras on one hub

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
Sigge
Posts: 116
Joined: Mon May 02, 2016 8:14 am

Connecting multiple USB Cameras on one hub

Post by Sigge »

The problem I faced was having more than one USB2 Camera using a single USB3 connection. There is no USB2 to USB3 transaction translation so it is really like being on a USB2 line. The bandwidth hungry Camera (in my case 3 logitech c930e) wants all the bandwidth for itself. I was able to get the compressed streams running with ffmpeg (ffmpeg -f v4l2 -input_format mjpeg -video_size 1920x1080 -framerate 5) if quirk 128 was applied to the kernel. Not sure why since quirk 128 is not supposed to affect compressed streams. If anyone knows how to solve this directly in ZM I would be grateful to know.

Here is my solution:
First apply quirk.

In /etc/modprobe.d/uvcvideo.conf add line:

Code: Select all

options uvcvideo quirks=128
Then I ran ffserver with this config:

Code: Select all

<Feed feed0.ffm>
File /tmp/feed0.ffm
FileMaxSize 1M
Launch ffmpeg -y -f v4l2 -input_format mjpeg -video_size 1920x1080 -framerate 5 -i /dev/video0 -c copy feed0.ffm
ACL allow 192.168.1.100
</Feed>

<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 1M
Launch ffmpeg -y -f v4l2 -input_format mjpeg -video_size 1920x1080 -framerate 5 -i /dev/video1 -c copy feed1.ffm
ACL allow 192.168.1.100
</Feed>

#Video 0

<Stream video0.mpg>
Feed feed0.ffm
Format mjpeg
VideoBitRate 6144 
NoDefaults
VideoFrameRate 5
VideoSize 1920x1080
VideoGopSize 24
VideoHighQuality
VideoCodec mjpeg
NoAudio
ACL allow 192.168.1.100
</Stream>

# Video 1

<Stream video1.mpg>
Feed feed1.ffm
Format mjpeg
VideoBitRate 6144 
NoDefaults
VideoFrameRate 5
VideoSize 1920x1080
VideoGopSize 24
VideoHighQuality
VideoCodec mjpeg
NoAudio
ACL allow 192.168.1.100
</Stream>
This is a bit cumbersome and takes some CPU. Does anyone have a better solution?
Post Reply