跳到主要内容

Live Streaming Function

State​

Live Streaming Capability Update​

Topic: thing/product/{device_sn}/state

Direction: up

Data:

ColumnNameTypeconstraintDescription
live_capacityLive Streaming CapabilitystructGateway device livestream capability
»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{}Maximum number of simultaneous streams
»device_listList of Sub-devicesarray{}Available video device source list
»»[array_item]Elements in arraystruct{}{"size": "2"}
»»»snDevice Serial Number (SN)text{"length":"10240"}Video source device serial number
»»»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{}Maximum simultaneous streams for this device
»»»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"}}}]}}}}]}}Camera list on this device
»»»»[array_item]Elements in arraystruct{}Camera information struct
»»»»available_video_numberNumber of Video Streams Available on This CameraintNumber of video streams available for live streaming on this camera
»»»»camera_indexCamera IndextextFormat: {type-subtype-gimbalindex}. Dock camera: 10165-0-0 is indoor camera, 10165-0-1 is outdoor camera
»»»»coexist_video_number_maxMaximum Number of Simultaneous Video StreamsintMaximum simultaneous streams for this camera
»»»»video_listLens ListarrayVideo stream list of this camera
»»»»»[array_item]Elements in arraystruct{}Video stream information struct
»»»»»switchable_video_typesLens Typesstring_arraye.g. ["normal", "ir", "wide", "zoom"] reported according to the lenses supported by the cameraList of switchable lens types for this video stream
»»»»»video_indexLens IndextextVideo stream index
»»»»»video_typeLens TypetextLens type currently in use
»»»»lens_range_infoZoom RangearrayZoom range information list of this camera
»»»»»[array_item]Elements in arraystruct{}Zoom range struct
»»»»»len_typeLens TypetextLens type identifier
»»»»»stepMinimum Zoom StepfloatMinimum zoom adjustment step
»»»»»maxMaximum Zoom FactordoubleMaximum zoom factor, 160.0 by default for the zoom lens
»»»»»minMinimum Zoom FactordoubleMinimum 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:

ColumnNameTypeconstraintDescription
url_typeLive Stream Protocol Typeenum{"0":"Agora","1":"RTMP","2":"RTSP","3":"GB28181","4":"WHIP","101":"4G_RTMP"}Streaming protocol type
urlLive Stream Parameterstext{}RTMP format example: (rtmp://xxxxxxx) Example: rtmp://live.example.com:1935/live
video_idLive Stream Video IDtext{}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_qualityLive Stream Qualityenum{"2":"SD", "3":"HD"}SD: 1280 x 720, HD: 1920 x 1080
video_typeLive Stream Lens Typetext{"normal","wide","zoom","ir","thermal","NightVision"}Specifies the type of lens used, e.g., normal/wide/zoom/infrared/thermal/night vision
intranet_urlIntranet AddresstextIntranet server address. Not supported by the current firmware.
external_urlExternal AddresstextExternal server address, which can be the same as intranet_url. Not supported by the current firmware.
tokenAuthentication TokentextAuthentication 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:

ColumnNameTypeconstraintDescription
video_idThe 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:

ColumnNameTypeconstraintDescription
video_idStream Video IDtext{}Format: #{device_sn}/#{camera_index}/#{video_index}; device SN number / camera index / lens index
video_qualityStream Qualityenum{"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:

ColumnNameTypeconstraintDescription
video_idStream Video IDtext{}Format: #{device_sn}/#{camera_index}/#{video_index}; device SN number / camera index / lens index
video_typeStream Lens Typeenum{"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
\}
\}