whatvn / ngx_http_estreaming_module

An adaptive hls streaming module for nginx
GNU General Public License v2.0
91 stars 20 forks source link

compile #2

Closed arty777 closed 9 years ago

arty777 commented 9 years ago

i try to compile with nginx-1.7.12

i get this issue /usr/local/nginx/ngx_http_estreaming_module-master/src/ngx_http_estreaming_module.c In file included from /usr/local/nginx/ngx_http_estreaming_module-master/src/ngx_http_estreaming_module.c:14:0: /usr/local/nginx/ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:15:38: fatal error: libswresample/swresample.h: No such file or directory compilation terminated. make[1]: * [objs/addon/src/ngx_http_estreaming_module.o] Error 1 make[1]: Leaving directory `/usr/local/nginx/nginx-1.7.12' make: * [build] Error 2

whatvn commented 9 years ago

did you install ffmpeg and other required library: libx264, libfdk_aac? The error above show that you don't have ffmpeg installed.

arty777 commented 9 years ago

yes , ofcourse i install ffmpeg . Ok i try investigate this issue

root@:/usr/local/nginx/ngx_http_estreaming_module-master# dpkg -l |grep -i libswresample rc libswresample0 7:0.10.12-1~precise1 FFmpeg video software resampling library

root@strana:/usr/local/nginx/nginx-1.7.12# locate libswresample /usr/lib/x86_64-linux-gnu/libswresample.so.0 /usr/lib/x86_64-linux-gnu/libswresample.so.0.6.100 /usr/share/doc/libswresample0 /usr/share/lintian/overrides/libswresample0 /var/cache/apt/archives/libswresample0_7%3a0.10.12-1~precise1_amd64.deb /var/lib/dpkg/info/libswresample0:amd64.list /var/lib/dpkg/info/libswresample0:amd64.md5sums /var/lib/dpkg/info/libswresample0:amd64.postinst /var/lib/dpkg/info/libswresample0:amd64.postrm /var/lib/dpkg/info/libswresample0:amd64.shlibs

where nginx try to find libs like libswresample?

whatvn commented 9 years ago

hello,

the step to install on centos should be:

  1. install fdk-aac (centos comes with faac, but I dont see it's as good as fdk-aac): get it from here: https://github.com/mstorsjo/fdk-aac ./configure ; make; make install
  2. install x264, ffmpeg: yum install ffmpeg ffmpeg-devel x264 x264-devel libresample-devel.x86_64
  3. compile this module with --add-module

it should work.

arty777 commented 9 years ago

ubuntu apt-get install ffmpeg -OK apt-get install ffmpeg-dev - ubuntu have no this pkg... apt-get install x264 -OK apt-get install libx264-dev -OK apt-get install libresample-dev -OK

no normal way to work in ubuntu with libswresample ..... https://www.google.com.ua/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=libswresample%2Fswresample.h:+No+such+file+or+directory

any ideas ? Ubuntu very common OS compilation instruction for ubuntu will be big plus :)

whatvn commented 9 years ago

Ok I dont have Ubuntu here, but had some experience with it, so the steps you should take is:

  1. install yasm (to compile x264 and fdk aac), most codecs are written in asm: sudo apt-get install yasm
  2. get fdk-aac and compile: wget -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master unzip fdk-aac.zip cd mstorsjo-fdk-aac* autoreconf -fiv ./configure make make install
  3. compile x264: wget http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2 tar xjvf last_x264.tar.bz2 cd x264-snapshot* ./configure
    make make install
  4. get stable version of ffmpeg: tar xzvf ffmpeg-2.4.tar.gz cd ffmpeg-2.4 ./configure --enable-libx264 --enable-static --disable-opencl -lpthread -lm --enable-gpl --enable-libfdk-aac --enable-nonfree make && make install
  5. install this module

Let me know if you need help.

whatvn commented 9 years ago

@arty777 : I just noticed that libavresample is not need, latest commit should work on your machine now. Sorry for that.

whatvn commented 9 years ago

Step I use to compile ffmpeg and this module on ubuntu, on Centos and others should be similar: mkdir sources cd sources/ wget http://ffmpeg.org/releases/ffmpeg-2.6.2.tar.bz2 wget -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master wget http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2 apt-get install yasm unzip fdk-aac.zip cd mstorsjo-fdk-aac-83ac4a9/ autoreconf -fiv ./configure make && make install cd .. tar xjvf last_x264.tar.bz2 cd x264-snapshot-20141218-2245/ ./configure --enable-shared --enable-static make make install cd .. tar xjvf ffmpeg-2.6.2.tar.bz2 cd ffmpeg-2.6.2 ls ./configure --enable-libx264 --enable-static --disable-opencl --extra-ldflags='-L/usr/local/lib -lx264 -lpthread -lm' --enable-gpl --enable-libfdk-aac --enable-nonfree --enable-shared make make install ldconfig

then get source nginx + this module, install with --add-module

arty777 commented 9 years ago

new : /usr/local/nginx/ngx_http_estreaming_module-master/src/ngx_http_estreaming_module.c /usr/local/nginx/ngx_http_estreaming_module-master/src/ngx_http_estreaming_module.c: In function ‘ngx_estreaming_handler’: /usr/local/nginx/ngx_http_estreaming_module-master/src/ngx_http_estreaming_module.c:181:9: error: request for member ‘log_level’ in something not a structure or union /usr/local/nginx/ngx_http_estreaming_module-master/src/ngx_http_estreaming_module.c:181:9: error: passing argument 2 of ‘ngx_log_error_core’ from incompatible pointer type [-Werror] src/core/ngx_log.h:88:6: note: expected ‘struct ngx_logt ’ but argument is of type ‘double (_)(double)’ cc1: all warnings being treated as errors make[1]: *\ [objs/addon/src/ngx_http_estreaming_module.o] Error 1

whatvn commented 9 years ago

Strange, in my setup which use 1.6.2 compile withou error. could you please test if latest commit 82925a1abc6c4ac8623f51a2a2c7839ed6cc7732 can fix it?

arty777 commented 9 years ago

after fix minus ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, minus "examine mp4 filename: \"%V\"", &path); plus ngx_log_debug1(NGX_LOG_DEBUG, log, 0, plus "examine mp4 filename: \"%s\"", &path.data);

i have: /usr/local/nginx/ngx_http_estreaming_module-master/src/ngx_http_estreaming_module.c /usr/local/nginx/ngx_http_estreaming_module-master/src/ngx_http_estreaming_module.c: In function ‘ngx_estreaming_handler’: /usr/local/nginx/ngx_http_estreaming_module-master/src/ngx_http_estreaming_module.c:181:5: error: request for member ‘log_level’ in something not a structure or union /usr/local/nginx/ngx_http_estreaming_module-master/src/ngx_http_estreaming_module.c:181:5: error: passing argument 2 of ‘ngx_log_error_core’ from incompatible pointer type [-Werror] src/core/ngx_log.h:88:6: note: expected ‘struct ngx_logt ’ but argument is of type ‘double (_)(double)’ cc1: all warnings being treated as errors make[1]: * [objs/addon/src/ngx_http_estreaming_module.o] Error 1 make[1]: Leaving directory `/usr/local/nginx/nginx-1.7.12' make: * [build] Error 2

