当前位置: 首页 > wzjs >正文

怎么做网站流量附近的教育培训机构有哪些

怎么做网站流量,附近的教育培训机构有哪些,全免费自助建站,上海网站设计公司这两天为了利用云服务器实现 Nginx 进行OBS Rtmp推流,Flv拉流时发生了诸多情况,记录实现过程。 环境 OS:阿里云CentOS 7.9 64位Nginx:nginx-1.28.0Nginx-http-flv-module:nginx-http-flv-module-1.2.12 安装Nginx编…

这两天为了利用云服务器实现 Nginx 进行OBS Rtmp推流,Flv拉流时发生了诸多情况,记录实现过程。

环境

  • OS:阿里云CentOS 7.9 64位
  • Nginx:nginx-1.28.0
  • Nginx-http-flv-module:nginx-http-flv-module-1.2.12

安装Nginx编译的依赖包:

yum install -y gcc gcc-c++ autoconf automake make
yum install zlib zlib-devel openssl openssl-devel pcre pcre-devel wget httpd-tools vim -y

Nginx配置

2.1 获取nginx源码

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

2.2 解压

tar -xzvf nginx-1.28.0.tar.gz

2.3 重命名

mv nginx-1.28.0 nginx

2.4 移动到/usr/local/

mv nginx/ usr/local/

Nginx-http-flv-module配置

3.1 在/usr/local/nginx中下载

wget https://github.com/winshining/nginx-http-flv-module/archive/refs/tags/v1.2.12.tar.gz

3.2 解压

tar -xzvf v1.2.12.tar.gz

3.3 关闭防火墙

systemctl disable --now firewalld
setenforce 0
getenforce

3.4 配置nginx编译环境

./configure --prefix=/usr/local/nginx --add-module=/usr/local/nginx/nginx-http-flv-module-1.2.12

3.5编译&安装

make
make install

3.6设置Nginx环境变量

vi /etc/profile # vi 打开环境变量文件
export PATH=$PATH:/usr/local/nginx/sbin # 添加到文件最后一行
source /etc/profile # 立即生效

修改Nginx配置文件

4.1 将下方文本替换/usr/local/nginx/conf/nginx.conf的内容:


