streaming - Send 2 different camera feeds to ffserver from ffmpeg -
i'm working in project have stream 2 webcams streams computer through tcp connection, can stream 1 without problem:
using
ffserver.conf:
httpport 8090 httpbindaddress 0.0.0.0 maxclients 40 maxbandwidth 30000 customlog - nodaemon <stream status.html> format status acl allow localhost acl allow 192.168.0.0 192.168.255.255 </stream> #feed camera 1 <feed webcam1.ffm> file /tmp/webcam1.ffm filemaxsize 100m </feed> #feed camera 2 <feed webcam2.ffm> file /tmp/webcam2.ffm filemaxsize 100m </feed> #stream feed 1 <stream webcam1.mjpeg> feed webcam1.ffm format mjpeg videosize 1280x720 videoframerate 30 preroll 0 noaudio strict -1 </stream> #stream feed2 <stream webcam2.mjpeg> feed webcam2.ffm format mjpeg videosize 1280x720 videoframerate 30 preroll 0 noaudio strict -1 </stream> command run ffserver:
ffserver /etc/ffserver.conf command feed ffserver:
ffmpeg -v 2 -r 20 -f video4linux2 -i /dev/video0 http://localhost:8090/webcam1.ffm and works perfect, when try run other feed:
ffmpeg -v 2 -r 20 -f video4linux2 -i /dev/video1 http://localhost:8090/webcam2.ffm i can see second stream , first 1 not work anymore. idea?
using multiple usb webcams simultaneously may saturate bus. seems case since starting second camera cuts first 1 off.
the situation has improved when usb1.1 common. low-end motherboards have multiple usb2/3 controllers, entirely independent , can run multiple cameras without concern. usb2 can support multiple cameras @ low resolution , framerate. high framerate high resolution cameras sending uncompressed images may still saturate bus
possible solutions:
- switch mjpeg input (lower bandwidth use)
check capabilities of device:
ffmpeg -f v4l2 -list_formats -i /dev/video0
if supports mjpeg use instead of raw video:
ffplay -f v4l2 -input_format mjpeg -i /dev/video0 ...
- use different usb controller second camera
if motherboard doesn't feature multiple controllers pci usb card.
Comments
Post a Comment