centos 6.4 Apache 配置 flv mp4.h264 流媒体拖动

http://blog.csdn.net/xst686/article/details/9763995

加入流媒体扩展后要重启 httpd

flv 流媒体

<textarea class="crayon-plain print-no" readonly="readonly" data-settings="">wget http://people.apache.org/~pquerna/modules/mod_flvx.c /usr/local/apache/bin/apxs -c -i&nbsp;mod_flvx.c</textarea>

1

2

//people.apache.org/~pquerna/modules/mod_flvx.c

c

httpd.conf 加入

<textarea class="crayon-plain print-no" readonly="readonly" data-settings="">LoadModule flvx_module modules/mod_flvx.so AddHandler flv-stream .flv</textarea>

1

2

so

flv

mp4 流媒体

<textarea class="crayon-plain print-no" readonly="readonly" data-settings="">wget http://h264.code-shop.com/download/apache_mod_h264_streaming-2.2.7.tar.gz tar -zxvf apache_mod_h264_streaming-*.tar.gz cd&nbsp;apache_mod_h264_streaming-* ./configure --with-apxs=/usr/local/apache/bin/apxs make make install</textarea>

1

2

3

4

5

6

//h264.code-shop.com/download/apache_mod_h264_streaming-2.2.7.tar.gz

gz

*

apxs

make

install

httpd.conf 加入

<textarea class="crayon-plain print-no" readonly="readonly" data-settings="">LoadModule h264_streaming_module modules/mod_h264_streaming.so AddHandler h264-streaming.extensions .mp4</textarea>

1

2

so

mp4

http://www.php1.cn/article/59985.html

nginx下配置flv拖动

首先,下载nginx源码包,以0.8.54版本为例

wget http://nginx.org/download/nginx-0.8.54.tar.gz

重编译之前,停掉nginx服务。查看一下nginx原来的编译参数

/usr/local/nginx/sbin/nginx ?V

在原来的参数基础上添加flv的支持

0.8.54版本为例,进行编译

./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6 --with-http_flv_module

make && make install

编译完成后,在nginx.conf文件里添加flv支持

location ~ \.flv$ {

flv;

}

启动nginx,使用curl ?I 来查看是否成功。

主要查看的是 Content-Length的数值。和加上参数start 之后进行对比。

例如:

curl -I http://video.zhangyuc.com/flv/110718/video.flv

Content-Length: 1218888

对比

curl -I http://video.zhangyuc.com/flv/110718/video.flv?<strong>start=12345</strong>

Content-Length: 1206556

以上示例只列出Content-Length的值。

假如加上参数之后,Content-Length值依旧和之前相同,则表示配置没有成功

apache下配置flv拖动

Windows服务器下配置拖动,一共需要两步

第一步,下载mod_flvx.so并放到apache目录下的modules文件夹下

下载地址:

http://www.mosalov.com/files/mod_flvx.so

第二步,在apache的配置文件中,添加以下内容,重启apache服务

LoadModule flvx_module modules/mod_flvx.so

AddHandler flv-stream .flv

linux服务器下配置拖动,需要下载mod_flvx.c文件后进行编译

第一步,下载mod_flvx.c,并进行编译。

wget https://github.com/osantana/mod_flvx/blob/master/mod_flvx.c

使用apxs进行编译,编译前,请检查apxs版本

apxs -c -i ./mod_flvx.c

第二步,在apache的conf.d目录下创建mod_flvx.conf文件,并写入以下内容

LoadModule flvx_module /usr/lib/apache2/modules/mod_flvx.so

AddHandler flv-stream .flv

配置完成后重启即可