WWBN / AVideo

Create Your Own Broadcast Network With AVideo Platform Open-Source. OAVP OVP
https://avideo.tube/AVideo_OpenSource
Other
1.91k stars 973 forks source link

Not sure if adaptive streaming works well #7586

Open h3ll3 opened 1 year ago

h3ll3 commented 1 year ago

Describe the question Hi,

i tried to enable adaptive streaming on my AVideo site as i want to broadcast my streams to a large amount of users and i got enough CPU and RAM for this, i guess.

This is my nginx.conf code for ffmpeg

exec ffmpeg -i rtmp://localhost/live/$name

-c:a aac -strict -2 -b:a 128k -c:v libx264 -vf scale=-2:240 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 400k -maxrate 700k -bufsize 1200k -b:a 96k -
f flv rtmp://localhost/adaptive/$name_low

-c:a aac -strict -2 -b:a 128k -c:v libx264 -vf scale=-2:480 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 1200k -maxrate 2100k -bufsize 2400k -b:a 128
k -f flv rtmp://localhost/adaptive/$name_mid

-c:a aac -strict -2 -b:a 128k -c:v libx264 -vf scale=-2:720 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 2400k -maxrate 4200k -bufsize 100000k -b:a 1
28k -f flv rtmp://localhost/adaptive/$name_hi;

and this is the part for adaptive mode

                    application adaptive {
                        live on;
                        hls on;                                                      
                        hls_path /HLS/live;                     
                        hls_nested on;                          
                        hls_playlist_length 30s;                
                        hls_cleanup on;                         
                        hls_continuous off;                     
                        hls_fragment 4s;                        
                        hls_sync 100ms;                         
                        hls_fragment_naming system;             
                        hls_fragment_slicing plain;                                                
                        allow play all;
                        allow publish 127.0.0.1;
                        hls_variant _low BANDWIDTH=900000,RESOLUTION=426x240;
                        hls_variant _mid BANDWIDTH=2400000,RESOLUTION=852x480;
                        hls_variant _hi BANDWIDTH=3500000,RESOLUTION=1280x720;

When i start my live stream, RTMP shows 4 streams as you can see on the screenshot. Is that correct behaviour or should there be only 3 of them below the adaptive section? The reason i am wondering if it works well is, that there is never any outgoing traffic at one of the adaptive streams. How can i prove that adaptive streaming is working?

edit: i enabled adative mode in live plugin and live server settings.

Screenshots image

Even after more than one hour of streaming in fullhd there is not one single byte sent out trough one of the adaptive streams.

image

Thanks to everyone for answering!

Best regards

h3ll3 commented 1 year ago

Can no one tell me, if there is everything working well of if i will have to edit something? :(

DanielnetoDotCom commented 1 year ago

your configuration seems to be correct.

what is the error?

h3ll3 commented 1 year ago

Hi Daniel,

thank you for replying.

The only reason i was wondering if everything is configured correct was that i could never see any traffic on one of the encoded adaptive streams. i tried to watch the stream with several devices and from different locations with different internet connections (also mobile data) but there was never any traffic but on the original "live" stream.

Obviously i will have to increase the number of viewers for this.

Best regards