arut / nginx-rtmp-module

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

Large Latency on DASH streaming #1019

Open kenanchristian opened 7 years ago

kenanchristian commented 7 years ago

I tried to stream using FFmpeg to the dash application, then I tried to play it using VLC. And it waits around 30secs to start playing, and it plays from the beginning, not the current timestamp.

This is my current config on 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 can I reduce the delay, and make it play from the same timestamp as the streamer? Can I achieve under 5s latency?

saltpetre commented 7 years ago

Having the same exact issue of the stream starting from the begining but the delay to start the stream is much much longer for me kn minutes. please share if you find the solution. Will do the same thanks

kenanchristian commented 7 years ago

@saltpetreca I'm currently changing the playlist length and fragment length. It helps but still have maybe around 10sec latency

saltpetre commented 7 years ago

Thanks did you fix the issue with the stream starting from the beginning instead of the timestamp.

Regardless of what I try the stream starts from beginning.

On May 10, 2017, at 3:51 AM, Kenan Christian notifications@github.com wrote:

@saltpetreca I'm currently changing the playlist length and fragment length. It helps but still have maybe around 10sec latency

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.