arty777 commented 9 years ago

1.6.3 with/without last commit https://github.com/whatvn/ngx_http_estreaming_module/commit/82925a1abc6c4ac8623f51a2a2c7839ed6cc7732

/usr/local/nginx/ngx_http_estreaming_module-master/src/ngx_http_estreaming_module.c: In function ‘ngx_estreaming_handler’: /usr/local/nginx/ngx_http_estreaming_module-master/src/ngx_http_estreaming_module.c:181:9: error: request for member ‘log_level’ in something not a structure or union /usr/local/nginx/ngx_http_estreaming_module-master/src/ngx_http_estreaming_module.c:181:9: error: passing argument 2 of ‘ngx_log_error_core’ from incompatible pointer type [-Werror] src/core/ngx_log.h:81:6: note: expected ‘struct ngx_logt ’ but argument is of type ‘double (_)(double)’ cc1: all warnings being treated as errors make[1]: * [objs/addon/src/ngx_http_estreaming_module.o] Error 1 make[1]: Leaving directory `/usr/local/nginx/nginx-1.6.3' make: * [build] Error 2

arty777 commented 9 years ago

my config ./configure --prefix=/usr/local/nginx/work/nginx1 --sbin-path=/usr/local/nginx/work/nginx1/sbin/nginx1 --conf-path=/usr/local/nginx/work/nginx1/conf/nginx.conf --pid-path=/usr/local/nginx/work/nginx1/nginx1.pid --error-log-path=/usr/local/nginx/work/nginx1/log/error.log --lock-path=/usr/local/nginx/work/nginx1/nginx.lock --http-log-path=/usr/local/nginx/work/nginx1/log/access.log --http-client-body-temp-path=/usr/local/nginx/work/nginx1/temp/client --http-proxy-temp-path=/usr/local/nginx/work/nginx1/temp/proxy --http-fastcgi-temp-path=/usr/local/nginx/work/nginx1/temp/fastcgi --http-uwsgi-temp-path=/usr/local/nginx/work/nginx1/temp/uwsgi --http-scgi-temp-path=/usr/local/nginx/work/nginx1/temp/scgi --with-file-aio --without-http_autoindex_module --without-http_browser_module --without-http_fastcgi_module --without-http_geo_module --without-http_empty_gif_module --without-http_memcached_module --without-http_ssi_module --without-http_userid_module --without-http_gzip_module --with-http_perl_module --with-debug --with-http_secure_link_module --with-http_stub_status_module --add-module=/usr/local/nginx/ngx_http_estreaming_module-master

whatvn commented 9 years ago

in line 181, please change second parameter from log to nlog or use the latest commit b16b7f2bdf2ca27c70354291f8f79013db5dcc04 . My bad :-1:

arty777 commented 9 years ago

/usr/bin/ld: cannot find -lavresample collect2: ld returned 1 exit status make[1]: * [objs/nginx] Error 1 make[1]: Leaving directory `/usr/local/nginx/nginx-1.7.12' make: * [build] Error 2

