㈠ 问下像YY直播那样给的RTMP推流地址建的是什么服务器 怎样搭建这样的服务器
可以使用nginx的rtmp模块来搭建。可以在github上下载,进入nginx目录,执行命令./configure --prefix=./bin --add-mole=../nginx-rtmp-mole-1.2.1在这个过程中可能因为环境不同而出现不同错误,比如缺少pcre、openssl等,这时候就需要安装这些库。
nginx.conf配置文件信息
userroot;
worker_processes1;
error_loglogs/error.logdebug;
events{
worker_connections1024;
}
rtmp{
server{
listen1935;
applicationmyapp{
liveon;
drop_idle_publisher5s;
}
}
}
http{
server{
listen8081;
location/stat{
rtmp_statall;
rtmp_stat_stylesheetstat.xsl;
}
location/stat.xsl{
root/root/nginx-rtmp-mole-1.2.1/;
}
location/control{
rtmp_controlall;
}
location/rtmp-publisher{
root/root/nginx-rtmp-mole-1.2.1/test;
}
location/{
root/root/nginx-rtmp-mole-1.2.1/test/www;
}
}
}
全部完成之后 重新启动nginx
㈡ 在nginx.conf中加入rtmp后nginx启动不了
1)正确编译和安装:网页链接
2)安装完成后,键入 nginx -V 命令查看(无法找到命令的话,请使用绝对路径访问 nginx 可执行文件)
正常编译安装情况
应当出现类似 --add-mole=nginx-rtmp-mole 字样
3)问题依旧可以尝试:
移除旧安装目录下文件(rm -rf /usr/local/nginx)
清楚编译产生的文件(make clean)
使用正确的选项重新编译安装
问题还在?尝试换个 nginx 版本,再重复上述步骤
㈢ Ubuntu下Nginx 安装rtmp模块失败
安装已经结束,下面来看配置。
在nginx安装目录下先复制一份默认的配置文件出来:
cd /usr/local/nginx/conf
cp nginx.conf live_rtmp.conf12
编辑live_rtmp.conf如下:
#user nobody;
worker_processes 1;
error_log logs/error.log;
㈣ window版本的nginx能重新编译吗如何添加新的模块呢
找到安装nginx的源码根目录,如果没有的话下载新的源码
http://nginx.org
tar xvzf nginx-1.3.2.tar.gz
查看ngixn版本极其编译参数
/usr/local/nginx/sbin/nginx -V
进入nginx源码目录
cd nginx-1.3.2
以下是重新编译的代码和模块
./configure --prefix=/usr/local/nginx--with-http_stub_status_mole
--with-http_ssl_mole --with-file-aio --with-http_realip_mole
make 千万别make install,否则就覆盖安装了
make完之后在objs目录下就多了个nginx,这个就是新版本的程序了
备份旧的nginx程序
cp /usr/local/nginx/sbin/nginx/usr/local/nginx/sbin/nginx.bak
把新的nginx程序覆盖旧的
cp objs/nginx /usr/local/nginx/sbin/nginx
测试新的nginx程序是否正确
/usr/local/nginx/sbin/nginx -t
nginx: theconfiguration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx:configuration file /usr/local/nginx/conf/nginx.conf test issuccessful
平滑重启nginx
/usr/local/nginx/sbin/nginx -s reload
查看ngixn版本极其编译参数
/usr/local/nginx/sbin/nginx -V
这是我重新编译的代码:
./configure --prefix=/usr/local/nginx --with-google_perftools_mole
--user=www --group=www --with-http_stub_status_mole
--with-http_gzip_static_mole --with-openssl=/usr/
--with-pcre=/mydata/soft/pcre-8.31
㈤ nginx怎么搭建非本地rtmp服务器
1、电源一定要看清楚是不是正负极接线反向了;
2、如果仿真的时候,其它的东西都按照书本的要求填了,还是提示下面这个初始化错误,那就是没有加powergui模块。