This guide outlines how to call the necessary API to retrieve a list of camera streams, including their main and sub-stream URLs.
- Retrieve the base RTSP URL.
- Define the query parameters (
token
andid
).- Append the query parameters to the RTSP URL.
- Final RTSP URL with the required query parameters.
Contact the administrator to get the access_token required for making API requests.
- URL:
{{vms_api_url}}/3rd/streaming/camera/list
- Method:
POST
- Content-Type:
application/json
- Access-Token:
<Your Access Token>
An empty JSON object is sent in the body:
{}curl -X GET "{{vms_api_url}}/3rd/streaming/camera/list" \ -H "Content-Type: application/json" \ -H "Access-Token: <Your Access Token>" \ -d '{}'{ "data": [ { "id": "string", "main_stream_url": "string", "name": "string", "sub_stream_url": "string" } ], "details": null, "next_page_token": null, "success": boolean }{ "data": [ { "id": "camera_id", "main_stream_url": "rtsp://example.com:8554/main", "name": "Example camera", "sub_stream_url": "rtsp://example.com:8554/sub" } ], "details": null, "next_page_token": null, "success": true }{ "data": "AUTH_FAILED", "details": "AUTH_FAILED", "next_page_token": null, "success": false }
data
(array of objects) > - Type:array
- Description: An array of camera objects, each containing streaming information for individual cameras.
- Fields in each camera object: > -
main_stream_url
(string): The URL for the main stream of the camera. This is usually an RTSP URL used to access the primary video feed.
name
(string): The name or identifier of the camera (e.g., "2-VP", "TV-cam").sub_stream_url
(string): The URL for the sub-stream of the camera. This could be an RTSP URL used for a secondary, lower-quality video feed, often used for viewing at lower bandwidth or for less important streams.
details
(null or string) > - Type:null
orstring
- Description: A field that may contain additional details about the request or response. In this case, it is typically
null
, but it may be used for additional error information or metadata if needed.
next_page_token
(null or string) > - Type:null
orstring
- Description: A token used for pagination, allowing you to fetch the next set of camera streams if the list is paginated. If there is no pagination, this field is
null
.
success
(boolean) > - Type:boolean
- Description: A boolean value indicating whether the request was successful. A value of
true
means the request was successful, whilefalse
means an error occurred.
After retrieving the RTSP URL via the API, you need to append the query parameters (
token
andid
) to the base RTSP URL for playing the camera stream.
token
: The authentication token to be added to the URL.id
: The camera ID to be appended.Append the query parameters to the base RTSP URL. The final RTSP URL will look like this:
rtsp://example.com:8554/main?token=xxx&id=camera_id
This modified RTSP URL can then be used for streaming the camera feed.
Last active
December 2, 2024 05:57
-
-
Save cuongtvee/1c85ea4ad74436bdddfe1f7ff92919e9 to your computer and use it in GitHub Desktop.
vms-3rd.MD
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment