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

时间:2016-08-23 08:13:24

标签: linux http ffmpeg stream ffserver

我在使用ffserver进行流式传输时遇到问题。在我启动ffserver和桌面捕获之后,一切似乎都运行良好。

然后我打开浏览器并访问输出(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

1 个答案:

答案 0 :(得分:1)

问题是,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>
相关问题