Giter Site home page Giter Site logo

Comments (37)

whatvn avatar whatvn commented on August 9, 2024

please show your detail error log.

from ngx_http_estreaming_module.

soufrk avatar soufrk commented on August 9, 2024

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.

from ngx_http_estreaming_module.

soufrk avatar soufrk commented on August 9, 2024

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

from ngx_http_estreaming_module.

whatvn avatar whatvn commented on August 9, 2024

Can you test against newest commit?

from ngx_http_estreaming_module.

soufrk avatar soufrk commented on August 9, 2024

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?

from ngx_http_estreaming_module.

whatvn avatar whatvn commented on August 9, 2024

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
#19 (comment)
.

from ngx_http_estreaming_module.

soufrk avatar soufrk commented on August 9, 2024

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?

from ngx_http_estreaming_module.

whatvn avatar whatvn commented on August 9, 2024

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

from ngx_http_estreaming_module.

soufrk avatar soufrk commented on August 9, 2024

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.

from ngx_http_estreaming_module.

soufrk avatar soufrk commented on August 9, 2024

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.

from ngx_http_estreaming_module.

soufrk avatar soufrk commented on August 9, 2024

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.

from ngx_http_estreaming_module.

rachit20 avatar rachit20 commented on August 9, 2024

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?

from ngx_http_estreaming_module.

arty777 avatar arty777 commented on August 9, 2024

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

from ngx_http_estreaming_module.

rachit20 avatar rachit20 commented on August 9, 2024

Can you please tell in which context you are talking about and about which dependencies?

from ngx_http_estreaming_module.

arty777 avatar arty777 commented on August 9, 2024

I talk globally about ngx_http_estreaming_module , message for Whatvn

from ngx_http_estreaming_module.

whatvn avatar whatvn commented on August 9, 2024

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.

from ngx_http_estreaming_module.

rachit20 avatar rachit20 commented on August 9, 2024

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"

from ngx_http_estreaming_module.

whatvn avatar whatvn commented on August 9, 2024

what's output of nginx -V ?

from ngx_http_estreaming_module.

soufrk avatar soufrk commented on August 9, 2024

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 ?

from ngx_http_estreaming_module.

rachit20 avatar rachit20 commented on August 9, 2024

I have built ffmpeg from source but it does not have install directory which I need to configure in estreaming module config file .

from ngx_http_estreaming_module.

whatvn avatar whatvn commented on August 9, 2024

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
#19 (comment)
.

from ngx_http_estreaming_module.

soufrk avatar soufrk commented on August 9, 2024

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 ??

from ngx_http_estreaming_module.

whatvn avatar whatvn commented on August 9, 2024

hmm, you modified your nginx configuration. Please show your new config?

from ngx_http_estreaming_module.

soufrk avatar soufrk commented on August 9, 2024

Only difference is this part mentioned below, rest of it remains same as before

