【问题标题】:ffmpeg to ffserver works, but cannot viewffmpeg 到 ffserver 有效,但无法查看
【发布时间】:2017-07-13 08:36:48
【问题描述】:

我有一个正在尝试广播的通用 Windows 网络摄像头

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

看起来没有错误。 我可以在 8090 端口上使用 tcpdump 看到大量流量

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>

端口已启用

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

但是当我尝试通过 VLC 连接到 ffserver 时

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

连接失败。 没有网络问题

如何配置从 ffmpeg 到 ffserver 的网络摄像头广播,以便通过 VLC(或类似方式)查看?

【问题讨论】:

    标签: ffmpeg udp rtsp ffserver


    【解决方案1】:

    您需要连接到流,而不是提要。提要是传入的视频。流是传出的视频。

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

    需要

    rtsp://persiaspalace.us:8090/test1.mpg 要么 rtsp://persiaspalace.us:8090/test.asf 要么 rtsp://persiaspalace.us:8090/test1-rtsp.mpg

    【讨论】:

      【解决方案2】:

      我相信你的端口搞混了。 FFserver 为 HTTP、RTSP 使用端口 8090。在您的 FFserver 配置文件中设置 RTSPPort,然后确保您点击的是流而不是提要(正如 QA Collective 指出的那样)。比如:

      ...
      HTTPPort 8090
      RTSPPort 5554
      ...
      

      确保端口可用,然后尝试:

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

      【讨论】:

        猜你喜欢
        • 2015-06-18
        • 2015-08-23
        • 2014-09-16
        • 1970-01-01
        • 2011-11-01
        • 1970-01-01
        • 1970-01-01
        • 2010-11-08
        • 2012-09-22
        相关资源
        最近更新 更多