Linux下视频流媒体服务器搭建详解(3)

编译Nginx

wget http://h264.code-shop.com/download/nginx_mod_h264_streaming-2.2.7.tar.gz tar xzvf nginx_mod_h264_streaming-2.2.7.tar.gz # https://github.com/arut/nginx-rtmp-module unzip nginx-rtmp-module-master.zip vi nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c # 注释以下内容 /* TODO: Win32 */ if (r->zero_in_uri) { return NGX_DECLINED; } groupadd nginx useradd nginx usermod -G nginx nginx tar zxf nginx-1.8.0.tar.gz cd nginx-1.8.0 ./configure --prefix=/usr/local/nginx \ --add-module=/opt/video/nginx_mod_h264_streaming-2.2.7 \ --with-http_flv_module \ --with-http_ssl_module \ --with-http_mp4_module \ --with-http_gzip_static_module \ --with-http_stub_status_module \ --with-pcre=/opt/video/pcre-8.37 \ --with-zlib=/opt/video/zlib-1.2.8 \ --user=nginx --group=nginx \ --add-module=/opt/video/nginx-rtmp-module-master \ --with-cc-opt=-I/opt/ffmpeg/include \ --with-ld-opt=-L/opt/ffmpeg/lib-R/opt/ffmpeg/lib make make install

配置nginx.conf文件

server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root /var/www/html; index index.html index.htm; location ~ \.flv$ { flv; } location ~ \.mp4$ { mp4; } } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)$ { root /var/www/html; break; }

更多详情见请继续阅读下一页的精彩内容

linux

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/fdd04d694511a1613770afd91de365d7.html