1

我在使用 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
4

1 回答 1

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>
于 2016-08-24T07:20:23.490 回答