一段时间后 HTTP Live Stream 停止播放

HTTP Live Stream stops playing after a while

我在使用 ffserver 进行流式传输时遇到问题。在我启动 ffserver 和 desktop-capture 之后,似乎一切正常。

然后我打开浏览器并访问输出 (http://localhost:8090/test1.mpeg)。它 正常播放 6-7 秒后停止,我必须刷新页面才能使其再次运行。有谁知道为什么会这样以及我该如何纠正它?

这是我的 ffserver.conf

HTTPPort 8090
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 40000
CustomLog -

<Feed feed1.ffm>
  File /tmp/feed1.ffm
  FileMaxSize 10000K
  ACL allow 127.0.0.1
  ACL allow localhost
  ACL allow 192.168.0.0 192.168.255.255
</Feed>

<Stream test1.mpeg>
  Feed feed1.ffm
  Format mpeg
  AudioBitRate 32
  AudioChannels 1
  AudioSampleRate 44100
  VideoBitRate 300
  VideoFrameRate 30
  VideoSize 1280x1024
  VideoCodec mpeg1video
  AudioCodec libvorbis
  NoAudio
  StartSendOnKey
</Stream>

我的桌面捕获:

ffmpeg -f x11grab -r 40 -s 800x600 -framerate 50  -i :0.0+4,529 -map 0 -codec:v mpeg1video -codec:a libvorbis http://localhost:8090/feed1.ffm

问题是 VideoBitRate 太低了。我将其更改为 3000,现在它可以正常运行了。

现在我的 ffserver.conf 看起来像这样:

HTTPPort 8090
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 40000
CustomLog -

<Feed feed1.ffm>
   File /tmp/feed1.ffm
   FileMaxSize 10000K
   ACL allow 127.0.0.1
   ACL allow localhost
   ACL allow 192.168.0.0 192.168.255.255
</Feed>

<Stream test1.mpeg>
   Feed feed1.ffm
   Format mpeg
   AudioBitRate 50
   AudioChannels 1
   AudioSampleRate 44100

   # Bitrate for the video stream
   VideoBitRate 3000

   VideoFrameRate 30
   VideoSize 1280x1024
   VideoCodec mpeg1video
   AudioCodec libvorbis
   NoAudio
   StartSendOnKey
</Stream>