nginx搭建flv、mp4流媒体服务

1、安装pcre-8.33.tar.bz2

#tar -xvf 1.pcre-8.33.tar.bz2

#cd pcre-8.33/

#./configure

#make && make install

2、安装openssl-1.0.1h.tar.gz

#tar -xvf openssl-1.0.1h.tar.gz

# cd openssl-1.0.1h/

#./config

#make && make install

3、添加mp4支持模块

下载 http://h264.code-shop.com/download/nginx_mod_h264_streaming-2.2.7.tar.gz

#tar -xvf 3.nginx_mod_h264_streaming-2.2.7.tar.gz

4、安装nginx

#tar -xvf 4.nginx-1.7.1.tar.gz

#cd nginx-1.7.1/

#./configure --add-module=/HLS/nginx_mod_h264_streaming-2.2.7 --with-http_ssl_module --prefix=/usr/local/nginx --with-http_flv_module  --with-http_stub_status_module

注意:nginx安装时,报错/HLS/nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c: In function ‘ngx_streaming_handler’:,此时需要修改src/ngx_http_streaming_module.c:


/* TODO: Win32 */

if (r->zero_in_uri)

{

return NGX_DECLINED;

}

将以上代码删除注释掉,重新编译安装。


/* TODO: Win32 */

//if (r->zero_in_uri)

//{

//return NGX_DECLINED;

//}

 5、nginx配置文件 nginx.conf  

#user www www;
worker_processes 30;
error_log /usr/local/nginx/logs/error.log crit;
pid /usr/local/nginx/logs/nginx.pid;
events {
use epoll;
worker_connections 65535;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main ‘$remote_addr - $remote_user [$time_local] ‘

‘"$request" $status $bytes_sent ‘

‘"$http_referer" "$http_user_agent" ‘

‘"$gzip_ratio"‘;

keepalive_timeout 60;

server_names_hash_bucket_size 128;

client_header_buffer_size 32k;

large_client_header_buffers 4 32k;

access_log off;

gzip on;

gzip_min_length 1100;

gzip_buffers 4 8k;

gzip_types text/plain;

output_buffers 1 32k;

postpone_output 1460;

client_header_timeout 3m;

client_body_timeout 3m;

send_timeout 3m;

sendfile on;

tcp_nopush on;

tcp_nodelay on;

######################################################################
server {

listen 8888;

server_name 192.168.245.133;

root /WebFiles/;

limit_rate_after 5m; ####在flv视频文件下载了5M以后开始限速

limit_rate 512k; ####速度限制为512K

index index.html;

charset utf-8;

location ~ \.flv {

flv;

}

location ~ \.mp4$ {
mp4;
}

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root html;

}

}

}

nginx搭建flv、mp4流媒体服务

时间: 2024-08-06 08:01:23

nginx搭建flv、mp4流媒体服务的相关文章

Nginx搭建flv mp4流媒体服务器[转]

Nginx搭建flv mp4流媒体服务器 作者:二蛋 时间:December 1, 2014 分类:Note 环境:Centos 6.4 32bit 一.安装依赖包 1.安装zlib wget http://zlib.net/zlib-1.2.8.tar.gz tar xzvf zlib-1.2.8.tar.gz cd zlib-1.2.8 ./configure make && make install 2.安装gcc-c++ yum -y install gcc-c++ 3.安装pcr

[终极精简版][图解]Nginx搭建flv mp4流媒体服务器

[终极精简版][图解]Nginx搭建flv mp4流媒体服务器 卧槽,就是被新版的jwplayer坑了,用了博主的 startparam: "start",primary: "flash" 最终搞定了,特意注册一个账号顶一下!谢谢. 花了我接近3周,历经了重重问题,今日终于把流媒体服务器搞定,赶紧的写个博文以免忘记... 起初是跟着网上的一些教程来的,但是说的很不全面,一些东西也过时不用了(比如jwplayer老版本).我这次是用的最新版jwplayer6.8,在配

[置顶][终极精简版][图解]Nginx搭建flv mp4流媒体服务器

花了我接近3周,历经了重重问题,今日终于把流媒体服务器搞定,赶紧的写个博文以免忘记... 起初是跟着网上的一些教程来的,但是说的很不全面,一些东西也过时不用了(比如jwplayer老版本).我这次是用的最新版jwplayer6.8,在配置上有很多不同的地方,也很坑,值得注意一下!在配置方面,我精简了很多,没有了那么多繁琐的配置项需要修改. 注意:本人是在虚拟机centos6.2系统下搭建的流媒体服务器,在win7主机上做测试. 另,文章最后有下载地址,可下载搭建过程中所有用到的包和其他文件. 废

nginx支持flv MP4 扩展nginx_mod_h264_streaming,nginx-rtmp-module-master,yamdi

./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --error-log-path=/usr/local/nginx/log/error.log --http-log-path=/usr/local/nginx/log/access.log --pid-path=/usr/local/nginx/var

CentOS6下基于Nginx搭建mp4/flv流媒体服务器(可随意拖动)并支持RTMP/HLS协议(含转码工具)

1.先添加几个RPM下载源 1.1)安装RPMforge的CentOS6源      [[email protected] ~]# wget -c http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm      [[email protected] ~]# rpm –import http://apt.sw.be/RPM-GPG-KEY.dag.txt      [[email 

centos 7下nginx搭建流媒体服务器【动态添加模块】

1.安装nginx依赖包 yum install gcc gcc-c++ openssl-devel zlib-devel pcre pcre-devel yamdi 2.下载解压nginx_mod_h264_streaming,让nginx支持flv,mp4流播放 wget http://h264.code-shop.com/download/nginx_mod_h264_streaming-2.2.7.tar.gz 解压后需要修改src目录下的ngx_http_streaming_modul

用nginx搭建基于rtmp或者http的flv、mp4流媒体服务器

http://itindex.NET/detail/48702-nginx-rtmp-http 一.流媒体播放方式 1.  HTTP方式 这种方式要下载FLV视频文件到本地播放,一旦FLV视频文件下载完成,就不会消耗服务器的资源和带宽,但是拖动功能没有RTMP/RTMP流媒体方式强大,很多视频网站都是用HTTP方式实现的,如:YouTube,土豆,酷6等 2.  RTMP/RTMP流媒体方式 这种方式不用下载FLV视频文件到本地,可以实时的播放flv文件,可以任意拖拽播放进度条,但是比较消耗服务

nginx搭建点播视频(Mp4播放)

首先,环境中必然要有gcc-c++环境 yum -y install gcc-c++ 1 使用openresty 这里使用的是1.11.2.1版本的openresty和1.0.2版本的openssl [email protected]: ~#yum install readline-devel pcre-devel openssl-devel gcc [email protected]: ~# tar -zxvf openresty-1.11.2.1.tar.gz [email protecte

nginx+jwplayer配置flv/MP4点播系统, 视频拖动支持

一 配置nginx 1. 下载 nginx 最新版 http://nginx.org/ 2. 安装依赖库, 以ubuntu为例 apt-get install libpcre3 libpcre3-dev libssl-dev openssl 3. 编译nginx, 增加flv和MP4的支持 /configure --with-http_flv_module --with-http_mp4_module --with-http_ssl_module --with-debug 编译时可以指定安装目录