Live Stream
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 streaming protocol type | enum_int | {"0":"Agora","1":"RTMP","2":"RTSP","3":"GB28181"} | |
url | Live streaming parameters | text | RTMP: (rtmp://xxxxxxx, example: rtmp://192.168.1.1:8080/live). RTSP:(uerName&password&port, example: userName=dji-cloud-api&password=123456&port=8080). 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). Agora: (channel&sn&token&uid, example: channel=1ZNDH360010162_39-0-7&sn=1ZNDH360010162&token=006dca67721582a48768ec4d817b7b25a86IAB4cw2JgN6iX8BpTPdc3e4S1Iendz94IFJ56aSXKvzAJei27MqF2zyCIgCLIIoBt41+YAQAAQC3jX5gAgC3jX5gAwC3jX5gBAC3jX5g&uid=50000). Note: Agora-generated tokens may contain special characters like '+', which need to be URL-encoded once. Otherwise, the Pilot side may encounter parsing errors. | |
video_id | ID of the live streaming video stream | text | Identifier for pushing video streams 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: Fluent: 960 * 540, 512Kbps; Standard Definition (SD): 1280 * 720, 1Mbps; High Definition (HD): 1280 * 720, 1.5Mbps; Ultra High Definition (UHD): 1920 * 1080, 3Mbps. |
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
}
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 | |
info | Livestream information | text | {} | If you need to bring parameters when answering, you can add it in info. For example, RTSP needs to return the live url address of the device. |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "live_start_push",
"data": {
"result": 0,
"info": "rtsp://${username}:${password}@192.168.1.100:8445/live/1"
}
}
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 video streams 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
}
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
}
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 video streams 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: Fluent: 960 * 540, 512Kbps; Standard Definition (SD): 1280 * 720, 1Mbps; High Definition (HD): 1280 * 720, 1.5Mbps; Ultra High Definition (UHD): 1920 * 1080, 3Mbps. |
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
}
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
}
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 video streams 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
}
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
}