chenxiaoqino / getusermedia-to-rtmp

186 stars 61 forks source link

latency is about 6-12 seconds, why? #14

Open Archer-Thane opened 4 years ago

Archer-Thane commented 4 years ago

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 commented 4 years ago

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',

rayj00 commented 4 years ago

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?

chenxiaoqino commented 4 years ago

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