flavioribeiro / nginx-audio-track-for-hls-module

:sound: Nginx module that generates audio track for HTTP Live Streaming (HLS) streams on the fly.
GNU General Public License v3.0
136 stars 17 forks source link

Compilation with NGINX Audio Track HLS module fails #28

Closed karlisk closed 8 years ago

karlisk commented 8 years ago

While trying to compile with the RTMP and HLS Module for NGINX I'm getting errors that I can't find how to resolve. I'm trying to compile my NGINX from source on Debian 8, at first I thought it was because the precompiled Ffmpeg version from Debian-Media repo was outdated, so I also compiled it from source, but alas no progress.

Configure parameters (trying to keep it close to Debian precompiled version config parameters):

./configure
 --prefix=/etc/nginx
 --sbin-path=/usr/sbin/nginx
 --modules-path=/usr/lib/nginx/modules
 --conf-path=/etc/nginx/nginx.conf
 --error-log-path=/var/log/nginx/error.log
 --http-log-path=/var/log/nginx/access.log
 --pid-path=/var/run/nginx.pid
 --lock-path=/var/run/nginx.lock
 --http-client-body-temp-path=/var/cache/nginx/client_temp
 --http-proxy-temp-path=/var/cache/nginx/proxy_temp
 --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp
 --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp
 --http-scgi-temp-path=/var/cache/nginx/scgi_temp
 --user=nginx
 --group=nginx
 --with-openssl=/home/src/openssl
 --with-select_module
 --with-poll_module
 --with-threads
 --with-file-aio
 --with-http_ssl_module
 --with-http_v2_module
 --with-http_realip_module
 --with-http_addition_module
 --with-http_xslt_module=dynamic
 --with-http_image_filter_module=dynamic
 --with-http_geoip_module=dynamic
 --with-http_sub_module
 --with-http_dav_module
 --with-http_flv_module
 --with-http_mp4_module
 --with-http_gunzip_module
 --with-http_gzip_static_module
 --with-http_auth_request_module
 --with-http_random_index_module
 --with-http_secure_link_module
 --with-http_degradation_module
 --with-http_slice_module
 --with-http_stub_status_module
 --with-http_perl_module=dynamic
 --with-mail=dynamic
 --with-stream=dynamic
 --with-google_perftools_module
 --with-pcre
 --with-debug
 --add-module=/home/src/nginx-rtmp-module-master
 --add-module=/home/src/ngx_devel_kit-master
 --add-module=/home/src/nginx-audio-track-for-hls-module-master
 --add-module=/home/src/lua-nginx-module-master
 --with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2'
 --with-ld-opt='-Wl,-z,relro -Wl,--as-needed'

Error snippet that I'm receiving during compilation:

cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -DNDK_SET_VAR  -I src/core -I src/event -I src/event/modules -I src/os/unix -I src/http/modules/perl -I /home/src/nginx-rtmp-module-master -I /home/src/ngx_devel_kit-master/objs -I objs/addon/ndk -I /home/src/lua-nginx-module-master/src/api -I /home/src/openssl/.openssl/include -I /usr/include/libxml2 -I objs -I src/http -I src/http/modules -I src/http/v2 -I /home/src/ngx_devel_kit-master/src -I /home/src/ngx_devel_kit-master/src -I /home/src/ngx_devel_kit-master/objs -I objs/addon/ndk -I /usr/local/include/luajit-2.0 -I src/mail -I src/stream \
        -o objs/addon/nginx-audio-track-for-hls-module-master/ngx_http_aac_module.o \
        /home/src/nginx-audio-track-for-hls-module-master/ngx_http_aac_module.c
/home/src/nginx-audio-track-for-hls-module-master/ngx_http_aac_module.c: In function ‘ngx_http_aac_extract_audio’:
/home/src/nginx-audio-track-for-hls-module-master/ngx_http_aac_module.c:210:5: error: ‘codec’ is deprecated (declared at /usr/include/libavformat/avformat.h:880) [-Werror=deprecated-declarations]
     avcodec_copy_context(output_audio_stream->codec, input_audio_stream->codec);
     ^
/home/src/nginx-audio-track-for-hls-module-master/ngx_http_aac_module.c:210:5: error: ‘codec’ is deprecated (declared at /usr/include/libavformat/avformat.h:880) [-Werror=deprecated-declarations]
/home/src/nginx-audio-track-for-hls-module-master/ngx_http_aac_module.c:223:13: error: ‘av_free_packet’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4397) [-Werror=deprecated-declarations]
             av_free_packet(&new_packet);
             ^
/home/src/nginx-audio-track-for-hls-module-master/ngx_http_aac_module.c:225:9: error: ‘av_free_packet’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:4397) [-Werror=deprecated-declarations]
         av_free_packet(&packet);
         ^
/home/src/nginx-audio-track-for-hls-module-master/ngx_http_aac_module.c:211:5: error: ignoring return value of ‘avformat_write_header’, declared with attribute warn_unused_result [-Werror=unused-result]
     avformat_write_header(output_format_context, NULL);
     ^
cc1: all warnings being treated as errors
objs/Makefile:1902: recipe for target 'objs/addon/nginx-audio-track-for-hls-module-master/ngx_http_aac_module.o' failed
make[1]: *** [objs/addon/nginx-audio-track-for-hls-module-master/ngx_http_aac_module.o] Error 1
make[1]: Leaving directory '/home/src/nginx-1.10.0'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2
karlisk commented 8 years ago

Could this be because I'm simply missing AAC codec or perhaps I simply need to specify ffmpeg PATH for the module to successfully compile?

karlisk commented 8 years ago

Seems to be related to this, any updates?

21 Can't build nginx with --add-module=nginx-audio-track-for-hls-module

juanm4 commented 7 years ago

I have the same issue...how can I fix it?

flavioribeiro commented 7 years ago

weird, I'll take a look at it today

juanm4 commented 7 years ago

Thanks in advance!! I will wait your response.

alexgrusu commented 3 years ago

Any thoughts about this issue?

flavioribeiro commented 3 years ago

hey @juanm4 and @alexgrusu -- unfortunately I didn't have the chance to look into this as the module is not in active development anymore. I highly suspect we'll need to patch the code with the latest ffmpeg/libav functions (like this https://github.com/wandenberg/nginx-video-thumbextractor-module/commit/42c43b2f8bba96aa45e4d3501c27ec9e9c822b6b). The other way would be to use the supported versions for the current implementation as stated here https://github.com/flavioribeiro/nginx-audio-track-for-hls-module#requirements

alexgrusu commented 3 years ago

hello @flavioribeiro, this is what I'm trying now but I encountered a few issues. I already described everything here: https://stackoverflow.com/questions/66893908/nginx-audio-track-for-hls-module-installation