location /demo {
        streaming;
        root /var

from ngx_http_estreaming_module.

whatvn avatar whatvn commented on August 9, 2024

well, without any error log or at least a publish link to your media, I cannot help

from ngx_http_estreaming_module.

rachit20 avatar rachit20 commented on August 9, 2024

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>

from ngx_http_estreaming_module.

samart45 avatar samart45 commented on August 9, 2024

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;

from ngx_http_estreaming_module.

soufrk avatar soufrk commented on August 9, 2024

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.

from ngx_http_estreaming_module.

whatvn avatar whatvn commented on August 9, 2024

@soufrk

  1. can you publish that media link?
  2. Can you post output of each media file in master playlist?
  3. Can you download 1 ts file of different resolution and compare its size and resolution?

from ngx_http_estreaming_module.

soufrk avatar soufrk commented on August 9, 2024

@whatvn

  1. Here is the link http://www.dvdloc8.com/clip.php?movieid=13599&clipid=4
  2. Yes, done that as well. In all cases the chunked file sizes remained same.
  3. 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

from ngx_http_estreaming_module.

ravismula avatar ravismula commented on August 9, 2024

@soufrk
Can you share how you were able to install successfully?
We were also stuck at the same error!!

from ngx_http_estreaming_module.

soufrk avatar soufrk commented on August 9, 2024

@ravismula Which error are you referring to in specific? As you can see there were so many replies in regard to the conversation, lots of errors. And kindly add your build environment details.

from ngx_http_estreaming_module.

ravismula avatar ravismula commented on August 9, 2024

@soufrk
Here is the error

In file included from ../ngx_http_estreaming_module-1.0.0/src/ngx_http_estreaming_module.c:14:0:
../ngx_http_estreaming_module-1.0.0/src/ngx_http_adaptive_streaming.h:15:38: fatal error: libswresample/swresample.h: No such file or directory
 #include <libswresample/swresample.h>
                                      ^
compilation terminated.
make[1]: *** [objs/addon/src/ngx_http_estreaming_module.o] Error 1
make[1]: Leaving directory `/home/ubuntu/nginx-1.6.3'
make: *** [build] Error 2

from ngx_http_estreaming_module.

soufrk avatar soufrk commented on August 9, 2024

OK, the problem seems to be in this module not being able to discover the ffmpeg libraries. In case if you have compiled ffmpeg manually, try installing 'libswresample' instead, from Ubuntu package directly. Not only that, additionally you need to install other ffmpeg libraries such as 'libavcodec', 'libavresample', etc. I'm not sure which other libraires are exactly required, but I installed all of them. That had solved the compilation in my case.

from ngx_http_estreaming_module.

ravismula avatar ravismula commented on August 9, 2024

We tried installing all the libraries

Got the following error.

        ../ngx_http_estreaming_module/src/ngx_http_estreaming_module.c
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:22:33: fatal error: libavfilter/avcodec.h: No such file or directory
 #include <libavfilter/avcodec.h>
                                 ^

The file is not present /usr/include/libavfilter

I tried to get the file from https://ffmpeg.org/doxygen/1.1/libavfilter_2avcodec_8h_source.html and place it inside /usr/include/libavfilter, then ended up in the following error.

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: In function ‘open_input_file’:
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:156:29: error: ‘AVFormatContext’ has no member named ‘video_codec’
                     ifmt_ctx->video_codec->capabilities |= CODEC_CAP_TRUNCATED;
                             ^
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: In function ‘init_filter’:
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:384:17: error: implicit declaration of function ‘av_get_default_channel_layout’ [-Werror=implicit-function-declaration]
                 av_get_default_channel_layout(dec_ctx->channels);
                 ^
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:451:5: error: implicit declaration of function ‘avfilter_graph_parse_ptr’ [-Werror=implicit-function-declaration]
     if ((ret = avfilter_graph_parse_ptr(filter_graph, filter_spec,
     ^
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h: In function ‘encode_write_frame’:
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:525:5: error: implicit declaration of function ‘av_frame_free’ [-Werror=implicit-function-declaration]
     av_frame_free(&filt_frame);
     ^
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h: In function ‘filter_encode_write_frame’:
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:554:5: error: implicit declaration of function ‘av_buffersrc_add_frame_flags’ [-Werror=implicit-function-declaration]
     ret = av_buffersrc_add_frame_flags(filter_ctx[stream_index].buffersrc_ctx,
     ^
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:562:9: error: implicit declaration of function ‘av_frame_alloc’ [-Werror=implicit-function-declaration]
         filt_frame = av_frame_alloc();
         ^
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:562:20: error: assignment makes pointer from integer without a cast [-Werror]
         filt_frame = av_frame_alloc();
                    ^
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:568:9: error: implicit declaration of function ‘av_buffersink_get_frame’ [-Werror=implicit-function-declaration]
         ret = av_buffersink_get_frame(filter_ctx[stream_index].buffersink_ctx,
         ^
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:580:33: error: ‘AV_PICTURE_TYPE_NONE’ undeclared (first use in this function)
         filt_frame->pict_type = AV_PICTURE_TYPE_NONE;
                                 ^
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:580:33: note: each undeclared identifier is reported only once for each function it appears in
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h: In function ‘flush_decoder’:
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:619:15: error: assignment makes pointer from integer without a cast [-Werror]
         frame = av_frame_alloc();
               ^
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h: In function ‘ngx_estreaming_adaptive_bitrate’:
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:683:23: error: assignment makes pointer from integer without a cast [-Werror]
                 frame = av_frame_alloc();
                       ^
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:688:26: error: assignment from incompatible pointer type [-Werror]
                 dec_func = (type == AVMEDIA_TYPE_VIDEO) ? avcodec_decode_video2 :
                          ^
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:694:21: error: implicit declaration of function ‘av_err2str’ [-Werror=implicit-function-declaration]
                     av_log(NULL, AV_LOG_ERROR, "Error occurred: No: %d, %s\n", ret, av_err2str(ret));
                     ^
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:694:21: error: format ‘%s’ expects argument of type ‘char *’, but argument 5 has type ‘int’ [-Werror=format=]
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:699:21: error: implicit declaration of function ‘av_frame_get_best_effort_timestamp’ [-Werror=implicit-function-declaration]
                     frame->pts = av_frame_get_best_effort_timestamp(frame);
                     ^
../ngx_http_estreaming_module/src/ngx_http_adaptive_streaming.h:725:19: error: assignment makes pointer from integer without a cast [-Werror]
             frame = av_frame_alloc();
                   ^
../ngx_http_estreaming_module/src/ngx_http_estreaming_module.c: In function ‘ngx_estreaming_handler’:
../ngx_http_estreaming_module/src/ngx_http_estreaming_module.c:228:26: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
             if (duration != AV_NOPTS_VALUE) {
                          ^
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/src/ngx_http_estreaming_module.o] Error 1
make[1]: Leaving directory `/home/ubuntu/nginx-1.10.0'
make: *** [build] Error 2

Any suggestions on what to do??

from ngx_http_estreaming_module.

ktrev avatar ktrev commented on August 9, 2024

I am also facing the same issue as @ravismula
avcodec.h file does not exist in libavfilter

from ngx_http_estreaming_module.

soufrk avatar soufrk commented on August 9, 2024

Sorry for the delayed response. Actually, I had done the exercise a long while ago, I forgot lot of things. Can you try installing libavfilter-ffmpeg-dev and libavfilter-ffmpeg-dev and so on instead. And then install libffmpeg-dev for ffmpeg finally. And then try compiling this module maybe.

from ngx_http_estreaming_module.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.