root@strana:/usr/local/nginx/ngx_http_estreaming_module-master# ffmpeg -V ffmpeg version 2.6.2 Copyright (c) 2000-2015 the FFmpeg developers built with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5) configuration: --enable-libx264 --enable-static --disable-opencl --enable-gpl --enable-libfdk-aac --enable-nonfree libavutil 54. 20.100 / 54. 20.100 libavcodec 56. 26.100 / 56. 26.100 libavformat 56. 25.101 / 56. 25.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 11.102 / 5. 11.102 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 3.100 / 53. 3.100

arty777 commented 9 years ago

when i install ffmpeg : cd ffmpeg-2.6.2 ./configure --enable-libx264 --enable-static --disable-opencl --enable-gpl --enable-libfdk-aac --enable-nonfree

Unknown option "-lpthread".

Unknown option "-lm".

make && make install

whatvn commented 9 years ago

what if you change config file, line 1, remove -lavresample and change to -lswresample. Sorry my development machine is too much different from your, so I can not debug exactly.

arty777 commented 9 years ago
    -lpthread -lcrypt -lavformat -lavcodec -lavutil -lavcodec -lswresample -lavfilter -lrt -lswscale -lz -lm -lbz2 -lfdk-aac -lx264 -lpcre -lcrypto -lcrypto \
    -Wl,-E -fstack-protector -L/usr/local/lib -L/usr/lib/perl/5.14/CORE -lperl -ldl -lm -lpthread -lc -lcrypt