#user  nobody;
worker_processes  1;#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;#pid        logs/nginx.pid;events {worker_connections  1024;
}rtmp_auto_push on;
rtmp_auto_push_reconnect 1s;
rtmp_socket_dir /tmp;rtmp {out_queue           4096;out_cork            8;max_streams         128;timeout             15s;drop_idle_publisher 15s;log_interval 5s; #log模块在access.log中记录日志的间隔时间,对调试非常有用log_size     1m; #log模块用来记录日志的缓冲区大小server {listen 1935;#ffmpeg推流的application application app {live on;allow publish all;allow play all;record off;meta copy;gop_cache on; #打开GOP缓存,减少首屏等待时间}}
}http {include       mime.types;default_type  application/octet-stream;#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '#                  '$status $body_bytes_sent "$http_referer" '#                  '"$http_user_agent" "$http_x_forwarded_for"';#access_log  logs/access.log  main;sendfile        on;#tcp_nopush     on;#keepalive_timeout  0;keepalive_timeout  65;#gzip  on;server {listen       80; # http-flv 拉流端口#server_name  localhost;location /live {flv_live on; #打开HTTP播放FLV直播流功能chunked_transfer_encoding on; #支持'Transfer-Encoding: chunked'方式回复add_header 'Access-Control-Allow-Origin' '*'; #添加额外的HTTP头add_header 'Access-Control-Allow-Credentials' 'true'; #添加额外的HTTP头}#charset koi8-r;#access_log  logs/host.access.log  main;location / {root   html;index  index.html index.htm;}#error_page  404              /404.html;# redirect server error pages to the static page /50x.html#error_page   500 502 503 504  /50x.html;location = /50x.html {root   html;}# proxy the PHP scripts to Apache listening on 127.0.0.1:80##location ~ \.php$ {#    proxy_pass   http://127.0.0.1;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000##location ~ \.php$ {#    root           html;#    fastcgi_pass   127.0.0.1:9000;#    fastcgi_index  index.php;#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;#    include        fastcgi_params;#}# deny access to .htaccess files, if Apache's document root# concurs with nginx's one##location ~ /\.ht {#    deny  all;#}}# another virtual host using mix of IP-, name-, and port-based configuration##server {#    listen       8000;#    listen       somename:8080;#    server_name  somename  alias  another.alias;#    location / {#        root   html;#        index  index.html index.htm;#    }#}# HTTPS server##server {#    listen       443 ssl;#    server_name  localhost;#    ssl_certificate      cert.pem;#    ssl_certificate_key  cert.key;#    ssl_session_cache    shared:SSL:1m;#    ssl_session_timeout  5m;#    ssl_ciphers  HIGH:!aNULL:!MD5;#    ssl_prefer_server_ciphers  on;#    location / {#        root   html;#        index  index.html index.htm;#    }#}}

4.2 新建/usr/local/nginx/logs文件夹存放日志

sudo mkdir -p /usr/local/nginx/logs # sudo 是使用root权限创建

4.3 测试配置文件是否问题

/usr/local/nginx/sbin/nginx -t

4.4 运行Nginx

nginx

4.5 查看端口,如果1935 & 80端口正在监听就表明完成了

netstat -tulnp # 查看所有端口 加上 | grep x 可以过滤出端口x的情况

5.OBS推流

使用obs进行推流,其中推流地址和推流码为:

6.使用VLC进行拉流

6.1 rtmp拉流地址为:http://47.97.31.45:80/app/room-1

6.2 flv 拉流地址为:http://47.97.31.45:80/live?port=1935&app=app&stream=room-1

flv拉流地址,其中live的是配置文件中的http模块设置的、port的值应该是推流端口、app的值是配置文件中rtmp模块自定义的名称、stream的值是OBS推流自定义的推流码。

效果:

在这里插入图片描述
( 延迟大概15s )

7. 参考

  • 使用Nginx搭建流媒体服务器
  • nginx+ffmpeg推流环境搭建
  • CentOS7安装 FFmpeg
http://www.dtcms.com/wzjs/508098.html

相关文章:

  • 黄山网站开发抖音营销软件
  • 网站建设售后协议小网站广告投放
  • 网站几种颜色新品推广策划方案
  • 龙华做网站哪家便宜上海网络营销
  • 美国网站加速器wordpress
  • 做网站分期付款比例百度云
  • 网站开发服务外包合同企业邮箱登录入口
  • 怎样在手机上面建设网站如何制作一个个人网站
  • 商业网站建设案例课程百度云杭州seo薪资水平
  • 深圳惠州网站建设合肥百度推广公司哪家好
  • 有没有网站学做总结泰安网站seo推广
  • 深圳龙岗网站建设哪家好公司网络游戏推广怎么做
  • 免费微网站怎么做百度指数属于行业趋势及人群
  • 怎么配置网站服务器深圳网站建设找哪家公司好
  • 点击最多的网站bt磁力搜索器
  • 个人网站不能有盈利性质友情链接出售
  • 武汉网站建设网站推广seo流量是什么
  • 韩国做美食的视频网站赵阳竞价培训
  • 江苏建设工程招标网官方网站网站免费搭建平台
  • 有哪些企业可以做招聘的网站有哪些内容百度推广怎么弄
  • 免费网站制作app上海seo关键词优化
  • 网站建设业务需求文档刚刚中国宣布重大消息
  • 做网站技术选择什么软件引流客源最快
  • 网站一般宽度重庆森林经典台词梁朝伟
  • 网站内容做淘宝店铺链接影响排名吗数据分析工具
  • 网站建设需要经过哪几个步骤怎么制作网站?
  • 找单位做网站需要注意什么合肥关键词排名
  • 有什么可以做兼职的正规网站广州优化公司哪家好
  • 无锡做网站的公司seo关键词排名优化怎么收费
  • 网站建站素材网络推广哪个平台好