Skip to main content

Live Streaming

Service

Switch live streaming camera

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: live_camera_change

Data:

ColumnNameTypeconstraintDescription
video_idID of the live streaming video streamtextFormat: {sn}/{camera_index}/{video_index}
camera_positionFPV positionenum_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:

ColumnNameTypeconstraintDescription
resultReturn codeintNon-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:

ColumnNameTypeconstraintDescription
url_typeLive streaming protocol typeenum_int{"0":"Agora","1":"RTMP","3":"GB28181","4":"WebRTC"}WebRTC only supports WHIP protocol signaling exchange
urlLive streaming parameterstextRTMP: (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_idID of the live streaming video streamtextIdentifier 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_qualityLive streaming qualityenum_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:

ColumnNameTypeconstraintDescription
resultReturn codeintNon-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:

ColumnNameTypeconstraintDescription
video_idID of the live streaming video streamtextIdentifier 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:

ColumnNameTypeconstraintDescription
resultReturn codeintNon-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:

ColumnNameTypeconstraintDescription
video_idID of the live streaming video streamtextIdentifier 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_qualityLive streaming qualityenum_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:

ColumnNameTypeconstraintDescription
resultReturn codeintNon-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:

ColumnNameTypeconstraintDescription
video_idID of the live streaming video streamtextIdentifier 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_typeLive streaming video lens typeenum_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"
}