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 nginx failure #13

Closed adisis closed 9 years ago

adisis commented 9 years ago

when I 'make' nginx , previously using './configure --add-module=./ngx_http_estreaming_module' I got this error :

cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -ggdb -D_DEBUG -D_LARGEFILE_SOURCE -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -I src/mail -I src/stream \ -o objs/addon/src/ngx_http_estreaming_module.o \ ./ngx_http_estreaming_module/src/ngx_http_estreaming_module.c In file included from ./ngx_http_estreaming_module/src/ngx_http_estreaming_module.c:12:0: ./ngx_http_estreaming_module/src/output_m3u8.h: In function ‘mp4_create_m3u8’: ./ngx_http_estreaming_module/src/outputm3u8.h:73:9: error: ‘rewrite’ undeclared (first use in this function) rewrite = (char ) ngx_palloc(mp4_context->r->pool, ^ ./ngx_http_estreaming_module/src/outputm3u8.h:73:9: note: each undeclared identifier is reported only once for each function it appears in make[1]: ** [objs/addon/src/ngx_http_estreaming_module.o] Error 1

note : I'm using ubuntu 14.04

whatvn commented 9 years ago

Hello, I was about to split source code into multiple version to make test, last commit was broken due to poor-checking. Just commit fix, can you check?

whatvn commented 9 years ago

@adisis any luck?

adisis commented 9 years ago

I still missing some library, could you point out what library I should add for this errors ?

-lpthread -lcrypt -lswresample -lavformat -lavcodec -lavutil -lavcodec -lavfilter -lrt -lswscale -lz -lm -lbz2 -lfdk-aac -lx264 -lpcre -lcrypto -lcrypto -lz

objs/addon/src/ngx_http_estreaming_module.o: In function encode_write_frame': /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:543: undefined reference toav_frame_free' objs/addon/src/ngx_http_estreaming_module.o: In function filter_encode_write_frame': /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:569: undefined reference toav_buffersrc_add_frame_flags' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:578: undefined reference to av_frame_alloc' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:584: undefined reference toav_buffersink_get_frame' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:593: undefined reference to av_frame_free' objs/addon/src/ngx_http_estreaming_module.o: In functioninit_filter': /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:472: undefined reference to avfilter_graph_parse_ptr' objs/addon/src/ngx_http_estreaming_module.o: In functionngx_estreaming_adaptive_bitrate': /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:694: undefined reference to av_frame_alloc' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:704: undefined reference toav_frame_free' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:710: undefined reference to av_frame_get_best_effort_timestamp' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:712: undefined reference toav_frame_free' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:717: undefined reference to av_frame_free' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:736: undefined reference toav_frame_alloc' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:740: undefined reference to av_frame_get_best_effort_timestamp' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:742: undefined reference toav_frame_free' objs/addon/src/ngx_http_estreaming_module.o: In function flush_decoder': /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:635: undefined reference toav_frame_alloc' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:638: undefined reference to av_frame_free' objs/addon/src/ngx_http_estreaming_module.o: In functionngx_estreaming_adaptive_bitrate': /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module-master/src/ngx_http_adaptive_streaming.h:777: undefined reference to `av_frame_free' collect2: error: ld returned 1 exit status make[1]: *\ [objs/nginx] Error 1

adisis commented 9 years ago

Sorry not try it yet, will try tonight.

Thanks for support

Sent from Yahoo Mail on Android

From:"Hung Nguyen" notifications@github.com Date:Tue, 28 Jul, 2015 at 3:11 pm Subject:Re: [ngx_http_estreaming_module] compile nginx failure (#13)

@adisis any luck?

— Reply to this email directly or view it on GitHub.

whatvn commented 9 years ago

You must install ffmpeg library before installing this module

On Tue, 28 Jul 2015 at 21:16 adisis notifications@github.com wrote:

Sorry not try it yet, will try tonight.

Thanks for support

Sent from Yahoo Mail on Android

From:"Hung Nguyen" notifications@github.com Date:Tue, 28 Jul, 2015 at 3:11 pm Subject:Re: [ngx_http_estreaming_module] compile nginx failure (#13)

@adisis any luck?

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/whatvn/ngx_http_estreaming_module/issues/13#issuecomment-125623945 .

adisis commented 9 years ago

Yeach,looks like I missing ffmpeg-dev in my repository Ubuntu trusty

 On Tuesday, July 28, 2015 9:18 PM, Hung Nguyen <notifications@github.com> wrote:

You must install ffmpeg library before installing this module

On Tue, 28 Jul 2015 at 21:16 adisis notifications@github.com wrote:

Sorry not try it yet, will try tonight.

Thanks for support

Sent from Yahoo Mail on Android

From:"Hung Nguyen" notifications@github.com Date:Tue, 28 Jul, 2015 at 3:11 pm Subject:Re: [ngx_http_estreaming_module] compile nginx failure (#13)

@adisis any luck?

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/whatvn/ngx_http_estreaming_module/issues/13#issuecomment-125623945 .

— Reply to this email directly or view it on GitHub.

adisis commented 9 years ago

I'm sure I've ffmpeg installed correctly

ffmpeg version git-2015-07-24-5da90d7 Copyright (c) 2000-2015 the FFmpeg developers built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04) configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3 libavutil 54. 28.100 / 54. 28.100 libavcodec 56. 52.100 / 56. 52.100 libavformat 56. 40.101 / 56. 40.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 27.100 / 5. 27.100 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 libpostproc 53. 3.100 / 53. 3.100 Hyper fast Audio and Video encoder

but I still got error message when compile

objs/addon/src/ngx_http_estreaming_module.o: In function encode_write_frame': /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:543: undefined reference toav_frame_free' objs/addon/src/ngx_http_estreaming_module.o: In function filter_encode_write_frame': /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:569: undefined reference toav_buffersrc_add_frame_flags' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:578: undefined reference to av_frame_alloc' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:584: undefined reference toav_buffersink_get_frame' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:593: undefined reference to av_frame_free' objs/addon/src/ngx_http_estreaming_module.o: In functioninit_filter': /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:472: undefined reference to avfilter_graph_parse_ptr' objs/addon/src/ngx_http_estreaming_module.o: In functionngx_estreaming_adaptive_bitrate': /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:694: undefined reference to av_frame_alloc' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:704: undefined reference toav_frame_free' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:710: undefined reference to av_frame_get_best_effort_timestamp' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:712: undefined reference toav_frame_free' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:717: undefined reference to av_frame_free' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:736: undefined reference toav_frame_alloc' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:740: undefined reference to av_frame_get_best_effort_timestamp' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:742: undefined reference toav_frame_free' objs/addon/src/ngx_http_estreaming_module.o: In function flush_decoder': /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:635: undefined reference toav_frame_alloc' /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:638: undefined reference to av_frame_free' objs/addon/src/ngx_http_estreaming_module.o: In functionngx_estreaming_adaptive_bitrate': /myhome/adisis/stream/nginx-1.9.3/./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:777: undefined reference to `av_frame_free' collect2: error: ld returned 1 exit status

whatvn commented 9 years ago

can you share the way you install ffmpeg on your system? As ffmpeg output, I am pretty sure you didn't read README file I provide along with this project, you have to do exactly the same in order to install this module because it relies heavily on ffmpeg , libfdk-aac (not faac) header file and libraries.

whatvn commented 9 years ago

update, I just clone source code from this repo and it compiled ok on my system: centos 7, with ffmpeg and libfdk-aac install

adisis commented 9 years ago

here below my ffmpeg config

PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \ --prefix="$HOME/ffmpeg_build" \ --pkg-config-flags="--static" \ --extra-cflags="-I$HOME/ffmpeg_build/include" \ --extra-ldflags="-L/usr/local/lib -lx264 -lpthread -lm" \ --bindir="$HOME/bin" \ --enable-gpl \ --enable-libfdk-aac \ --enable-libfreetype \ --enable-libmp3lame \ --enable-libtheora \ --enable-libvorbis \ --enable-libvpx \ --enable-libopus \ --enable-libx264 \ --enable-libx265 \ --enable-nonfree \ --enable-static \ --disable-opencl

whatvn commented 9 years ago

ok lets do all once again, to install this module, we have to go to few steps:

  1. fdk-aac ./configure; make && make install
  2. x264, download and install likes this ./configure --disable-opencl --enable-shared; make && make install
  3. ffmpeg: ./configure --enable-libx264 --disable-opencl --extra-ldflags='-L/usr/local/lib -lx264 -lpthread -lm' --enable-gpl --enable-libfdk-aac --enable-nonfree --enable-shared; make && make install

At this step (for me) on Centos 7, those libraries will be install in /usr/local/lib which Centos 7 does not look at to load dynamic loading libraries, so you have to add to /etc/ld.so.conf like this

[root@localhost ffmpeg-2.5]# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib

then run ldconfig

  1. Back to nginx location: ./configure --add-module=../ngx_http_estreaming_module/; make && make install

if it does not work, please post the errors, I will follow up with you :)

