Open
Description
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
yushimeng commentedon Feb 2, 2024
"'reset' command" means tcp reset pkt over sip?
daveyang05 commentedon Feb 2, 2024
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 commentedon Feb 2, 2024
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 commentedon Feb 2, 2024
It looks like sip recv thread exit did not notify sip conn thread.
winlinvip commentedon Feb 2, 2024
@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
fix GB28181: When camera restart, can not connect to SRS. ossrs#3944
yushimeng commentedon Feb 2, 2024
@daveyang05 try this pull #3947
give me a feedback if dont work
winlinvip commentedon Feb 2, 2024
@yushimeng Nice work!
daveyang05 commentedon Feb 4, 2024
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