srs icon indicating copy to clipboard operation
srs copied to clipboard

GB28181: Large latency when playing WebRTC.

Open lifeibin opened this issue 1 year ago • 4 comments

The user has downloaded version 5.0-r2 of the SRS (Simple Real-time Server) source code and compiled it locally. They have successfully connected to a national standard camera, and both the connection and playback are working normally. They have observed the performance of both FLV and WebRTC streaming. However, they are experiencing an issue with WebRTC latency, which is around 4 seconds. They are unsure if this is due to TCP and are confused because the expected latency, as per the documentation, should be less than 1 second. They are seeking an explanation for this discrepancy. 123456 The user is referring to the configuration file for SRS (Simple Real-time Server) named "push.gb28181.conf" and is indicating that they will provide the main content of the configuration settings next. stream_caster { enabled on; caster gb28181; output rtmp://127.0.0.1/live/[stream]; listen 9000; # Deprecated config, moved to sip.candidate, see gb28181.conf # @see https://ossrs.net/lts/zh-cn/docs/v5/doc/gb28181#config-candidate host 172.24.9.59; sip { enabled on; listen 5060; serial 34020000002000000001; realm 3402000000; } }

http_server { enabled on; listen 8080; dir ./objs/nginx/html; }

http_api { enabled on; listen 1985; } stats { network 0; } rtc_server { enabled on; listen 8000; # UDP port # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#config-candidate candidate 172.24.9.59; }

vhost defaultVhost { rtc { enabled on; # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtmp-to-rtc rtmp_to_rtc on; # @see https://ossrs.net/lts/zh-cn/docs/v4/doc/webrtc#rtc-to-rtmp rtc_to_rtmp on; } http_remux { enabled on; mount [vhost]/[app]/[stream].flv; } hls { enabled off; } }

TRANS_BY_GPT4

lifeibin avatar May 20 '24 03:05 lifeibin

@winlinvip Concerning this matter, is the latency within expected parameters? If it is not, what steps can I take to address it?

TRANS_BY_GPT4

lifeibin avatar May 21 '24 06:05 lifeibin

Generally speaking, issues like delays are not immediately apparent as to what the problem is. If you are unable to resolve it on your own, it is recommended to try out several open-source software solutions.

TRANS_BY_GPT4

winlinvip avatar May 24 '24 02:05 winlinvip

Generally speaking, issues like delays are not immediately apparent as to what the problem is. If you are unable to resolve it on your own, it is recommended to try out several open-source software solutions.

TRANS_BY_GPT4

Thank you, I query additional information to resolve it. I use the rtc version of srs-gb28181, the delay is within 1 second, perhaps the reason is the older version use udp, the 5.0 use tcp

lifeibin avatar May 26 '24 07:05 lifeibin

have you tested the latency of play over rtmp or flv?

yushimeng avatar Jul 22 '24 02:07 yushimeng