getusermedia-to-rtmp icon indicating copy to clipboard operation
getusermedia-to-rtmp copied to clipboard

latency is about 6-12 seconds, why?

Open Archer-Thane opened this issue 4 years ago • 3 comments

Hey there, awesome project! I used this project and a project named node-media-server to stream from webcam (inside browser) to a server via sockets and get it back from server to browser. getUserMedia-to-rtmp helped a LOT. but there is a problem which I want to solve. There is a huge latency, about 6-12 seconds. when I reconfigure ffmpeg using flags, I see almost no changes. I don't know where the problem is and how to solve it. in my application, latency is by far more important than quality of video. Can anyone guide me to the correct path?

Archer-Thane avatar Mar 15 '20 04:03 Archer-Thane

these are flags which I used ( I strongly think that this is not about ffmpeg, something else is need to change): '-strict', 'experimental', '-framerate', '10', '-fflags', 'nobuffer', '-rtsp_transport', 'udp', '-probesize', '32', '-analyzeduration', '0', '-b:v', '100k',

Archer-Thane avatar Mar 15 '20 04:03 Archer-Thane

I would also like to see the answer as I am looking for a solution for getUserMedia to HLS !! I think ffmpeg can handle this, but latency is an issue apparently?

rayj00 avatar Mar 15 '20 13:03 rayj00

Hi, you may want to try tune the ffmpeg parameters to add zerolatency options. https://trac.ffmpeg.org/wiki/StreamingGuide#Latency

chenxiaoqino avatar Mar 15 '20 21:03 chenxiaoqino