ngx_http_estreaming_module
ngx_http_estreaming_module copied to clipboard
Not able to build nginx from sources
I have tried to add module ngx_http_estreaming_module to nginx but getting a build error as "No such file or directory #include <libswresample/swresample.h>"
please show your detail error log.
Same here. Below is the log
In file included from ../ngx_http_estreaming_module/src/ngx_http_estreaming_module.c:13:0:
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:15:38: fatal error: libswresample/swresample.h: No such file or directory
#include <libswresample/swresample.h>
^
compilation terminated.
objs/Makefile:1882: recipe for target 'objs/addon/src/ngx_http_estreaming_module.o' failed
make[1]: *** [objs/addon/src/ngx_http_estreaming_module.o] Error 1
make[1]: Leaving directory '/home/souvik/nginx-1.9.5'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2
I hope so this is what you need. Let me know if you need anything else.
Seemed an ffmpeg issue, I had removed re-cloned sources and re-built ffmpeg as instructed in ffmpeg-page https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu . But, the issue still persists. any suggestions/help?
By the way, following is the output of $ ffmpeg -version
ffmpeg version N-76286-g15d8b65 Copyright (c) 2000-2015 the FFmpeg developers built with gcc 4.9.2 (Ubuntu 4.9.2-10ubuntu13) configuration: --prefix=/home/souvik/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/souvik/ffmpeg_build/include --extra-ldflags=-L/home/souvik/ffmpeg_build/lib --bindir=/home/souvik/bin --enable-gpl --enable-libfdk-aac --enable-libmp3lame --enable-libvpx --enable-libx264 --enable-nonfree
Can you test against newest commit?
Tried on latest code. Encountered error at another place.
In file included from ../ngx_http_estreaming_module/src/ngx_http_estreaming_module.c:13:0:
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:15:32: fatal error: libavcodec/avcodec.h: No such file or directory
#include <libavcodec/avcodec.h>
^
compilation terminated.
objs/Makefile:1882: recipe for target 'objs/addon/src/ngx_http_estreaming_module.o' failed
make[1]: *** [objs/addon/src/ngx_http_estreaming_module.o] Error 1
make[1]: Leaving directory '/home/souvik/nginx-1.9.5'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2
Are you sure the code knows where to pick the include files for ffmpeg from, or, do we have to pass that as a parameter?
Are you sure that you followed my guide in read me file? According to error log, you didn't have ffmfeg installed On Thu, 29 Oct 2015 at 19:57, soufrk [email protected] wrote:
Tried on latest code. Encountered error at another place.
In file included from ../ngx_http_estreaming_module/src/ngx_http_estreaming_
module.c:13:0: ../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:15:32: fatal error: libavcodec/avcodec.h: No such file or directory #include <libavcodec/avcodec.h> ^ compilation terminated. objs/Makefile:1882: recipe for target 'objs/addon/src/ngx_http_estreaming_module.o' failed make[1]: *** [objs/addon/src/ngx_http_estreaming_module.o] Error 1 make[1]: Leaving directory '/home/souvik/nginx-1.9.5' Makefile:8: recipe for target 'build' failed make: *** [build] Error 2
Are you sure the code knows where to pick the include files for ffmpeg from, or, do we have to pass that as a parameter?
— Reply to this email directly or view it on GitHub https://github.com/whatvn/ngx_http_estreaming_module/issues/19#issuecomment-152172506 .
Here are both the configurations, Your configuration
./configure
--enable-libx264
--enable-static
--disable-opencl
--extra-ldflags='-L/usr/local/lib -lx264 -lpthread -lm' ---- This line is different
--enable-gpl
--enable-libfdk-aac
--enable-nonfree
My configuration
./configure
--prefix="$HOME/ffmpeg_build"
--pkg-config-flags="--static"
--extra-cflags="-I$HOME/ffmpeg_build/include" -------------- The include dir
--extra-ldflags="-L$HOME/ffmpeg_build/lib" ----------------- The build dir
--bindir="$HOME/bin"
--enable-gpl
--enable-libfdk-aac
--enable-libmp3lame
--enable-libvpx
--enable-libx264
--enable-nonfree
Is this what you suspect might be the culprit? If so, let me know if the following should fix the issue
--extra-ldflags="-L$HOME/usr/local/lib" ----------------- The build dir
Or if I am simply copying the current lib directory contents to /usr/local/lib
, is it going to work?
the errors you got is not related to libraries, but about missing ffmpeg's header files.
Header files I am talking about is this path in your ./configure
command:
--extra-cflags="-I$HOME/ffmpeg_build/include" -------------- The include dir
You build ffmpeg into a customized location, so nginx installation process does not know where to find all of its required header file.
To make it works, could you please change estreaming config
file, to
CORE_LIBS="$CORE_LIBS -I/path/to/where/you/installed/ffmpeg/include -lswresample -lavformat -lavcodec -lavutil -lavcodec -lavfilter -lrt -lswscale -lz -lm -lbz2 -lfdk-aac -lx264"
ngx_addon_name=ngx_http_estreaming_module
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_estreaming_module"
CFLAGS="$CFLAGS -ggdb -D_DEBUG -D_LARGEFILE_SOURCE"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_estreaming_module.c"
Note: change directory after -I flag
As guided, I tried the following
CORE_LIBS="$CORE_LIBS -I/home/souvik/ffmpeg_build/include -lswresample -lavformat -lavcodec
-lavutil -lavcodec -lavfilter -lrt -lswscale -lz -lm -lbz2 -lfdk-aac -lx264"
ngx_addon_name=ngx_http_estreaming_module
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_estreaming_module"
CFLAGS="$CFLAGS -ggdb -D_DEBUG -D_LARGEFILE_SOURCE"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/sr /ngx_http_estreaming_module.c"
And
CORE_LIBS="$CORE_LIBS -I /home/souvik/ffmpeg_build/include -lswresample -lavformat
-lavcodec -lavutil -lavcodec -lavfilter -lrt -lswscale -lz -lm -lbz2 -lfdk-aac -lx264"
ngx_addon_name=ngx_http_estreaming_module
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_estreaming_module"
CFLAGS="$CFLAGS -ggdb -D_DEBUG -D_LARGEFILE_SOURCE"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_estreaming_module.c"
The difference is a space after -I. But, unfortunately, this produces the same error. Anyways, for the time being, I will remove and re-compile ffmpeg as mentioned in your way.
Tried your way of installing ffmpeg on Ubuntu 15.04. Configure results in error,
ERROR: libx264 not found
Any suggestions ? Tried all suggestions available for the same, but still not working.
Finally managed to resolve dependencies for ffmpeg correctly, by installing them from Ubuntu packages individually from, http://packages.ubuntu.com/search?keywords=ffmpeg
But, stuck at different problem now, executing make after config results in the following error
objs/ngx_modules.o \
-lpthread -lcrypt -I/home/souvik/ffmpeg_build/include -lswresample -lavformat -lavcodec -lavutil -lavcodec -lavfilter -lrt -lswscale -lz -lm -lbz2 -lfdk-aac -lx264 -lpcre -lssl -lcrypto -ldl -lz
/usr/bin/ld: cannot find -lbz2
collect2: error: ld returned 1 exit status
objs/Makefile:224: recipe for target 'objs/nginx' failed
make[1]: *** [objs/nginx] Error 1
make[1]: Leaving directory '/home/souvik/nginx-1.9.5'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2
souvik@PFTBLR-DEV-6:~/nginx-1.9.5$
NOTE: I have already installed bzip2 lbzip2, but still not working.
I have tried the same in CentOS 7 and I have downloaded fdk-aac source from different git location https://github.com/Distrotech/fdk-aac because the fdk-aac which you have shared does not have a configure file . With alternate download link it seems to be building . Please find the logs
adding module in ../ngx_http_estreaming_module
- ngx_http_estreaming_module was configured
While starting nginx getting the following error in /etc/nginx/nginx.conf:30 nginx: [emerg] unknown directive "streaming" in /etc/nginx/nginx.conf:68
Could you please help in this?
it would be great to get rid of external dependencies in the assembly of the module, that would be all that was necessary in the framework of your source module
Can you please tell in which context you are talking about and about which dependencies?
I talk globally about ngx_http_estreaming_module , message for Whatvn
well, this will be a very long answer :) When writing this module, I pretended to write it to use myself. Then I found that HLS adaptive bitrate is useful for many people, company, so I open source it. This module was written with system developer mind so I thought that people who find it useful should know how to compile software from source, how to solve problem with gcc, headers missing file, missing libraries and things. I never found any difficult problem when compiling nginx with this module so far, but it seems many people encounter problem with ffmpeg libaries.
@arty777 , without ffmpeg, the core function of estreaming module wont work. Your special environment does not use auto adaptive bitrate but I write this module to do that, so ffmpeg installed is a must. @rachit20 : can you post your nginx configuration.
If anyone need a step by step installing this module on your system, I will be happy to install a new fresh linux and re-make a document on how to install estreaming module from scratch.
I used this command to build nginx from source
./configure --add-module=../ngx_http_estreaming_module --add-module=../nginx-vod-module --add-module=../nginx-rtmp-module --add-module=../nginx-clojure/src/c --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log --with-http_gzip_static_module --with-http_stub_status_module --with-http_ssl_module --with-pcre --with-file-aio --with-http_realip_module --without-http_scgi_module --without-http_uwsgi_module --without-http_fastcgi_module
and in nginx.conf I have put
rewrite ^(.)/(adbr)/([0-9]+p)/([0-9]+)/(.ts)?(.) $1/$5?video=$4&$2=true&vr=$3&$6 last; rewrite ^(.)/(adbr)/([0-9]+p)/(..m3u8)?(.) $1/$4?$2=true&vr=$3&$5 last; rewrite ^(.)/(org)/(..m3u8)?(.) $1/$3?$2=true&$6 last; rewrite ^(.)/(org)/([0-9]+)/(..ts)?(.) $1/$4?video=$3&$2=true&$5 last; rewrite ^(._)/([0-9]+)/(._ts)?(.*) $1/$3?video=$2&$4 last; location /upload { streaming; root /usr/share/nginx/html; segment_length 5; hls_buffer_size 1m; hls_max_buffer_size 50m; mp4_buffer_size 1m; mp4_max_buffer_size 500m; }
But getting error while starting nginx as "unknown directive streaming"
what's output of nginx -V ?
Finally managed to get the module compiled successfully. NGINX startup is normat without error, but getting HTTP 404. Below is the config,
user www-data;
worker_processes 2;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
# HTTP can be used for accessing RTMP stats
http {
access_log /var/log/nginx/access-streaming.log;
error_log /var/log/nginx/error-streaming.log;
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
# in case we have another web server on port 80
listen 80;
# Pre-created chunks serving
location /segmented{
root /var;
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
}
location /crossdomain.xml{
root /var/www;
}
#uncomment to use secure_link module
#secure_link $arg_st,$arg_e;
#secure_link_md5 "axcDxSVnsGkAKvqhqOh$host$arg_e";
# if ($secure_link = "") { return 403; }
# if ($secure_link = "0") { return 410; }
rewrite ^(.*)/(adbr)/([0-9]+p)/([0-9]+)/(.*ts)?(.*) $1/$5?video=$4&$2=true&vr=$3&$6 last;
rewrite ^(.*)/(adbr)/([0-9]+p)/(.*\.m3u8)?(.*) $1/$4?$2=true&vr=$3&$5 last;
rewrite ^(.*)/(org)/(.*\.m3u8)?(.*) $1/$3?$2=true&$6 last;
rewrite ^(.*)/(org)/([0-9]+)/(.*\.ts)?(.*) $1/$4?video=$3&$2=true&$5 last;
rewrite ^(.*)/([0-9]+)/(.*ts)?(.*) $1/$3?video=$2&$4 last;
location /upload {
streaming;
error_log /var/log/nginx/error-estreaming.log ;
root /var/demo;
segment_length 5;
hls_buffer_size 1m;
hls_max_buffer_size 50m;
mp4_buffer_size 1m;
mp4_max_buffer_size 500m;
}
}
}
Given: /var/demo/test.mp4 Request : http://localhost/upload/test.m3u8 Output: HTTP 404 Any suggestions from your end ?
I have built ffmpeg from source but it does not have install directory which I need to configure in estreaming module config file .
Your configuration is /upload, so inside /var/demo should have upload/test.mp4 in order to make it works.
On Tue, 3 Nov 2015 at 17:56, soufrk [email protected] wrote:
Finally managed to get the module compiled successfully. NGINX startup is normat without error, but getting HTTP 404. Below is the config,
user www-data; worker_processes 2; pid /run/nginx.pid;
events { worker_connections 768; # multi_accept on; }
HTTP can be used for accessing RTMP stats
http { access_log /var/log/nginx/access-streaming.log; error_log /var/log/nginx/error-streaming.log; include /etc/nginx/mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65;
server { # in case we have another web server on port 80 listen 80; # Pre-created chunks serving location /segmented{ root /var; types { application/vnd.apple.mpegurl m3u8; video/mp2t ts; } } location /crossdomain.xml{ root /var/www; } #uncomment to use secure_link module #secure_link $arg_st,$arg_e; #secure_link_md5 "axcDxSVnsGkAKvqhqOh$host$arg_e"; # if ($secure_link = "") { return 403; } # if ($secure_link = "0") { return 410; } rewrite ^(.*)/(adbr)/([0-9]+p)/([0-9]+)/(.*ts)?(.*) $1/$5?video=$4&$2=true&vr=$3&$6 last; rewrite ^(.*)/(adbr)/([0-9]+p)/(.*\.m3u8)?(.*) $1/$4?$2=true&vr=$3&$5 last; rewrite ^(.*)/(org)/(.*\.m3u8)?(.*) $1/$3?$2=true&$6 last; rewrite ^(.*)/(org)/([0-9]+)/(.*\.ts)?(.*) $1/$4?video=$3&$2=true&$5 last; rewrite ^(.*)/([0-9]+)/(.*ts)?(.*) $1/$3?video=$2&$4 last; location /upload { streaming; error_log /var/log/nginx/error-estreaming.log ; root /var/demo; segment_length 5; hls_buffer_size 1m; hls_max_buffer_size 50m; mp4_buffer_size 1m; mp4_max_buffer_size 500m; } }
}
Given: /var/demo/test.mp4 Request : http://localhost/upload/test.m3u8 Output: HTTP 404 Any suggestions from your end ?
— Reply to this email directly or view it on GitHub https://github.com/whatvn/ngx_http_estreaming_module/issues/19#issuecomment-153314357 .
Oops, my bad. It was a silly mistake. By the upon correcting it module seems to be working. But browser is not able to load the content. Here is a trace on Google Chrome
DEBUG:OSMF HLSPlugin init
INFO:HLSNetStream:close
DEBUG:cancel any manifest load in progress
DEBUG:adaptive playlist:
#EXTM3U
#EXT-X-ALLOW-CACHE:NO
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1560000,RESOLUTION=640x360,CODECS="mp4a.40.2, avc1.4d4015"
adbr/360p/test.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=3120000,RESOLUTION=854x480,CODECS="mp4a.40.2, avc1.4d4015"
adbr/480p/test.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=5120000,RESOLUTION=1280x720,CODECS="mp4a.40.2, avc1.4d4015"
adbr/720p/test.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=7680000,RESOLUTION=1920x1080,CODECS="mp4a.40.2, avc1.4d4015"
org/test.m3u8
DEBUG:level 0 playlist:
#EXTM3U
#EXT-X-TARGETDURATION:8
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-VERSION:4
#EXTINF:5.965,
0/test.ts
#EXTINF:5.798,
6/test.ts
#EXTINF:5.381,
12/test.ts
#EXTINF:5.214,
18/test.ts
#EXTINF:5.297,
29/test.ts
#EXTINF:5.006,
37/test.ts
#EXTINF:5.381,
42/test.ts
#EXTINF:5.673,
54/test.ts
#EXTINF:5.131,
65/test.ts
#EXTINF:5.631,
72/test.ts
#EXTINF:5.464,
78/test.ts
#EXTINF:5.006,
86/test.ts
#EXTINF:5.006,
91/test.ts
#EXTINF:5.047,
96/test.ts
#EXTINF:5.548,
106/test.ts
#EXTINF:5.464,
113/test.ts
#EXTINF:5.881,
123/test.ts
#EXTINF:5.006,
132/test.ts
#EXTINF:5.381,
137/test.ts
#EXTINF:5.756,
143/test.ts
#EXTINF:5.131,
151/test.ts
#EXTINF:5.631,
158/test.ts
#EXTINF:4.380,
164/test.ts
#EXT-X-ENDLIST
DEBUG:updateFragments: unknown PTS info for this level
DEBUG:first level filled with at least 1 fragment, notify event
DEBUG:_switchup[0]=1
DEBUG:_switchup[1]=1
DEBUG:_switchup[2]=1
DEBUG:_switchdown[1]=0.6666666666666666
DEBUG:_switchdown[2]=0.6666666666666666
DEBUG:_switchdown[3]=0.6666666666666666
DEBUG:HLSNetStreamLoadTrait()
DEBUG:HLSMediaElement:processReadyState
DEBUG:HLSBufferTrait()
DEBUG:HLSTimeTrait()
DEBUG:HLSDisplayObjectTrait()
DEBUG:HLSPlayTrait()
DEBUG:HLSSeekTrait()
DEBUG:HLSDynamicStreamTrait()
DEBUG:HLSDynamicStreamTrait:autoSwitchChangeStart:false
DEBUG:HLSDynamicStreamTrait:getBitrateForIndex(0)=1560
DEBUG:HLSDynamicStreamTrait:getBitrateForIndex(1)=3120
DEBUG:HLSDynamicStreamTrait:getBitrateForIndex(2)=5120
DEBUG:HLSDynamicStreamTrait:getBitrateForIndex(3)=7680
DEBUG:HLSAlternativeAudioTrait()
DEBUG:HLSAlternativeAudioTrait:numAlternativeAudioStreams:0
INFO:HLSSeekTrait:seekingChangeStart(newSeeking/time):(true/0)
INFO:HLSNetStream:seek(0)
DEBUG:[SEEK_STATE] from IDLE to SEEKING
INFO:HLSPlayTrait:playStateChangeStart:paused
INFO:HLSNetStream:pause
INFO:HLSPlayTrait:playStateChangeStart:playing
INFO:HLSNetStream:play(0)
INFO:HLSNetStream:seek(0)
DEBUG:[PLAYBACK_STATE] from IDLE to PLAYING_BUFFERING
DEBUG:HLSBufferTrait:_stateChangedHandler:setBuffering(true)
DEBUG:HLSDynamicStreamTrait:autoSwitchChangeStart:true
DEBUG:HLSDynamicStreamTrait:_qualitySwitchHandler:0
DEBUG:HLSDynamicStreamTrait:switchingChangeStart(newSwitching/index):false/0
DEBUG:HLSDynamicStreamTrait:getBitrateForIndex(0)=1560
DEBUG:loadfirstfragment(0)
DEBUG:loadfirstfragment : requested position:0,seek position:0
DEBUG:Loading 0 of [0,22],level 0
DEBUG:loading fragment:http://10.1.178.177/demo/adbr/360p/0/test.ts
DEBUG:probe fragment type
DEBUG:AAC/MP3/TS match:false/false/true
DEBUG:TS match + H264 signaled in Manifest, use TS demuxer
DEBUG:loading completed
DEBUG:Loading duration/RTT/length/speed:49/32/421308/67173 kb/s
DEBUG:TS: PAT found.PMT PID:4096
DEBUG:TS: PMT found
DEBUG:TS: Selected video PID: 100
DEBUG:TS: Found 1 audio tracks
DEBUG:HLSDynamicStreamTrait:_audioTrackListChangedHandler
DEBUG:HLSDynamicStreamTrait:_audioTrackChangedHandler
INFO:Setting audio track to 0
DEBUG:TS: selected AAC PID: 101
DEBUG:AVC: width/height:1920/816
DEBUG:AVC: H264 High level 41
DEBUG:AAC: LC, 48000 Hz 2 channel(s)
DEBUG:TS/AAC: insert ADIF TAG
DEBUG:TS: flushing demux
DEBUG:TS: parsing complete
DEBUG:m/M audio PTS:1000/6952
DEBUG:m/M video PTS:1042/6964
DEBUG:Delta audio/video m/M PTS:42/12
DEBUG:Total Process duration/length/bw:97/421308/33933 kb/s
INFO:enough download bandwidth, adjust start level from 0 to 3
DEBUG:switch to level 3
DEBUG:(re)load Playlist
DEBUG:HLSDynamicStreamTrait:_qualitySwitchHandler:3
DEBUG:HLSDynamicStreamTrait:switchingChangeStart(newSwitching/index):false/3
DEBUG:HLSDynamicStreamTrait:getBitrateForIndex(3)=7680
DEBUG:_checkLoading : playlist not received for level:3
DEBUG:level 3 playlist:
#EXTM3U
#EXT-X-TARGETDURATION:8
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-VERSION:4
#EXTINF:5.965,
0/test.ts
#EXTINF:5.798,
6/test.ts
#EXTINF:5.381,
12/test.ts
#EXTINF:5.214,
18/test.ts
#EXTINF:5.297,
29/test.ts
#EXTINF:5.006,
37/test.ts
#EXTINF:5.381,
42/test.ts
#EXTINF:5.673,
54/test.ts
#EXTINF:5.131,
65/test.ts
#EXTINF:5.631,
72/test.ts
#EXTINF:5.464,
78/test.ts
#EXTINF:5.006,
86/test.ts
#EXTINF:5.006,
91/test.ts
#EXTINF:5.047,
96/test.ts
#EXTINF:5.548,
106/test.ts
#EXTINF:5.464,
113/test.ts
#EXTINF:5.881,
123/test.ts
#EXTINF:5.006,
132/test.ts
#EXTINF:5.381,
137/test.ts
#EXTINF:5.756,
143/test.ts
#EXTINF:5.131,
151/test.ts
#EXTINF:5.631,
158/test.ts
#EXTINF:4.380,
164/test.ts
#EXT-X-ENDLIST
DEBUG:updateFragments: unknown PTS info for this level
DEBUG:loadfirstfragment(0)
DEBUG:loadfirstfragment : requested position:0,seek position:0
DEBUG:Loading 0 of [0,22],level 3
DEBUG:loading fragment:http://10.1.178.177/demo/org/0/test.ts
Failed to load resource: the server responded with a status of 403 (Forbidden)
ERROR:I/O Error while loading fragment:HTTP status:403,msg:Error #2032
WARN:retry fragment load in 1000 ms, count=0
DEBUG:loading fragment:http://10.1.178.177/demo/org/0/test.ts
Failed to load resource: the server responded with a status of 403 (Forbidden)
ERROR:I/O Error while loading fragment:HTTP status:403,msg:Error #2032
WARN:retry fragment load in 2000 ms, count=1
DEBUG:loading fragment:http://10.1.178.177/demo/org/0/test.ts
Failed to load resource: the server responded with a status of 403 (Forbidden)
ERROR:I/O Error while loading fragment:HTTP status:403,msg:Error #2032
WARN:retry fragment load in 4000 ms, count=2
DEBUG:loading fragment:http://10.1.178.177/demo/org/0/test.ts
Failed to load resource: the server responded with a status of 403 (Forbidden)
ERROR:I/O Error while loading fragment:HTTP status:403,msg:Error #2032
WARN:retry fragment load in 8000 ms, count=3
DEBUG:loading fragment:http://10.1.178.177/demo/org/0/test.ts
GET http://10.1.178.177/demo/org/0/test.ts 403 (Forbidden)
ERROR:I/O Error while loading fragment:HTTP status:403,msg:Error #2032
WARN:retry fragment load in 16000 ms, count=4
DEBUG:loading fragment:http://10.1.178.177/demo/org/0/test.ts
GET http://10.1.178.177/demo/org/0/test.ts 403 (Forbidden)
ERROR:I/O Error while loading fragment:HTTP status:403,msg:Error #2032
WARN:retry fragment load in 32000 ms, count=5
DEBUG:loading fragment:http://10.1.178.177/demo/org/0/test.ts
GET http://10.1.178.177/demo/org/0/test.ts 403 (Forbidden)
ERROR:I/O Error while loading fragment:HTTP status:403,msg:Error #2032
WARN:retry fragment load in 64000 ms, count=6
DEBUG:loading fragment:http://10.1.178.177/demo/org/0/test.ts
GET http://10.1.178.177/demo/org/0/test.ts 403 (Forbidden)
ERROR:I/O Error while loading fragment:HTTP status:403,msg:Error #2032
WARN:retry fragment load in 64000 ms, count=7
As you can the browser fails to load the segment. There is no error printed by the module either. Any clue ??
hmm, you modified your nginx configuration. Please show your new config?
Only difference is this part mentioned below, rest of it remains same as before
location /demo {
streaming;
root /var
well, without any error log or at least a publish link to your media, I cannot help
I have compiled ffmpeg like this PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --pkg-config-flags="--static" --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265
$HOME is /root and estreaming config file has
CORE_LIBS="$CORE_LIBS -I /root/ffmpeg_build/include -lswresample -lavformat -lavcodec -lavutil -lavcodec -lavfilter -lrt -lswscale -lz -lm -lbz2 -lfdk-aac -lx264" ngx_addon_name=ngx_http_estreaming_module HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_estreaming_module" CFLAGS="$CFLAGS -ggdb -D_DEBUG -D_LARGEFILE_SOURCE" NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_estreaming_module.c"
but still getting following error while compiling source libavutil/old_pix_fmts.h: No such file or directory #include <libavutil/old_pix_fmts.h>
soufrk
try to swap some line and re-test it again.
rewrite ^(.*)/(adbr)/([0-9]+p)/([0-9]+)/(.*ts)?(.*) $1/$5?video=$4&$2=true&vr=$3&$6 last;
rewrite ^(.*)/(adbr)/([0-9]+p)/(.*\.m3u8)?(.*) $1/$4?$2=true&vr=$3&$5 last;
rewrite ^(.*)/(org)/([0-9]+)/(.*\.ts)?(.*) $1/$4?video=$3&$2=true&$5 last; <-- swap this line
rewrite ^(.*)/(org)/(.*\.m3u8)?(.*) $1/$3?$2=true&$4 last; <-- swap this line
rewrite ^(.*)/([0-9]+)/(.*ts)?(.*) $1/$3?video=$2&$4 last;
Thanks @samart45 . Okay, so the good news is that the module is running successfully for me. The bad news is I don't see the "Adaptive"ness in the output media. Of course the index manifest(M3U8) is changing with bandwidth. But, there is no reflection of that on video playback quality, bitrate etc. The lowest quality is as crisp as the highest quality.
@soufrk
- can you publish that media link?
- Can you post output of each media file in master playlist?
- Can you download 1 ts file of different resolution and compare its size and resolution?
@whatvn
- Here is the link http://www.dvdloc8.com/clip.php?movieid=13599&clipid=4
- Yes, done that as well. In all cases the chunked file sizes remained same.
- Given below,
#EXTM3U
#EXT-X-ALLOW-CACHE:NO
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1560000,RESOLUTION=640x360,CODECS="mp4a.40.2, avc1.4d4015"
adbr/360p/test.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=3120000,RESOLUTION=854x480,CODECS="mp4a.40.2, avc1.4d4015"
adbr/480p/test.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=5120000,RESOLUTION=1280x720,CODECS="mp4a.40.2, avc1.4d4015"
adbr/720p/test.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=7680000,RESOLUTION=1920x1080,CODECS="mp4a.40.2, avc1.4d4015"
org/test.m3u8