Question about the Rest-api to connect rtsp link.

I use the rest api on server to connect a rtsp link using https://XXXXXXXXXXXXX/rest-api/rtsp/startup

for example:
body:
{
"uri":"rtsp://abc:pwd@XXXXXXXX:554/v1",
"localStreamName": "test1"
}

After testing, whether it is success to connect the rtsp or not, it will also return http 200. so
If the username or password, i correct, how can i know it is not connected and due to password incorrect?
If the rtsp link is not exist, how can i know it is not connected and due to rtsp not exist?

Is there any way to know the connection result directly from the rest api?

If i use /rest-api/rtsp/find_all, i can know the rtsp is not connected, but don't know the reason. Thanks
 

Max

Administrator
Staff member
Good day.
If the rtsp link is not exist, how can i know it is not connected and due to rtsp not exist?
Is there any way to know the connection result directly from the rest api?
The REST API query /rtsp/startup is always handled before connecting to RTSP stream because connection may take a long time (up to a few seconds).
You can use REST hook /ConnectionStatusEvent. In this case, your backend will be notified about the RTSP stream is disconnected, for example:
Code:
{
  "nodeId" : "qg4BeHzYSAtkhUkXgnSMEUZpsshaLPL5@wcs_ip",
  "appKey" : "defaultApp",
  "sessionId" : "rtsp://abc:password@XXXXXXXXX:554/v1-8bd9157b-5709-4f68-91d2-fa02af118deb",
  "status" : "DISCONNECTED"
}
The sessionId field begins from RTSP URI in this case.
Please look at this REST hook implementation example.
 
Top