ffmpeg推流配置文件ffserver.conf

学ffmpeg之际想看看推流,折腾了一天完全是配置的原因,现记录一下供以后查找。

推流还有个live555,想了解可以去搜索下,当然方案不知这些。

http://www.ffmpeg.org/ffserver.html

# 注释以#开头
Port 8090 BindAddress 0.0.0.0 MaxHTTPConnections 2000 MaxClients 1000 MaxBandwidth 1000000 CustomLog -
<Feed video.ffm> File /tmp/video.ffm FileMaxSize 1024M ACL allow 127.0.0.1 </Feed> <Feed sound.ffm> File /tmp/sound.ffm FileMaxSize 100M ACL allow 127.0.0.1 </Feed> <Stream live.flv> Format flv Feed video.ffm VideoCodec libx264 VideoFrameRate 24 VideoBitRate 5120 VideoSize 1920x1080 AVOptionVideo crf 23 AVOptionVideo preset medium AVOptionVideo flags +global_header AudioCodec aac Strict -2 AudioBitRate 320 AudioChannels 2 AudioSampleRate 44100 AVOptionAudio flags +global_header </Stream> <Stream live.flac> Feed sound.ffm Title "Music Live" AudioBitRate 320 AudioChannels 2 AudioSampleRate 44100 NoVideo </Stream> <Stream stat.html> Format status ACL allow localhost ACL allow 192.168.0.0 192.168.255.255 </Stream> <Redirect index.html> URL http://www.ffmpeg.org/ </Redirect>

  将上述代码保存成文本文件,例如:ffserver.conf

  通过 ffserver -f ffserver.conf  启动ffserver

  使用 ffmpeg -i xx.mp4 http://ip:port/video.ffm  将xx.mp4转码到ffserver的视音频(sound.ffm转码到单独音频)

  播放 http://ip:port/live.flv  播放音视频(live.flac播放音频)

猜你喜欢

转载自www.cnblogs.com/Dua677/p/10347169.html