Sign inSign up

justtin/nginx-http-flv-rtmp

By justtin

•Updated over 5 years ago

nginx http flv rtmp media server

Image
0

704

justtin/nginx-http-flv-rtmp repository overview

⁠nginx media server with (rtmp、flv、hls、dash)

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-FLV方式****
 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方式
 rtmp://example.com[:port]/appname/streamname
⁠HLS方式
 http://example.com[:port]/hls/streamname.m3u8
⁠DASH方式
 http://example.com[:port]/dash/streamname.mpd

Tag summary

Content type

Image

Digest

Size

48.6 MB

Last updated

over 5 years ago

docker pull justtin/nginx-http-flv-rtmp