Node-Media-Server
Node-Media-Server copied to clipboard
How to reduce the live delay
const config = { rtmp: { port: 1935, chunk_size: 4096, gop_cache: false, ping: 1, ping_timeout: 1 }, http: { port: 8000, allow_origin: '*' }, auth: { play: false, publish: false, secret: 'nodemedia2017privatekey' } };
Is there a document for the configure?
First make sure that the publish side uses low latency encoding parameters. E.g : x264 enable "-tune zerolatency"
"gop_cache:false" can reduce the delay. But it is best to turn it on and implement latency reduction logic on the side of player.
How Can I add the -tune zerolatency into the config object? Is it in dashFlags of config.trans?
I also am interested. Can you give more information on low-latency options? I'm using ffmpeg with a live h.264 stream input, transcoding back to h.264 with a lower bandwidth. I'm seeing about 4-6 seconds of latency on LAN. Latency is NOT decreased if I do a straight -c copy vs transcoding.
Hi, I am seeing about 25-30 seconds delay in the live streaming and It increases as the livefeed is kept running for long time. I am using the HLS for live streaming on my web page. Please help
+1
Hi! How we can reduce the live delay of hls(m3u8). I have 25-35seconds of delay.
Hi
Did anyone manage to reduce delay time here?
No, same problem here. I switch to another package now.
Hi! How we can reduce the live delay of hls(m3u8). I have 25-35seconds of delay.
Did you ever find a Solution?
No, same problem here. I switch to another package now.
Which one?
Hi! How we can reduce the live delay of hls(m3u8). I have 25-35seconds of delay.
Did you ever find a Solution?
No, I did not. I have switched to the Nginx RTMP solution. You can play around with the length of the segments, but remember to stay within Apple's recomodations. https://developer.apple.com/documentation/http_live_streaming/hls_authoring_specification_for_apple_devices
Same problem here.. Delay 25 second
Hello! I haven't found the same solution but I did find that reducing the chunk size will decrease latency. At a chunk size of 500 I get around 3.5 seconds of latency, where as the default 60000 will get you around 10 seconds.
chunk_size: 500
Guys. I am not 100% sure but the problem is next: I need 100% accurate low latency live stream for RC vehicles that we are making. Camera stream is cut into segments. In my case this is 8 seconds length segment (You can see this live in m3u8 file). When client joins and needs stream, the newest segment can be sent. But the problem is because in my case, segment length is 8 seconds which means the lowest latency is about 8 seconds. I tried to reduce segment length to 1 using this option: hlsFlags: "[hls_time=1:hls_list_size=1:hls_flags=delete_segments]", But this is not possible for some reason. Node media server ignores it, and use 8 seconds instead. I dug into soruce code and found that ffmpeg works received these arguments from config. This is so far what I got.
When client joins and needs stream, the newest segment can be sent. But the problem is because in my case, segment length is 8 seconds which means the lowest latency is about 8 seconds. I tried to reduce segment length to 1 using this option: hlsFlags: "[hls_time=1:hls_list_size=1:hls_flags=delete_segments]", But this is not possible for some reason. Node media server ignores it, and use 8 seconds instead.
This happens because ffmpeg ignores hls_time if it lower than keyframes interval in video stream. In my case i changed in OBS Studio keyframe interval to 1 sec (default 0 is set it to auto), and my segments duration is 1s now. Found this information here.