跳到主要内容

Live Streaming Function

State

Live Streaming Capability Update

Topic: thing/product/{device_sn}/state

Direction: up

Data:

ColumnNameTypeconstraintDescription
live_capacityLive Streaming Capabilitystruct
»available_video_numberTotal Number of Available Video Streamsint{}Indicates the total number of video streams available for live streaming by the drone or device
»coexist_video_number_maxMaximum Number of Simultaneous Video Streamsint{}
»device_listList of Sub-devicesarray{}
»»[array_item]Elements in arraystruct{}{"size": "2"}
»»»snDevice Serial Number (SN)text{"length":"10240"}
»»»available_video_numberTotal Number of Available Video Streamsint{}Indicates the total number of video streams available for live streaming by the device
»»»coexist_video_number_maxMaximum Number of Simultaneous Video Streamsint{}
»»»camera_listCamera List on the Devicearray{"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"}}}]}}}}]}}


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:

ColumnNameTypeconstraintDescription
url_typeLive Stream Protocol Typeenum{"1":"RTMP","2":"RTSP","3":"GB28181"\,"101", "4G_RTMP"}
urlLive Stream Parameterstext{}RTMP format example: (rtmp://xxxxxxx) Example: rtmp://192.168.1.1:8080/live
video_idLive Stream Video IDtext{}Format: #{uav_sn}/#{camera_id}/#{video_index}; e.g., for a drone: "1748FEV3HMA923171787/drone-camera-0/normal"
video_qualityLive Stream Qualityenum{"2":"SD", "3":"HD"}Different resolution options: SD: 1280 x 720, HD: 1920 x 1080
video_typeLive Stream Lens Typetext{"normal","zoom","ir"}Specifies the type of lens used, e.g., normal/zoom/infrared

Example:

{
"timestamp": 1711022516332,
"data": {
"url": "rtmp://test-mediacenter.autelrobotics.cn:1936/live/1748FEV3HMA923171787/drone-camera-0/normal",
"url_type": 1,
"video_id": "1748FEV3HMA923171787/drone-camera-0/normal",
"video_quality": 1,
"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:

ColumnNameTypeconstraintDescription
video_idThe ID of the live video streamtext{}The format is as follows:#{uav_sn}/#{camera_id}/#{video_index}; where:uav_sn: The UAV's serial number; camera_id: The payload and its mounting position (in an enumerated format); video_index: The payload lens identifier. For example: Nest stream ID: "1748FEV3HMA923171787/nest-camera-out/normal"; Drone stream ID: "1748FEV3HMA923171787/drone-camera-0/normal".

Example:

{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp:": 1654070968655,
"method": "live_stop_push",
"data": {
"video_id": "1748FEV3HMA923171787/drone-camera-0/normal"
}
}

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:

ColumnNameTypeconstraintDescription
video_idStream Video IDtext{}Format: #{uav_sn}/#{camera_id}/#{video_index}; UAV SN number / payload and mount position / payload lens ID
video_qualityStream Qualityenum{"2":"SD", "3":"HD"}Different resolution levels: SD (1280 * 720), HD (1920 * 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": 4
}
}

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:

ColumnNameTypeconstraintDescription
video_idStream Video IDtext{}Format: #{uav_sn}/#{camera_id}/#{video_index}; UAV SN number / payload and mount position / payload lens ID
video_typeStream Lens Typeenum{"normal":"default","wide":"wide-angle","zoom":"zoom","ir":"infrared"}

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
\}
\}