arut / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
13.23k stars 3.49k forks source link

Force HLS variant playlist #1064

Open alphacentauri82 opened 7 years ago

alphacentauri82 commented 7 years ago

So i am trying to limit consumption of MAX 256 per client. I have set the parameters accordingly:

`

    exec ffmpeg -i rtsp//myencoder/name 
    -c:a libfdk_aac -b:a 16k -c:v libx264 -b:v 64K -f flv rtmp://myip/live/name_low
    -c:a libfdk_aac -b:a 32k -c:v libx264 -b:v 128k -f flv rtmp://myip/live/name_mid
    -c:a libfdk_aac -b:a 64k -c:v libx264 -b:v 256K -f flv rtmp://myip/live/name__hi;

        # Turn on HLS
        hls on;
        hls_path /tmp/hls/;
        hls_fragment 3;
        hls_playlist_length 10;

        hls_variant _low BANDWIDTH=80000;
        hls_variant _mid BANDWIDTH=160000;
        hls_variant _hi BANDWIDTH=320000;

   `

But i get on the client 1.5 mbps output :( i need to reduce bandwith output of each stream to a top of 256 max... and these parameters clearly don't work.

arut commented 7 years ago

Do HLS fragments fill up to 1.5 mbps? Just look at fragment files at check the sizes.

alphacentauri82 commented 7 years ago

The adaptative stream doesn't work. I checked even if the encoder connection sends properly and what i get on the client side is a linear consumption with peaks up to 2-3mb. I saw that the fragment sizes can vary from 200k to 3mb. I don't know what parameter i have to change to 1. get the m3u8 to be 100% adaptative and also reduce the fragment sizes