adisis commented 9 years ago

rerun procedure with your pointer, stuck on this cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -ggdb -D_DEBUG -D_LARGEFILE_SOURCE  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -I src/mail \         -o objs/addon/src/ngx_http_estreaming_module.o \         ./ngx_http_estreaming_module/src/ngx_http_estreaming_module.c In file included from ./ngx_http_estreaming_module/src/ngx_http_estreaming_module.c:14:0: ./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h: In function ‘prepare_output_encoder’: ./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:290:13: error: ‘me_method’ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:1728) [-Werror=deprecated-declarations] cc1: all warnings being treated as errors make[1]: *\ [objs/addon/src/ngx_http_estreaming_module.o] Error 1

 On Friday, July 31, 2015 6:13 PM, Hung Nguyen <notifications@github.com> wrote:

ok lets do all once again, to install this module, we have to go to few steps:

[root@localhost ffmpeg-2.5]# cat /etc/ld.so.conf include ld.so.conf.d/*.conf /usr/local/lib then run ldconfig

whatvn commented 9 years ago

could you please use newest commit and try again, commit id 422c0d1bbba7d34ca7c0537825a82fa51673f658

whatvn commented 9 years ago

@adisis any thing new?

adisis commented 9 years ago

sorry late to response, here result compile with the last commit

cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -ggdb -D_DEBUG -D_LARGEFILE_SOURCE  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -I src/mail \         -o objs/addon/src/ngx_http_estreaming_module.o \         ./ngx_http_estreaming_module/src/ngx_http_estreaming_module.c In file included from ./ngx_http_estreaming_module/src/ngx_http_estreaming_module.c:14:0: ./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h: In function ‘prepare_output_encoder’: ./ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:291:13: error: ‘me_method’ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:1728) [-Werror=deprecated-declarations] cc1: all warnings being treated as errors make[1]: *\ [objs/addon/src/ngx_http_estreaming_module.o] Error 1

 On Monday, August 10, 2015 11:47 AM, Hung Nguyen <notifications@github.com> wrote:

@adisis any thing new?— Reply to this email directly or view it on GitHub.

whatvn commented 9 years ago

I am sorry, my development machine uses static libraries so I can not test this error completely, I used older version than yours. As newest ffmpeg comments that me_method is completely useless, I remove it completely, could you please make a another test?

whatvn commented 9 years ago

@adisis are you still getting error?

whatvn commented 9 years ago

close as you didn't response for long time