/usr/local/lib/libavfilter.a(avf_showcqt.o): In function plot_cqt': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/avf_showcqt.c:545: undefined reference toav_fft_permute' /usr/local/nginx/ffmpeg-2.6.2/libavfilter/avf_showcqt.c:546: undefined reference to av_fft_calc' /usr/local/lib/libavfilter.a(avf_showcqt.o): In functionconfig_output': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/avf_showcqt.c:350: undefined reference to av_fft_init' /usr/local/nginx/ffmpeg-2.6.2/libavfilter/avf_showcqt.c:464: undefined reference toav_fft_permute' /usr/local/nginx/ffmpeg-2.6.2/libavfilter/avf_showcqt.c:465: undefined reference to av_fft_calc' /usr/local/lib/libavfilter.a(avf_showcqt.o): In functionuninit': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/avf_showcqt.c:123: undefined reference to av_fft_end' /usr/local/lib/libavfilter.a(avf_showspectrum.o): In functionconfig_output': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/avf_showspectrum.c:178: undefined reference to av_rdft_end' /usr/local/nginx/ffmpeg-2.6.2/libavfilter/avf_showspectrum.c:179: undefined reference toav_rdft_init' /usr/local/lib/libavfilter.a(avf_showspectrum.o): In function plot_spectrum_column': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/avf_showspectrum.c:328: undefined reference toav_rdft_calc' /usr/local/lib/libavfilter.a(avf_showspectrum.o): In function uninit': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/avf_showspectrum.c:114: undefined reference toav_rdft_end' /usr/local/lib/libavfilter.a(f_select.o): In function config_input': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/f_select.c:238: undefined reference toav_pixelutils_get_sad_fn' /usr/local/lib/libavfilter.a(vf_deshake.o): In function init': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/vf_deshake.c:349: undefined reference toav_pixelutils_get_sad_fn' /usr/local/lib/libavfilter.a(vf_mpdecimate.o): In function init': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/vf_mpdecimate.c:134: undefined reference toav_pixelutils_get_sad_fn' /usr/local/lib/libavfilter.a(vf_pp.o): In function pp_filter_frame': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/vf_pp.c:139: undefined reference topp_postprocess' /usr/local/lib/libavfilter.a(vf_pp.o): In function pp_config_props': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/vf_pp.c:112: undefined reference topp_get_context' /usr/local/lib/libavfilter.a(vf_pp.o): In function pp_uninit': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/vf_pp.c:158: undefined reference topp_free_mode' /usr/local/lib/libavfilter.a(vf_pp.o): In function pp_init': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/vf_pp.c:56: undefined reference topp_get_mode_by_name_and_quality' /usr/local/lib/libavfilter.a(vf_pp.o): In function pp_uninit': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/vf_pp.c:160: undefined reference topp_free_context' /usr/local/lib/libavfilter.a(vf_spp.o): In function config_input': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/vf_spp.c:334: undefined reference toavcodec_dct_init' /usr/local/lib/libavfilter.a(vf_spp.o): In function child_class_next': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/vf_spp.c:49: undefined reference toavcodec_dct_get_class' /usr/local/lib/libavfilter.a(vf_spp.o): In function init_dict': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/vf_spp.c:460: undefined reference toavcodec_dct_alloc' /usr/local/lib/libavfilter.a(af_atempo.o): In function yae_release_buffers': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/af_atempo.c:229: undefined reference toav_rdft_end' /usr/local/nginx/ffmpeg-2.6.2/libavfilter/af_atempo.c:232: undefined reference to av_rdft_end' /usr/local/lib/libavfilter.a(af_atempo.o): In functionyae_reset': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/af_atempo.c:286: undefined reference to av_rdft_end' /usr/local/nginx/ffmpeg-2.6.2/libavfilter/af_atempo.c:289: undefined reference toav_rdft_end' /usr/local/nginx/ffmpeg-2.6.2/libavfilter/af_atempo.c:292: undefined reference to av_rdft_init' /usr/local/nginx/ffmpeg-2.6.2/libavfilter/af_atempo.c:298: undefined reference toav_rdft_init' /usr/local/lib/libavfilter.a(af_atempo.o): In function yae_xcorr_via_rdft': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/af_atempo.c:631: undefined reference toav_rdft_calc' /usr/local/lib/libavfilter.a(af_atempo.o): In function yae_flush': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/af_atempo.c:932: undefined reference toav_rdft_calc' /usr/local/lib/libavfilter.a(af_atempo.o): In function yae_apply': /usr/local/nginx/ffmpeg-2.6.2/libavfilter/af_atempo.c:841: undefined reference toav_rdft_calc' /usr/local/nginx/ffmpeg-2.6.2/libavfilter/af_atempo.c:873: undefined reference to av_rdft_calc' /usr/local/lib/libavcodec.a(vaapi.o): In functionff_vaapi_commit_slices': /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:101: undefined reference to vaCreateBuffer' /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:110: undefined reference tovaCreateBuffer' /usr/local/lib/libavcodec.a(vaapi.o): In function ff_vaapi_render_picture': /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:52: undefined reference tovaUnmapBuffer' /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:65: undefined reference to vaBeginPicture' /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:69: undefined reference tovaRenderPicture' /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:73: undefined reference to vaRenderPicture' /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:78: undefined reference tovaEndPicture' /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:56: undefined reference to vaUnmapBuffer' /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:61: undefined reference tovaUnmapBuffer' /usr/local/lib/libavcodec.a(vaapi.o): In function alloc_buffer': /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:129: undefined reference tovaCreateBuffer' /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:131: undefined reference to vaMapBuffer' /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:129: undefined reference tovaCreateBuffer' /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:131: undefined reference to vaMapBuffer' /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:129: undefined reference tovaCreateBuffer' /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:131: undefined reference to vaMapBuffer' /usr/local/lib/libavcodec.a(vaapi.o): In functiondestroy_buffers': /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:38: undefined reference to vaDestroyBuffer' /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:38: undefined reference tovaDestroyBuffer' /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:38: undefined reference to vaDestroyBuffer' /usr/local/nginx/ffmpeg-2.6.2/libavcodec/vaapi.c:38: undefined reference tovaDestroyBuffer' collect2: ld returned 1 exit status make[1]: * [objs/nginx] Error 1 make[1]: Leaving directory `/usr/local/nginx/nginx-1.7.12' make: * [build] Error 2

whatvn commented 9 years ago

hmm, did you follow steps I posted above. The error shows that you are using static module of ffmpeg, which has suffix .a instead of dynamic loading module which has suffix .so.

Please recompile ffmpeg with

/configure --enable-libx264 --enable-static --disable-opencl --enable-gpl --enable-libfdk-aac --enable-nonfree --enable-shared
arty777 commented 9 years ago

all fine after /configure --enable-libx264 --enable-static --disable-opencl --enable-gpl --enable-libfdk-aac --enable-nonfree --enable-shared

before i configure with this opt: ./configure --enable-libx264 --enable-static --disable-opencl --enable-gpl --enable-libfdk-aac --enable-nonfree

whatvn commented 9 years ago

I close this issue, if you have another problem, we will open it later :)