我目前正在一个项目中工作,我必须通过 TCP 连接将 2 个网络摄像头流从一台计算机流式传输到另一台计算机,我可以毫无问题地流式传输 1:
使用
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 for camera 1
<Feed webcam1.ffm>
File /tmp/webcam1.ffm
FileMaxSize 100M
</Feed>
#feed for camera 2
<Feed webcam2.ffm>
File /tmp/webcam2.ffm
FileMaxSize 100M
</Feed>
#stream for feed 1
<Stream webcam1.mjpeg>
Feed webcam1.ffm
Format mjpeg
VideoSize 1280x720
VideoFrameRate 30
Preroll 0
NoAudio
Strict -1
</Stream>
#stream for feed2
<Stream webcam2.mjpeg>
Feed webcam2.ffm
Format mjpeg
VideoSize 1280x720
VideoFrameRate 30
Preroll 0
NoAudio
Strict -1
</Stream>
运行ffserver的命令:
ffserver /etc/ffserver.conf
提供 ffserver 的命令:
ffmpeg -v 2 -r 20 -f video4linux2 -i /dev/video0 http://localhost:8090/webcam1.ffm
并且效果很好,但是当我尝试运行其他提要时:
ffmpeg -v 2 -r 20 -f video4linux2 -i /dev/video1 http://localhost:8090/webcam2.ffm
我只能看到第二个流,而第一个流不再起作用。一些想法?