Low Latency DASH Nginx RTMP

I use arut nginx-rtmp-module ( https://github.com/arut/nginx-rtmp-module ) on the media server, then I tried to stream using FFmpeg to dash, then I test the stream by playing it using VLC .

And it waits about 30 seconds to start playing, and it plays from the very beginning, and not with the current timestamp.

This is my current configuration in the RTMP block.

rtmp {
    server {
        listen 1935;

        application live {
            live on;

           exec ffmpeg -re -i rtmp://localhost:1935/live/$name
              -c:a libfdk_aac -b:a 32k  -c:v libx264 -b:v 128K -f flv rtmp://localhost:1935/hls/$name_low
              -c:a libfdk_aac -b:a 64k  -c:v libx264 -b:v 256k -f flv rtmp://localhost:1935/hls/$name_mid
              -c:a libfdk_aac -b:a 128k -c:v libx264 -b:v 512K -f flv rtmp://localhost:1935/hls/$name_hi
              -c:a libfdk_aac -b:a 128k -c:v libx264 -b:v 512K -f flv rtmp://localhost:1935/dash/$name_dash;
        }

        application hls {
             live on;

             hls on;
             hls_path /tmp/hls;
             hls_nested on;

             hls_variant _low BANDWIDTH=160000;
             hls_variant _mid BANDWIDTH=320000;
             hls_variant _hi  BANDWIDTH=640000;
        }

        application dash {
            live on;

            dash on;
            dash_path /tmp/dash;
            dash_nested on;
        }
    }
}

This is the command I use for streaming

ffmpeg -re -i 2014\ SPRING.mp4 -c copy -f flv 
rtmp://52.221.221.163:1935/dash/spring

How to reduce the delay and make it play with the same timestamp as the streamer?

Can I achieve a delay of 5 s?

UPDATE

I tried changing the length of the playlist and the length of the fragment using this directive

dash_playlist_length 10s;
dash_fragment 2s;

But still, the problem is with the delay, sometimes it is less than before, sometimes it is the same

+1
3

5 ?

. DASH - , , . , . , . , , , . , .

, ?

. ! , , . / , , . , , ... , - .

, , , , WebRTC. , . , ... . WebRTC UDP (, ) , , . , , , , . WebRTC TCP .

, . . . . , .

+3

VLC. , ffplayer .

ffplay -fflags nobuffer rtmp://192.168.1.66/myapp/live

,

  • VLC: 6 ~ 7s
  • ffplay: 500

. narlex , github

+2

GOP ffmpeg. GOP ffmpeg 250, , 250 . 25 , 10 ( , ).

HLS DASH . , 10 . ( GOP), .

ffmpeg , ,

exec ffmpeg -re -i rtmp://localhost:1935/live/$name
          -c:a libfdk_aac -b:a 32k  -c:v libx264 -g 50 -b:v 128K -f flv rtmp://localhost:1935/hls/$name_low
          -c:a libfdk_aac -b:a 64k  -c:v libx264 -g 50 -b:v 256k -f flv rtmp://localhost:1935/hls/$name_mid
          -c:a libfdk_aac -b:a 128k -c:v libx264 -g 50 -b:v 512K -f flv rtmp://localhost:1935/hls/$name_hi
          -c:a libfdk_aac -b:a 128k -c:v libx264 -g 50 -b:v 512K -f flv rtmp://localhost:1935/dash/$name_dash;
+1

Source: https://habr.com/ru/post/1676710/


All Articles