安装ffmpeg及nginx模块

安装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就安装成功了

实时了解作者更多技术文章,技术心得,请关注微信公众号“轩脉刃的刀光剑影”

本文基于署名-非商业性使用 3.0许可协议发布,欢迎转载,演绎,但是必须保留本文的署名叶剑峰(包含链接http://www.cnblogs.com/yjf512/),且不得用于商业目的。如您有任何疑问或者授权方面的协商,请与我联系

原文地址:https://www.cnblogs.com/yjf512/p/2918047.html