AirenSoft / OvenMediaEngine

OvenMediaEngine (OME) is a Sub-Second Latency Live Streaming Server with Large-Scale and High-Definition. #WebRTC #LLHLS
https://OvenMediaEngine.com/ome
GNU Affero General Public License v3.0
2.53k stars 1.06k forks source link

When live streaming with webrtc, there is intermittent freeze in the client. #191

Closed jys923 closed 3 years ago

jys923 commented 4 years ago

Describe the bug When live streaming with webrtc, there is intermittent freeze in the client. It is being sent to rtmp. just 2 client my pc, my android

To Reproduce Steps to reproduce the behavior:

  1. Set Server.xml as follows '...'
  2. With Encoder '...' [e.g. Use OBS Version]
  3. See error Server.xml.txt I tested ThreadCount:48,8,16 Obs setting is x264 without GPU As posted in the tutorial I only changed the bit rate. Even if the bit rate is reduced to 2500 kbps in webrtc, there are intermittent stiffness.

Expected behavior A clear and concise description of what you expected to happen. I want to stream real-time with Webrtc with a bit rate of 9999kbps, seamlessly with 100 people and less than 1 second latency.

Logs Please upload the entire OvenMediaEngine.log. You may delete important personal information. logs (2).zip

Server (please complete the following information):

Player (please complete the following information):

Player (please complete the following information):

Additional context Add any other context about the problem here. IcmpMsg: InType0: 3 InType3: 3728 InType8: 37982 InType11: 2 OutType0: 37982 OutType3: 6135 Udp: 12868288 packets received 31017 packets to unknown port received 9 packet receive errors 6032585 packets sent 0 receive buffer errors 0 send buffer errors InCsumErrors: 9 IgnoredMulti: 38238 UdpLite: IpExt: InNoRoutes: 13 InMcastPkts: 14061 OutMcastPkts: 8467 InBcastPkts: 38249 OutBcastPkts: 117 InOctets: 434052254553 OutOctets: 677490969031 InMcastOctets: 675473 OutMcastOctets: 496985 InBcastOctets: 12757478 OutBcastOctets: 6574 InNoECTPkts: 339881238 InECT0Pkts: 6331 InCEPkts: 3

getroot commented 4 years ago

Did you use the exact same option as this one? With higher bit rates, threads=8 is one of the very important options. image

Are there any lags in both Bypass and Encoding streams?

WebRTC uses RTP to transfer media. This means packet drops can occur. Enter chrome:://webrtc-internals in the chrome address bar and check if there is any packet loss. If one of the keyframe's packets is dropped, it can of course happen.

jys923 commented 4 years ago

Thanks for the reply image As shown in the picture above, only the bit rate is 9999 and the rest are the same. Oven Media Engine's current setting is only webrtc. I also tested hls and dash encoded in h264, but I get 5 seconds and 10 seconds of latency. The lags were rather worse. There are lags on pc, but mobile is much worse.

I checked it at chrome://webrtc-internals/. I don't see any particular problem.

A 10g kt net is used. Could it be because of the kt network?

image image image image image image

https://github.com/AirenSoft/OvenMediaEngine/issues/149 I was referring to. There is no "UDP send buffer error" error. However, it is very small with net.ipv4.udp_rmem_min = 4096. Compared to this value net.ipv4.udp_rmem_min=8388608 net.ipv4.udp_wmem_min=8388608 net.core.netdev_max_backlog=8388608 net.core.wmem_default = 8388608 net.core.wmem_max = 8388608 net.core.rmem_max = 8388608

getroot commented 4 years ago

The packetsLost, framesDropped, freezeCount values ​​indicate that there is a problem. Most of these problems are caused by jitter.

"Low latency" means the buffer is very small, which means it is vulnerable to network jitter. And just because you use a 10g kt network does not always guarantee 10g. There is jitter there.

To minimize jitter, try turning on "Enable network optimizations" in OBS's Advanced settings like this.

image

The jitter in the network is beyond our control, so tuning beyond this is impossible. Of course, using WebRTC's Retransmission can solve the jitter problem to some extent, but it increases latency again (we are developing a retransmission function).

Try testing on your local network to see if it's a network problem. I was able to see that the 15M bitrates were also played successfully.

getroot commented 4 years ago

Also, 9999Kbps is a much higher bitrate than you think. Lowering this would also be a good way to get rid of the jitter problem.

jys923 commented 4 years ago

Thanks for the reply

3000kbps is better

I understood your explanation of " Low latency = vulnerable to network jitter" However, the mobile phone and PC are on the same Wi-Fi. player is same. Your demo site "https://demo.ovenplayer.com/#sources=%5B%7B%22default%22%3Afalse%2C%22id%22%3A0%2C%22file%22%3A%22wss%3A%2F% 2Fws.danchu.co.kr%3A3334%2Fapp%2Fstream%22%2C%22type%22%3A%22webrtc%22%2C%22label%22%3A%22webrtc-0%22%7D%5D&lowLatency=true&liveDelay=5"

But why is there less lag on a PC than a mobile phone? If it's a network problem, shouldn't I have a lag together?

getroot commented 4 years ago

Well... WIFI problems are complex, such as frequency collision, reception rate, and error correction, so I can't accurately answer them. Test it with a wired network. And you said that you are using kt 10g earlier, but the moment you use WIFI, most of the problems occur with WIFI and router. In my experience, LTE or 5G showed better quality, so please refer to this as well. And please understand that I cannot provide technical support other than OME.

getroot commented 3 years ago

This issue has been closed since it has been inactive for quite some time. If you want to continue discussing this issue, please feel free to reopen it.