Live Streaming
Service
Switch live streaming camera
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: live_camera_change
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| video_id | ID of the live streaming video stream | text | Format: {sn}/{camera_index}/{video_index} | |
| camera_position | FPV position | enum_int | {"0":"Inside the dock","1":"Outside the dock"} |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"camera_position": 0,
"video_id": "1ZNDH1D0010098/165-0-7/normal-0"
},
"method": "live_camera_change",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: live_camera_change
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | Return code | int | Non-zero represents an error |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_camera_change"
}
Start live streaming
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: live_start_push
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| url_type | Live streaming protocol type | enum_int | {"0":"Agora","1":"RTMP","3":"GB28181","4":"WebRTC"} | WebRTC only supports WHIP protocol signaling exchange |
| url | Live streaming parameters | text | RTMP: (rtmp://xxxxxxx, example: rtmp://192.168.1.1:8080/live). GB28181: (serverIP&serverPort&serverID&agentID&agentPassword&localPort&channel, example: serverIP=192.168.1.1&serverPort=8080&serverID=34000000000000000000&agentID=300000000010000000000&agentPassword=0000000&localPort=7060&channel=340000000000000000000). WebRTC: (example: http://192.168.1.1:8080/rtc/v1/whip/?app=live&stream=livestream) | |
| video_id | ID of the live streaming video stream | text | Identifier for pushing a video stream on a certain route, formatted as {sn}/{camera_index}/{video_index}. {sn} is the serial number of the video source device. {camera_index} is the camera index, using the format {type-subtype-gimbalindex}. {video_index} is the index of the video stream that can be selected at the camera level. | |
| video_quality | Live streaming quality | enum_int | {"0":"Adaptive","1":"Smooth","2":"Standard definition","3":"High definition","4":"Ultra-high definition"} | The resolutions and bitrates for different video qualities are as follows: Smooth: 960 * 540, 1Mbps. Standard definition: 1280 * 720, 1Mbps. High definition: 1280 * 720, 1.5Mbps. Ultra-high definition: 1920 * 1080, 8Mbps. |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"url": "channel=1ZNDH1D0010098_39-0-7&sn=1ZNDH1D0010098&token=006dca67721582a48768ec4d817b7b25a86IADk%2Fcm%2Fdv%2BHY6qT%2FAKM6y7TcUe4lXNvZpycH7vUMAlM6pFALUKF2zyCIgA82pQE8cCoYAQAAQDxwKhgAgDxwKhgAwDxwKhgBADxwKhg&uid=50000",
"url_type": 0,
"video_id": "1ZNDH1D0010098/39-0-7/normal-0",
"video_quality": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_start_push"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: live_start_push
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | Return code | int | Non-zero represents an error |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_start_push"
}
Stop live streaming
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: live_stop_push
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| video_id | ID of the live streaming video stream | text | Identifier for pushing a video stream on a certain route, formatted as {sn}/{camera_index}/{video_index}. {sn} is the serial number of the video source device. {camera_index} is the camera index, using the format {type-subtype-gimbalindex}. {video_index} is the index of the video stream that can be selected at the camera level. |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"video_id": "1ZNDH1D0010098/42-0-0/zoom-0"
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_stop_push"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: live_stop_push
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | Return code | int | Non-zero represents an error |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_stop_push"
}
Set live streaming quality
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: live_set_quality
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| video_id | ID of the live streaming video stream | text | Identifier for pushing a video stream on a certain route, formatted as {sn}/{camera_index}/{video_index}. {sn} is the serial number of the video source device. {camera_index} is the camera index, using the format {type-subtype-gimbalindex}. {video_index} is the index of the video stream that can be selected at the camera level. | |
| video_quality | Live streaming quality | enum_int | {"0":"Adaptive","1":"Smooth","2":"Standard definition","3":"High definition","4":"Ultra-high definition"} | The resolutions and bitrates for different video qualities are as follows: Smooth: 960 * 540, 1Mbps. Standard definition: 1280 * 720, 1Mbps. High definition: 1280 * 720, 1.5Mbps. Ultra-high definition: 1920 * 1080, 8Mbps. |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"video_id": "1ZNDH1D0010098/39-0-7/normal-0",
"video_quality": 4
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_set_quality"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: live_set_quality
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | Return code | int | Non-zero represents an error |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_set_quality"
}
Set live streaming lens
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: live_lens_change
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| video_id | ID of the live streaming video stream | text | Identifier for pushing a video stream on a certain route, formatted as {sn}/{camera_index}/{video_index}. {sn} is the serial number of the video source device. {camera_index} is the camera index, using the format {type-subtype-gimbalindex}. {video_index} is the index of the video stream that can be selected at the camera level. | |
| video_type | Live streaming video lens type | enum_string | {"ir":"Infrared","normal":"Default","wide":"Wide-angle","zoom":"Zoom"} |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"video_id": "1581F5BMD228Q00A82XX/39-0-7/zoom-0",
"video_type": "zoom"
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_lens_change"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: live_lens_change
Data: null
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_lens_change"
}