Skip to content

GB28181: When camera restart, can not connect to SRS. #3944

Open
@daveyang05

Description

@daveyang05

Integrating Hikvision cameras using the GB28181 protocol, after the camera restarts, it takes more than two hours for the video stream to recover. Before recovery, the session status in SRS remains in the 'established' state. Approximately two hours later, the camera sends a remote 'reset' command, after which SRS disconnects the media stream, and then normal operation resumes.

Activity

changed the title 使用GB28181协议接入海康摄像头,摄像头重启后,2多个小时视频流才恢复,恢复之前SRS的session会话状态一直是established状态,摄像头在两个小时左右发送了一个远程关闭reset操作后,SRS断开媒体流,才恢复正常 Integrating Hikvision cameras using the GB28181 protocol, after the camera restarts, it takes more than two hours for the video stream to recover. Before recovery, the session status in SRS remains in the 'established' state. Approximately two hours later, the camera sends a remote 'reset' command, after which SRS disconnects the media stream, and then normal operation resumes. on Feb 2, 2024
yushimeng

yushimeng commented on Feb 2, 2024

@yushimeng

"'reset' command" means tcp reset pkt over sip?

daveyang05

daveyang05 commented on Feb 2, 2024

@daveyang05
Author

Could you please clarify if GB28181 is capable of actively detecting when a media stream is disconnected and subsequently transitioning the state of the camera session to an initial state, among other potential state changes?

TRANS_BY_GPT4

daveyang05

daveyang05 commented on Feb 2, 2024

@daveyang05
Author

2024-01-30 10:23:44.903][ERROR][1][47l067d9][104] SIP: Receive err code=1007(SocketRead)(Socket read data failed) : parse message : parse message : grow buffer : read bytes : read
thread [1][47l067d9]: do_cycle() [./src/app/srs_app_gb28181.cpp:1077][errno=104]
thread [1][47l067d9]: parse_message() [./src/protocol/srs_protocol_http_conn.cpp:103][errno=104]
thread [1][47l067d9]: parse_message_imp() [./src/protocol/srs_protocol_http_conn.cpp:153][errno=104]
thread [1][47l067d9]: grow() [./src/protocol/srs_protocol_stream.cpp:162][errno=104]
thread [1][47l067d9]: read() [./src/protocol/srs_protocol_st.cpp:566][errno=104](Connection reset by peer)

Hello! The above text is a log printout from SRS. According to the log, SRS disconnects the media stream connection after receiving the "Connection reset by peer" command. Subsequently, the status transitions from established to init, at which point it can accept registration messages from the camera. Preliminary analysis suggests this is the case.

The initial suspicion is that the support for SRS to access the 28181 protocol did not detect the media stream fault.

TRANS_BY_GPT4

yushimeng

yushimeng commented on Feb 2, 2024

@yushimeng

It looks like sip recv thread exit did not notify sip conn thread.

changed the title Integrating Hikvision cameras using the GB28181 protocol, after the camera restarts, it takes more than two hours for the video stream to recover. Before recovery, the session status in SRS remains in the 'established' state. Approximately two hours later, the camera sends a remote 'reset' command, after which SRS disconnects the media stream, and then normal operation resumes. GB28181: When camera restart, can not connect to SRS. on Feb 2, 2024
self-assigned this
on Feb 2, 2024
winlinvip

winlinvip commented on Feb 2, 2024

@winlinvip
Member

@yushimeng This seems quite reasonable and commendable. If a thread exits abnormally, there might indeed be an issue with how this logic is handled.

TRANS_BY_GPT4

yushimeng

yushimeng commented on Feb 2, 2024

@yushimeng

@daveyang05 try this pull #3947
give me a feedback if dont work

winlinvip

winlinvip commented on Feb 2, 2024

@winlinvip
Member

@yushimeng Nice work!

daveyang05

daveyang05 commented on Feb 4, 2024

@daveyang05
Author

Hello! The developer responsible for interfacing with the development of 28181 has taken leave due to personal matters at home. They will commence the verification process in this area immediately upon their return after the New Year, and the results will be promptly communicated to you. Additionally, could you please confirm if it is branch #3947?

TRANS_BY_GPT4

26 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

GB28181For GB28181.TransByAITranslated by AI/GPT.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Participants

@winlinvip@codeex@yushimeng@daveyang05

Issue actions

    GB28181: When camera restart, can not connect to SRS. · Issue #3944 · ossrs/srs