Edward-Wu / srt-live-server

srt live server for low latency
Other
644 stars 192 forks source link

Latency #98

Open Vrashq opened 3 years ago

Vrashq commented 3 years ago

Hi,

Good job with this server. It is very usefull for my usage.

I've a question : I see there is a difference close to 2 seconds between the input and the output. I have set the latency parameter to 20ms.

Is it possible to reduce this ?

Here is my config file :

`srt { #SRT worker_threads 1; worker_connections 300 ;

log_file logs/error.log ; 
log_level info;

#stat_post_url http://192.168.31.106:8001/sls/stat;
#stat_post_interval  5;#s

record_hls_path_prefix /tmp/mov/sls; 
#vod  file name: /tmp/mov/sls/$listen/$domain_publisher/$app_publisher/$stream_name/vod.m3u8

server {
    listen 8080; 
    latency 20; #ms

    domain_player live.sls.com live-1.sls.com;
    domain_publisher uplive.sls.com;
    backlog 100; #accept connections at the same time
    idle_streams_timeout 10;#s -1: unlimited
    #on_event_url http://192.168.31.106:8000/sls/on_event; #?method=on_connect|on_close&role_name=&srt_url=%s
    app {
        app_player live ;           
        app_publisher live ; 

        record_hls off;#on, off 
        record_hls_segment_duration 10; #unit s

        #relay {
        #    type pull;
        #    mode loop;#loop; hash;
        #    reconnect_interval 10;
        #    idle_streams_timeout -1;#s -1: unlimited
        #    upstreams 127.0.0.1:9090?streamid=live.sls.com/live 192.168.1.100:8080/?streamid=live.test.com/live;
        #}
        #relay {
        #    type push;
        #    mode all; #all; hash
        #    reconnect_interval 10;
        #    idle_streams_timeout 10;#s -1: unlimited
        #    upstreams 192.168.31.106:8080?streamid=uplive.sls.com/live ;
        #}          
    }
}

Do you have any idea or is it normal ?

gitpierpy commented 3 years ago

Hi, for me latency is on my side. I have 1,5 seconds of buffering, I'm sending stream with OBS