直播后台搭建 Centos ,    Nginx ,RTMP

 

 直播后台搭建 Centos ,    Nginx ,RTMP 

Step1.安装相关

  1. # yum install -y pcre pcre-devel  
  2. # yum install -y zlib zlib-devel  
  3. # yum install -y openssl openssl-devel  

 

 

 

Step2 Nginx,Nginx Rtmp下载

 

mkdir /tmp/nginx;

 

wget http://nginx.org/download/nginx-1.10.2.tar.gz

wget https://github.com/arut/nginx-rtmp-module/archive/master.zip

 

unzip master.zip

tar -xzvf nginx-1.10.2.tar.gz

 

 

Step3 安装

 

./configure --add-module=<path-to-nginx-rtmp-module>  --without-http_rewrite_module

 

Step4 配置Nginx;

 

 

rtmp {
	server {
		listen 1935;
		chunk_size 4096;
		application live {
			live on;
			record off;
		}
		application live2 {
			live on;
			record off;
		} # video on demand application vod {
			play /var/flvs;
		}
		application vod_http {
			play http://192.168.31.185/vod;//实际Ip地址
		}
		application hls {
			live on;
			hls on;
			hls_path /tmp/hls;
		}
	}
} # HTTP can be used for accessing RTMP stats http {
    server {
	listen 8080; # This URL provides RTMP statistics in XML location /stat {
	    rtmp_stat all; # Use this stylesheet to view XML as web page # in browser rtmp_stat_stylesheet stat.xsl;
	}
	location /stat.xsl { # XML stylesheet to view RTMP stats. # Copy stat.xsl wherever you want # and put the full directory path here root /path/to/stat.xsl/;
	}
	location /hls { # Serve HLS fragments types {
		application/vnd.apple.mpegurl m3u8;
		video/mp2t ts;
	    }
	    root /tmp;
	    add_header Cache-Control no-cache;
	}
	location /dash { # Serve DASH fragments root /tmp;
	    add_header Cache-Control no-cache;
	}
    }
}
5.下载VLC播放
6.下载推流器:目睹直播APP
推流地址:rtmp://ip/hls/test
7.用clappr播放RTMP流
 
 
 
 

 

 

转载于:https://my.oschina.net/fishcanfly/blog/814482

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值