安装好nginx后 下载
yum -y install gitgit clone https://github.com/arut/nginx-rtmp-module.git./configure --add-module=../nginx-rtmp-module #文件路径makemake install
在http{前加入
rtmp {
server {
listen 1935; #监听的端口
chunk_size 4000;
application yuchen {#rtmp推流请求路径 (切记路径错了会推不上流)
live on; #开启实时
hls on; #开启hls
hls_path /usr/local/src/nginx/html/yuchen; #rtmp推流请求路径,文件存放路径
hls_fragment 5s; #每个TS文件包含5秒的视频内容
}
}
}
就可以了如果要拉流可以在http模块下访问/usr/local/src/nginx/html/yuchen路径对应的m3u8文件
