http协议视频直播服务器,nginx 搭建http协议拖动播放 FLV 视频播放服务器

1)、Nginx服务器的安装

#安装zlib

tar xzvf zlib-1.2.3.tar.gz

cd zlib-1.2.3

./configure

make && make install

#安装pcre

tar zxvf pcre-7.9.tar.gz

cd pcre-7.9

./configure --prefix=/usr/local/pcre

make && make install

#安装nginx

groupadd www

useradd -g www www

tar xzvf nginx-0.8.34.tar.gz

cd nginx-0.8.34

./configure --with-http_ssl_module

--with-pcre=/root/zhang/nginx/pcre-7.9

--with-zlib=/root/zhang/nginx/zlib-1.2.3 --user=www --group=www

--prefix=/usr/local/webserver/nginx --with-http_flv_module

make && make install

2)、安装yamdi

yadmi的作用是为flv文件添加关键帧,才能实现拖动播放

#下载yadmi

#安装yadmi

tar xzvf yamdi-1.4.tar.gz

cd yamdi-1.4

make && make install

使用方法:yamdi -i input.flv -o out.flv

给input.flv文件 添加关键帧,输出为out.flv文件

3)、配置nginx

vi /usr/local/nginx/conf/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 80;

server_name 192.168.1.105;

root /usr/local/nginx/html/flv_file/;

limit_rate_after

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

limit_rate

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

index index.html;

charset utf-8;

location ~ \.flv {

flv;

}

error_page 500 502 503

504 /50x.html;

location = /50x.html {

root html;

}

}

}

4)、基本上已经设置完毕,但是此时我们测试的时候还需要一个支持拖拽播放的flash播放器,开源的JW

Player就可以实现这样的功能.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值