Live Streaming Function
State
Live Streaming Capability Update
Topic: thing/product/{device_sn}/state
Direction: up
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| live_capacity | Live Streaming Capability | struct | Gateway device livestream capability | |
| »available_video_number | Total Number of Available Video Streams | int | {} | Indicates the total number of video streams available for live streaming by the drone or device |
| »coexist_video_number_max | Maximum Number of Simultaneous Video Streams | int | {} | Maximum number of simultaneous streams |
| »device_list | List of Sub-devices | array | {} | Available video device source list |
| »»[array_item] | Elements in array | struct | {} | {"size": "2"} |
| »»»sn | Device Serial Number (SN) | text | {"length":"10240"} | Video source device serial number |
| »»»available_video_number | Total Number of Available Video Streams | int | {} | Indicates the total number of video streams available for live streaming by the device |
| »»»coexist_video_number_max | Maximum Number of Simultaneous Video Streams | int | {} | Maximum simultaneous streams for this device |
| »»»camera_list | Camera List on the Device | array | {"item": {"type": "struct", "specs": [ {"identifier": "camera_index", "name": "Camera Index, consisting of type enumeration and gimbal position number", "dataType": {"type": "text", "specs": {"length": "24"}}}, {"identifier": "available_video_number", "name": "Total Number of Available Video Streams", "desc": "Indicates the total number of video streams available for live streaming by this camera", "dataType": {"type": "int", "specs": {}}}, {"identifier": "coexist_video_number_max", "name": "Maximum Number of Simultaneous Video Streams by this Camera", "dataType": {"type": "int", "specs": {}}}, {"identifier": "video_list", "name": "List of Video Streams", "dataType": {"type": "array", "specs": {"item": {"type": "struct", "specs": [ {"identifier": "video_index", "name": "Video Index", "dataType": {"type": "text", "specs": {"length": "24"}}}, {"identifier": "video_type", "name": "Type of Video", "desc": "Indicates the type of video lens, such as normal/wide/zoom/ir", "dataType": {"type": "text", "specs": {"length": "24"}}}, {"identifier": "switchable_video_types", "name": "List of Switchable Video Lens Types: normal/wide/zoom/ir", "dataType": {"type": "array", "specs": {"type": "text", "length": "24"}}}]}}}}]}} | Camera list on this device |
| »»»»[array_item] | Elements in array | struct | {} | Camera information struct |
| »»»»available_video_number | Number of Video Streams Available on This Camera | int | Number of video streams available for live streaming on this camera | |
| »»»»camera_index | Camera Index | text | Format: {type-subtype-gimbalindex}. Dock camera: 10165-0-0 is indoor camera, 10165-0-1 is outdoor camera | |
| »»»»coexist_video_number_max | Maximum Number of Simultaneous Video Streams | int | Maximum simultaneous streams for this camera | |
| »»»»video_list | Lens List | array | Video stream list of this camera | |
| »»»»»[array_item] | Elements in array | struct | {} | Video stream information struct |
| »»»»»switchable_video_types | Lens Types | string_array | e.g. ["normal", "ir", "wide", "zoom"] reported according to the lenses supported by the camera | List of switchable lens types for this video stream |
| »»»»»video_index | Lens Index | text | Video stream index | |
| »»»»»video_type | Lens Type | text | Lens type currently in use | |
| »»»»lens_range_info | Zoom Range | array | Zoom range information list of this camera | |
| »»»»»[array_item] | Elements in array | struct | {} | Zoom range struct |
| »»»»»len_type | Lens Type | text | Lens type identifier | |
| »»»»»step | Minimum Zoom Step | float | Minimum zoom adjustment step | |
| »»»»»max | Maximum Zoom Factor | double | Maximum zoom factor, 160.0 by default for the zoom lens | |
| »»»»»min | Minimum Zoom Factor | double | Minimum zoom factor, 1.0 by default for the zoom lens |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"live_capacity": {
"available_video_number": 3,
"coexist_video_number_max": 2,
"device_list": [
{
"sn": "4BKBJ4R1010TGD",
"available_video_number": 1,
"coexist_video_number_max": 1,
"camera_list": [
{
"camera_index": "165-0-7",
"available_video_number": 1,
"coexist_video_number_max": 1,
"video_list": [
{
"video_index": "normal-0",
"video_type": "normal",
"switchable_video_types": [
"normal"
]
}
]
}
]
},
{
"sn": "1581F4BND22180040075",
"available_video_number": 2,
"coexist_video_number_max": 2,
"camera_list": [
{
"camera_index": "39-0-7",
"available_video_number": 1,
"coexist_video_number_max": 1,
"video_list": [
{
"video_index": "normal-0",
"video_type": "normal",
"switchable_video_types": [
"normal"
]
}
]
},
{
"camera_index": "52-0-0",
"available_video_number": 1,
"coexist_video_number_max": 1,
"video_list": [
{
"video_index": "normal-0",
"video_type": "wide",
"switchable_video_types": [
"wide",
"zoom",
"ir"
]
}
]
}
]
}
]
}
},
"timestamp": 1654070968655,
"gateway": "4BKBJ4R1010TGD"
}
Service
Start Live Streaming
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: live_start_push
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| url_type | Live Stream Protocol Type | enum | {"0":"Agora","1":"RTMP","2":"RTSP","3":"GB28181","4":"WHIP","101":"4G_RTMP"} | Streaming protocol type |
| url | Live Stream Parameters | text | {} | RTMP format example: (rtmp://xxxxxxx) Example: rtmp://live.example.com:1935/live |
| video_id | Live Stream Video ID | text | {} | Format: #{device_sn}/#{camera_index}/#{video_index}; e.g., for a dock: "NM1924481004/10165-0-0/normal-0"; for a drone: "1748FEV3HMA923171787/10802-0-0/normal-0". The device validates the camera_index in the ID, which must be taken from camera_index in the live streaming capability. |
| video_quality | Live Stream Quality | enum | {"2":"SD", "3":"HD"} | SD: 1280 x 720, HD: 1920 x 1080 |
| video_type | Live Stream Lens Type | text | {"normal","wide","zoom","ir","thermal","NightVision"} | Specifies the type of lens used, e.g., normal/wide/zoom/infrared/thermal/night vision |
| intranet_url | Intranet Address | text | Intranet server address. Not supported by the current firmware. | |
| external_url | External Address | text | External server address, which can be the same as intranet_url. Not supported by the current firmware. | |
| token | Authentication Token | text | Authentication token. Not supported by the current firmware. |
Example:
{
"timestamp": 1711022516332,
"data": {
"url": "rtmp://test-mediacenter.autelrobotics.cn:1936/live/1748FEV3HMA923171787/10802-0-0/normal-0",
"url_type": 1,
"video_id": "1748FEV3HMA923171787/10802-0-0/normal-0",
"video_quality": 3,
"video_type": "zoom"
},
"method": "live_start_push",
"tid": "b92a6aa1-96eb-4b4a-848f-c0f63f206d3b",
"bid": "74008969-0d46-4f69-9a03-78423824fe24",
"gateway": "TH7923221094"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: live_start_push
Data:
Example:
\{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_start_push",
"data": \{
"result": 0
\}
\}
Stop Live Stream
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: live_stop_push
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| video_id | The ID of the live video stream (optional) | text | {} | The format is as follows:#{device_sn}/#{camera_index}/#{video_index}; where:device_sn: The device's serial number; camera_index: The camera index; video_index: The lens index. For example: Nest stream ID: "NM1924481004/10165-0-0/normal-0"; Drone stream ID: "1748FEV3HMA923171787/10802-0-0/normal-0". When left empty, all live streams are stopped. |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_stop_push",
"data": {
"video_id": "1748FEV3HMA923171787/10802-0-0/normal-0"
}
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: live_stop_push
Data: null
Example:
\{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_stop_push",
"data": \{
"result": 0
\}
\}
Set the live broadcast resolution
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: live_set_quality
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| video_id | Stream Video ID | text | {} | Format: #{device_sn}/#{camera_index}/#{video_index}; device SN number / camera index / lens index |
| video_quality | Stream Quality | enum | {"2":"SD", "3":"HD"} | SD: 1280 x 720, HD: 1920 x 1080 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_set_quality",
"data": {
"video_id": "1ZNDH1D0010098/39-0-7/normal-0",
"video_quality": 3
}
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: live_set_quality
Data: null
Example:
\{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_set_quality",
"data": \{
"result": 0
\}
\}
Set up live camera
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: live_lens_change
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| video_id | Stream Video ID | text | {} | Format: #{device_sn}/#{camera_index}/#{video_index}; device SN number / camera index / lens index |
| video_type | Stream Lens Type | enum | {"normal":"default","wide":"wide-angle","zoom":"zoom","ir":"infrared","thermal":"thermal","NightVision":"night vision"} | Video lens type |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_lens_change",
"data": {
"video_id": "1581F5BMD228Q00A82XX/39-0-7/zoom-0",
"video_type": "zoom"
}
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: live_lens_change
Data: null
Example:
\{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_lens_change",
"data": \{
"result": 0
\}
\}