nginx的nginx-rtmp-module应用
来源:互联网 发布:c语言取绝对值 编辑:程序博客网 时间:2024/06/05 02:32
1、下载nginx:
nginx的官方网站为:http://nginx.org/en/download.html
解压:
tar xvf
nginx-1.10.3.tar.gz
2、安装nginx依赖运行包命令:
sudo apt-get install libssl-dev sudo apt-get install libpcre3 libpcre3-dev
3、下载nginx-rtmp-module:
nginx-rtmp-module的官方github地址:https://github.com/arut/nginx-rtmp-module
使用命令:
git clone https://github.com/arut/nginx-rtmp-module.git
解压:
unzip nginx-rtmp-module-master.zipmv -i nginx-rtmp-module-master nginx-rtmp-module
4、编译安装:
./configure --add-module=../nginx-rtmp-module
make && make install
5、修改nginx的配置文件vi /usr/local/nginx/conf/nginx.conf
加入以下内容:hls_path需要可读可写的权限。修改http中的server模块:
server { listen 80; server_name localhost; location /hls {autoindex on;autoindex_exact_size off;autoindex_localtime on; types {application/vnd.apple.mpegusr m3u8;video/mp2t ts;}root /home/rtmp;add_header Cache-Control no-cache; } #charset koi8-r; #access_log logs/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm;if ($request_filename ~* ^.*?\.(txt|doc|pdf|tar|rar|gz|zip|docx|exe|xlsx|ppt|pptx)$){add_header Content-Disposition: 'attachment;';}autoindex on;#打开目录浏览功能autoindex_exact_size off;#改为off后,显示出文件的大概大小,单位是kB或者MB或者GBautoindex_localtime on;#显示的文件时间为文件的服务器时间 } #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; } }
6、测试nginx-rtmp服务
ffmpeg -re -i "264_aac.mp4" -vcodec libx264 -s 480x270 -vprofile baseline -acodec copy -f flv rtmp://192.168.1.190:1935/hls/test1
ffmpeg -re -i "264_aac.mp4" -vcodec libx264 -s 480x270 -vprofile baseline -acodec copy -f flv rtmp://192.168.1.190:1935/hls/test2
vlc 测试:第一个就是推送的地址: rtmp:/192.168.1.190:1935/hls/test1第二个是HTTP地址: http://192.168.1.190:80/hls/test2.m3u8
0 0
- nginx的nginx-rtmp-module应用
- nginx-rtmp-module
- Nginx-Rtmp-Module命令
- Nginx-Rtmp-Module命令
- Nginx Rtmp Module
- fedora测试nginx-rtmp-module
- nginx-rtmp-module 权限控制
- nginx-rtmp-module 指令详解
- nginx rtmp module install compile
- nginx-rtmp-module安装笔记
- nginx+nginx-rtmp-module部署直播服务器
- 安装Nginx相关模块+nginx-rtmp-module
- ubuntu下安装nginx + nginx-rtmp-module
- Nginx RTMP 模块 nginx-rtmp-module 指令详解
- Nginx RTMP 模块 nginx-rtmp-module 指令详解
- Nginx RTMP 模块 nginx-rtmp-module 指令详解
- Nginx RTMP 模块 nginx-rtmp-module 指令详解
- Nginx RTMP 模块 nginx-rtmp-module 指令详解
- 【Codeforces 711 C】+ dp
- 前言
- hbuilder学习1
- 开发书籍推荐路线
- SpringBoot 整合Ehcache3
- nginx的nginx-rtmp-module应用
- maven快速入门新建项目, 卡慢问题解决
- OGNL在Mybatis中的简单使用
- 统计网站在线人数
- 值与引用
- Python学习的个人笔记(基础语法)
- JVM基础:深入学习JVM堆与JVM栈-堆与栈的经典问题
- hdoj 1281 棋盘游戏 (匈牙利,关键位置)
- PHP代码规范