centos5.5上apache快速安裝H264流媒體支持MP4-H264邊下邊播

2013年的某一天,客戶反饋北京同事作的廣告視頻下載速度好慢,幾MB的視頻在手機上要下載接近一分鐘才能開始播放。apache

我分析後發現兩點:1)託管的服務器沒支持流媒體;2)廣告視頻MP4並不是流媒體格式。服務器

對於第二點,騰訊QQ視頻播放器或者其餘專業的視頻轉換器都能支持把普通MP4轉換成H264。rest

對於第一點,服務器,下面是一個簡單的升級方法。code

cd /tmp
wget http://people.apache.org/~pquerna/modules/mod_flvx.c
/opt/apache2/bin/apxs -i -a -c mod_flvx.c
wget http://h264.code-shop.com/download/apache_mod_h264_streaming-2.2.7.tar.gz
tar -zxvf apache_mod_h264_streaming-2.2.7.tar.gz
cd mod_h264_streaming-2.2.7/
./configure –with-apxs=/opt/apache2/bin/apxs
make
make install
vi /opt/apache2/conf/httpd.conf
添加如下4行:
LoadModule h264_streaming_module mod_h264_streaming.so
LoadModule mod_flvx.so
AddHandler h264-streaming.extensions .mp4
AddHandler flv-stream .flv視頻

/etc/init.d/httpd restartget

相關文章
相關標籤/搜索