简体   繁体   English

ffmpeg到ffserver可以工作,但是无法查看

[英]ffmpeg to ffserver works, but cannot view

I have a generic windows webcam that I am trying to broadcast 我有一个要广播的通用Windows网络摄像头

ffmpeg -f vfwcap -I 0 -vcodedc libx264 -tune zerolatency-b 900k -f mpegts udp://domain.com:8090

which appears error free. 看起来没有错误。 I can see plenty of traffic using tcpdump on port 8090 我可以在端口8090上使用tcpdump看到大量流量

ffserver is configure on a FreeBSD server with no firewall configured ffserver在没有配置防火墙的FreeBSD服务器上配置

# cat /usr/local/etc/ffserver.conf| egrep -v "(^#.*|^$)"
HTTPPort 8090
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000
CustomLog -
<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 200K
ACL allow 98.124.117.129
</Feed>
<Stream test1.mpg>
Feed feed1.ffm
Format mpeg
AudioBitRate 32
AudioChannels 1
AudioSampleRate 44100
VideoBitRate 64
VideoBufferSize 40
VideoFrameRate 3
VideoSize 160x128
VideoGopSize 12
ACL ALLOW all
</Stream>
<Stream test.asf>
Feed feed1.ffm
Format asf
VideoFrameRate 15
VideoSize 352x240
VideoBitRate 256
VideoBufferSize 40
VideoGopSize 30
AudioBitRate 64
StartSendOnKey
</Stream>
<Stream test1-rtsp.mpg>
Format rtp
File "/tmp/feed1.ffm"
</Stream>
<Stream stat.html>
Format status
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255 98.124.117.129 0.0.0.0
</Stream>
<Redirect index.html>
URL http://www.ffmpeg.org/
</Redirect>

The port is live 港口是活的

# netstat -an|grep 8090
tcp4       0      0 *.8090                 *.*                    LISTEN

But when I try to connect via VLC to the ffserver 但是当我尝试通过VLC连接到ffserver时

rtsp://persiaspalace.us:8090/feed1.ffm

connection fails. 连接失败。 There are no networking issues 没有网络问题

How do I configure a webcam broadcast from ffmpeg to ffserver for viewing via VLC (or similar)? 如何配置从ffmpeg广播到ffserver的网络摄像头以通过VLC(或类似方式)进行查看?

You need to connect to the stream, not the feed. 您需要连接到流,而不是源。 The feed is the incoming video. 提要是传入的视频。 The stream is the outgoing video. 流是传出视频。

rtsp://persiaspalace.us:8090/feed1.ffm RTSP://persiaspalace.us:8090 / feed1.ffm

needs to be 需要是

rtsp://persiaspalace.us:8090/test1.mpg or rtsp://persiaspalace.us:8090/test.asf or rtsp://persiaspalace.us:8090/test1-rtsp.mpg rtsp://persiaspalace.us:8090 / test1.mpg或rtsp://persiaspalace.us:8090 / test.asf或rtsp://persiaspalace.us:8090 / test1-rtsp.mpg

I believe your ports are mixed up. 我相信您的港口是混乱的。 FFserver is using port 8090 for HTTP, RTSP. FFserver将端口8090用于HTTP,RTSP。 Set RTSPPort in your FFserver config file and then make sure you're hitting the stream and not the feed (as QA Collective pointed out). 在您的FFserver配置文件中设置RTSPPort,然后确保您点击的是流而非提要(如QA Collective指出的那样)。 Something like: 就像是:

...
HTTPPort 8090
RTSPPort 5554
...

Make sure the port is available, and then try: 确保端口可用,然后尝试:

ffplay -loglevel debug "rtsp://persiaspalace.us:5554/test1.mpg"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM