【问题标题】:HTTP Live Stream stops playing after a whileHTTP Live Stream 在一段时间后停止播放
【发布时间】:2016-12-29 23:08:52
【问题描述】:

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

【问题讨论】:

    标签: linux http ffmpeg stream ffserver


    【解决方案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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多