Added support for flv and mp4 streaming media playing in nginx

Source: Internet
Author: User

Default nginx does not support streaming media drag and drop functions, flv built-in support, only need to add-with-http_flv_module can be, flv video needs to add key frame, you can use yadmi to process yamdi-I in. flv out. flv

Check the nginx compiling environment before installing nginx.
/Usr/local/nginx/sbin/nginx-V
See if there is. If the with-http_flv_module doesn't, add this sentence.
Copy an existing environment, followed by-add-module =/root/chenwei/movie/nginx_mod_h264_streaming-2.2.7
. /Configure-user = www-group = www-prefix =/usr/local/nginx-with-http_stub_status_module-with-http_ssl_module-with-http_gzip_static_module-with-ipv6-add-module =/root/movie/with-http_flv_module

Make

Ngx_http_streaming_module.c: 158: 8: Error: 'ngx _ http_request_t 'no member named 'zero _ in_uri'

Find the ngx_http_streaming_module.c 158 line
Comment out
If (r-> zero_in_uri) {return NGX_DECLINED;}

../Nginx_mod_h264_streaming-2.2.7/src/mp4_reader.c: in the function 'esds _ read:
../Nginx_mod_h264_streaming-2.2.7/src/mp4_reader.c: 377: 16: Error: variable 'stream _ priority 'is set but not used [-Werror = unused-but-set-variable]
../Nginx_mod_h264_streaming-2.2.7/src/mp4_reader.c: 376: 12: Error: variable 'stream _ id' is set but not used [-Werror = unused-but-set-variable]
../Nginx_mod_h264_streaming-2.2.7/src/mp4_reader.c: In the 'stsd _ parse_vide 'function:
../Nginx_mod_h264_streaming-2.2.7/src/mp4_reader.c: 529: 22: Error: variable 'level _ indication 'is set but not used [-Werror = unused-but-set-variable]
../Nginx_mod_h264_streaming-2.2.7/src/mp4_reader.c: 528: 22: Error: variable 'Profile _ compatibility 'is set but not used [-Werror = unused-but-set-variable]
../Nginx_mod_h264_streaming-2.2.7/src/mp4_reader.c: 527: 22: Error: variable 'Profile _ indication 'is set but not used [-Werror = unused-but-set-variable]
../Nginx_mod_h264_streaming-2.2.7/src/mp4_reader.c: 526: 22: Error: variable 'configuration _ version' is set but not used [-Werror = unused-but-set-variable]
Ca-: all warnings being treated as errors
Make [1]: *** [objs/addon/src/mp4_reader.o] Error 1
# Vim objs/Makefile (modify the objs/Makefile file and remove "-Werror"), and then compile the file normally.
Move objs/nginx to the nginx installation directory (/usr/local/nginx/sbin/nginx)

Add
Location ~ . Flv {
Flv;
}
Location ~ . Mp4 {
Mp4;
}

Restart nginx
Nginx-t
Nginx-s reload

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.