nginx http flv rtmp media server
704
Compile from (nginx-http-flv-module)
添加了nginx默认配置,如需自定义,可修改挂载目录
多媒体文件目录:/media
hls目录:/media/hls
dash目录:/media/dash
html文件目录:/etc/nginx/html/
ffmpeg:
ffmpeg -re -i MEDIA_FILE_NAME -c copy -f flv rtmp://example.com[:port]/appname/streamname
http://example.com[:port]/dir?[port=xxx&]app=myapp&stream=mystream
如果使用ffplay命令行方式播放流,那么必须为上述的url加上引号,否则url中的参数会被丢弃(有些不太智能的shell会把"&"解释为"后台运行")。
如果使用flv.js播放流,那么请保证发布的流被正确编码,因为flv.js只支持H.264编码的视频和AAC/MP3编码的音频。
参数dir用于匹配http配置块中的location块(更多详情见下文)。
HTTP默认端口为80, 如果使用了其他端口,必须指定:port。
RTMP默认端口为1935,如果使用了其他端口,必须指定port=xxx。
参数app用来匹配application块,但是如果请求的app出现在多个server块中,并且这些server块有相同的地址和端口配置,那么还需要用匹配主机名的server_name配置项来区分请求的是哪个application块,否则,将匹配第一个application块。
参数stream用来匹配发布流的streamname。
rtmp://example.com[:port]/appname/streamname
http://example.com[:port]/hls/streamname.m3u8
http://example.com[:port]/dash/streamname.mpd
Content type
Image
Digest
Size
48.6 MB
Last updated
over 5 years ago
docker pull justtin/nginx-http-flv-rtmp