我尝试使用 ffserver + ffmpeg 将我的网络摄像头流式传输为 mpeg 流时迷路了。我已经在 OSX Yosemite (10.10.13) 上安装了以下 ffserver.conf
HTTPPort 8090
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000
CustomLog /Users/admin/Documents/ffserver/webcam.log
NoDaemon
<Feed webcam.ffm>
File /Users/admin/Documents/ffserver/webcam.mjpeg
#FileMaxSize 200K
#ACL allow 10.0.0.0 255.255.255.0
</Feed>
<Stream webcam.mjpg>
# coming from live feed 'webcam.ffm'
Feed webcam.ffm
Format mpegts
VideoCodec libx264
VideoFrameRate 24
VideoBitRate 512
VideoSize 640x480
#AVOptionVideo crf 23
#AVOptionVideo preset medium
# for more info on crf/preset options, type: x264 --help
#AVOptionVideo flags +global_header
NoAudio
</Stream>
将以下 ffmpeg 流运行到服务器
ffmpeg -f avfoundation -i "0" -vcodec libx264 -s 640X480 http://localhost:8090/webcam.mjpg
如果我运行 ffmepg 以输出为文件,我可以访问网络摄像头视频,但我无法使用 vlc 看到流(我从 ffserver 获得连接验证)
知道为什么吗?
谢谢纳迪戈