侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

  直播后台搭建 Centos ,    Nginx ,RTMP 

2023-12-02 星期六 / 0 评论 / 0 点赞 / 89 阅读 / 2259 字

直播后台搭建Centos , Nginx ,RTMP Step1.安装相关 #yuminstall-ypcrepcre-devel #yuminstall-yzlibzlib-devel #

 

 直播后台搭建 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流
 
 
 
 

 

 

广告 广告

评论区