代码改变世界

安装ffmpeg及nginx模块

2013-02-20 09:26  轩脉刃  阅读(4431)  评论(0编辑  收藏  举报

安装ffmpeg:

下载文件

wget http://ffmpeg.org/releases/ffmpeg-1.0.1.tar.gz

tar -xf ffmpeg-1.0.1.tar.gz

cd ffmpeg-1.0.1

./configure

显示错误:

[root@tester ffmpeg-1.0.1]# ./configure
yasm not found, use --disable-yasm for a crippled build
If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.

yum install yasm

然后再编译

./make

./make install

安装libx264

http://www.cnblogs.com/MikeZhang/archive/2012/07/21/installFFmpegFromSourceCode.html

http://zhidao.baidu.com/question/192172258.html

nginx和nginx_mod_h264_streaming模块

安装这个模块的目的是让视频可以在线播放,否则视频就只能下载下来才能看了

下载nginx-1.2.6和nginx_mod_h264_streaming源码

./configure --add-module=/XXXX/nginx_mod_h264_streaming/

./make

make的时候可能会出现错误:

In file included from /root/software/nginx_mod_h264_streaming-2.2.7//src/ngx_http_h264_streaming_module.c:2:
/root/software/nginx_mod_h264_streaming-2.2.7//src/ngx_http_streaming_module.c: In function ‘ngx_streaming_handler’:
/root/software/nginx_mod_h264_streaming-2.2.7//src/ngx_http_streaming_module.c:158: error: ‘ngx_http_request_t’ has no member named ‘zero_in_uri’
make[1]: *** [objs/addon/src/ngx_http_h264_streaming_module.o] Error 1
make[1]: Leaving directory `/root/software/nginx-1.2.6'
make: *** [build] Error 2

解决方法:

注释掉nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c的158到161行

http://lxneng.com/posts/160

然后重新make,make install就安装成功了