1.安装nginx(nginx-0.7.62),需要加载htpp_flv_module
./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_flv_module
2.配置nginx
[root@localhost flv_files]# cat /usr/local/webserver/nginx/conf/nginx.conf
#user www www;
worker_processes 1;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name flv.domain.com;
index index.shtml index.html index.htm;
root /disk/webhome/htdocs/flv_files;
# limit_rate_after 3m;
limit_rate 512k;
charset gb2312;
location ~ \.flv {
flv;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
3.测试并启动nginx
/usr/local/webserver/nginx/sbin/nginx -t
/usr/local/webserver/nginx/sbin/nginx
4.光配置好nginx服务器不管用,还需要flv文件metadata中含有关键帧信息,才能实现拖动播放
安装添加关键帧信息的软件yamdi(开源的)
wget
tar zxvf yamdi-1.4.tar.gz
cd yadmi-1.4
make
make install
将flv文件放入webserver的家目录中/disk/webhome/htdocs/flv_files
文件名为:english.flv
yamdi -i english.flv -o english.flv.new 添加关键帧信息(如果文件大,要占用一定时间)
5.通过JW Player,测试播放Nginx服务器上的flv视频
完成!
阅读(4844) | 评论(0) | 转发(1) |