1.首先需要安装apx2
sudo apt-get install apache2-threaded-dev
2.下载h264stream的tar包
cd ~
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
3.创建
cd ~/mod_h264_streaming-2.2.7
./configure --with-apxs=`which apxs2`
make
sudo make install
4. 编辑/etc/apache2/httpd.conf
sudo vim /etc/apache2/httpd.conf
加入内容:
LoadModule h264_streaming_module /usr/lib/apache2/modules/mod_h264_streaming.so
AddHandler h264-streaming.extensions .mp4
5.重启apache
sudo /etc/init.d/apache2 restart
apache运行出错,提示no apache mpm package installed
原因:/usr/sbin/apache2这个文件不存在
解决办法:
从apache-mpm-work(或者其他mpm包)包里解压出
/usr/sbin/apache2这个文件
放到/usr/sbin/apache2
查看apache2在什么地方:
分别安装图中3个软件包:
经过试验,我只装了apache-mpm-prework
sudo /etc/init.d/apache2 start
成功运行apache
6.下载一个.mp4视频放到apache的web根目录下,我的是在apache的web根目录下(var/www)
wget -O test.mp4 "http://h264.code-shop.com:8080/trailer2.mp4"
这是从h264的官网下载的一个视频,也可以自己上传一个视频到你的apache的web根目录下。
7.测试,输入http://yourip/test.mp4
如果你使用的IE浏览器会出现下载的提示框,最好你是选择使用chrome浏览器。
如果出现:
这种情况的话,说明你的.mp4视频文件下载的有问题,需要重新换一个视频再重试。
安装正确应该与 http://192.168.0.56/input.mp4相同
Get The Latest Flash Player
WP JW Player Plugin Powered by
TubePress.NET
21/08/11:
Plane crashes in Canadian Arctic, 12 killed - USA Today
21/08/11:
Perry's extremist course toward presidency - San Antonio Express
21/08/11:
4 die in flash floods that swallowed cars - Boston Globe
21/08/11:
Biden Raises Human Rights While Assuring China on Treasuries - Bloomberg
21/08/11:
Hazare's fast enters sixth day - The Hindu
版权声明:本文为博主原创文章,未经博主允许不得转载。 |