(转)Nginx+rtmp+ffmpeg搭建流媒体服务器
背景
nginx 在音视频服务也有比较强大的功能,下面给出配置步骤。
前提:根据 软件运行环境,确保搭建好了有关支持环境
参考:
步骤
1.下载第三方扩展模块nginx-rtmp-module
wget https://github.com/arut/nginx-rtmp-module/archive/master.zip //下载模块
2.编译安装nginx
nginx 添加模块都是需要重新配置编译的编译
bash ./configure ... --add-module=/root/module/nginx-rtmp-module-master //编译安装nginx,并指定上面下载的模块路径 make make installbash
3.修改nginx配置文件nginx.conf,添加如下内容并重新运行nginx
rtmp {
server {
listen 1935; #监听的端口号
application myapp { #自定义的名字
live on;
}
application hls {
live on;
hls on;
hls_path /tmp/hls;
hls_fragment 1s;
hls_playlist_length 3s;
}
}
}
基于ffmpeg的测试
简单编译ffmpeg到host
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
./configure
make && make install
更复杂编译ffmpeg的章节不在本文的范围内。请参考:《arm linux 移植 FFMPEG库 + x264》
测试
1.启用ffmpeg进行推流
ffmpeg -i rtsp://192.168.1.175:554/11 -acodec aac -strict experimental -ar 44100 -ac 2 -b:a 96k -r 25 -b:v 500k -s 640*480 -f flv rtmp://192.168.1.11:1935/myapp/23
-i 要处理视频文件的路径,此处地址是一个rtsp流地址(IP Cam)
-s 像素
rtmp://192.168.1.11:1935/myapp/23
# 说明:rtmp://IP:PORT/ myapp指nginx配置文件中自定义的,22指输出文件的名字
-f flv 强迫指定采用flv格式
有关:《ffmpeg命令参考》
2.打开VLC 媒体——>打开网络串流->填入 ffmpeg推出去的路径 rtmp://192.168.1.11:1935/myapp/23
(转)Nginx+rtmp+ffmpeg搭建流媒体服务器的更多相关文章
- centos7+nginx+rtmp+ffmpeg搭建流媒体服务器(保存流目录与http目录不要随意配置,否则有权限问题)
搭建nginx-http-flv-module升级代替rtmp模块,详情:https://github.com/winshining/nginx-http-flv-module/blob/master ...
- centos7+nginx+rtmp+ffmpeg搭建流媒体服务器
1.安装前需要的工具 #net-tool 查本地IP #wget 下载安装包 #unzip 解压zip包 #gcc gcc-c++ perl 编译软件包用 yum install -y net-too ...
- Linux-Nginx+rtmp+ffmpeg搭建流媒体服务器
Nginx+rtmp+ffmpeg搭建流媒体服务器 说明: nginx搭建流媒体服务需要用到 nginx-rtmp-module 模块 具体操作步骤: 安装nginx (1)下载第三方扩展模块ngin ...
- 使用nginx+nginx-rtmp-module+ffmpeg搭建流媒体服务器
参考: 1,使用nginx+nginx-rtmp-module+ffmpeg搭建流媒体服务器笔记(一)http://blog.csdn.net/xdwyyan/article/details/4319 ...
- nginx+nginx-rtmp-module+ffmpeg搭建流媒体服务器
参照网址: [1]http://blog.csdn.net/redstarofsleep/article/details/45092147 [2]HLS介绍:http://www.cnblogs.co ...
- 流媒体技术学习笔记之(一)nginx+nginx-rtmp-module+ffmpeg搭建流媒体服务器
参照网址: [1]http://blog.csdn.net/redstarofsleep/article/details/45092147 [2]HLS介绍:http://www.cnblogs.co ...
- nginx+nginx-rtmp-module+ffmpeg搭建流媒体服务器[转]
转 :http://redstarofsleep.iteye.com/blog/2123752 Nginx本身是一个非常出色的HTTP服务器,FFMPEG是非常好的音视频解决方案.这两个东西通过一个n ...
- Nginx+rtmp+ffmpeg 搭建推流服务器
1. 安装nginx服务器 1.1 clone $ brew tap denji/homebrew-nginx 1.2 安装 $ brew install nginx-full --with-rtmp ...
- Ubuntu下使用nginx和nginx-rtmp-module搭建流媒体服务器的正确姿势
之前在使用nginx和nginx-rtmp-module搭建流媒体服务器的时候遇到一个很尴尬的问题,就是在把nginx-rtmp-module模块添加到nginx中去的时候,我最开始采取的做法是先卸载 ...
随机推荐
- 洛谷P2744 量取牛奶
题目 DP或者迭代加深搜索,比较考验递归的搜索. 题目第一问可以用迭代加深搜索限制层数. 第二问需要满足字典序最小,所以我们可以在搜索的时候把比当前答案字典序大的情况剪枝掉. 然后考虑怎么搜索,对于每 ...
- 最近公司遇到了APR攻击,顺便了解一下知识
原因及背景 最近公司遇到了APR攻击导致整个公司研发部.测试部.客服部.工程部等几个部门统一无法上网,TV(team viewer)无法使用,部署在公网的B/S架构系统系统无法访问,开发代码上传和下载 ...
- C++ 类型转换符区别分析
转载自:https://blog.csdn.net/legalhighhigh/article/details/87459995 1.static_cast用于将参数转换为指定类型.需要注意的是,进行 ...
- fluent计算输出时均值
/ ****************************************************************************** * Created on : 2017 ...
- Mac使用秘钥登录Linux服务器
简介 在 Mac 上配置 SSH 密钥登录远程的 Linux 相关配置 1.创建本地的 SSH 密钥 本地 生成秘钥对 ssh-keygen -t rsa -C 'youxiang@aliyun.co ...
- 利用art.template模仿VUE 一次渲染多个模版
TypeScript代码 import template = require('art-template/lib/template-web'); interface TemplateBindConfi ...
- 使用create-react-app遇到问题解决方案汇总
使用create-react-app时遇到Module not found问题 转 https://blog.csdn.net/wkq_1212/article/details/90291558 本来 ...
- UnicodeEncodeError: 'latin-1' codec can't encode characters,python3 中文乱码
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 9-13: ordinal not in range(2 ...
- node 报错 env: node\r: No such file or directory
最近在编写一个命令行工具.使用 npm link 时可以正常运行.但是 ctrl+s 保存后, 再运行则报错 env: node\r: No such file or directory ,需要再 n ...
- oracle plsql 异常
set serveroutput on DECLARE pename emp.ename%type; begin '; exception when no_data_found then dbms ...