Live Stream

2023-10-08
No Rating

State

Livestream ability update

Topic: thing/product/{device_sn}/state

Direction: up

Data:

ColumnNameTypeconstraintDescription
live_capacityLivestream abilitystruct
»available_video_numberTotal number of video streams available for livestreamingint{}Indicates the total number of all available live video streams owned by the aircraft or device
»coexist_video_number_maxMaximum total number of video streams that can be lived stream simultaneouslyint{}
»device_listDevice live streaming capability listarray{}
»»[array_item]Elements in arraystruct{}{"size": "2"}
»»»snDevice serial numbertext{"length":"10240"}
»»»available_video_numberTotal number of video streams that can be used for livestreamingint{}Total number of video streams used for livestreaming that belongs to devices
»»»coexist_video_number_maxMaximum number of video streams that can be used for livestreaming at the same timeint{}
»»»camera_listCamera list on the devicearray{"item":{"type":"struct","specs":[{"identifier":"camera_index","name":"Camera index, composed of product type enumeration and gimbal index.","dataType":{"type":"text","specs":{"length":"24"}}},{"identifier":"available_video_number","name":"Total number of video streams that can be used for livestreaming","desc":"Total number of video streams that the camera can live stream","dataType":{"type":"int","specs":{}}},{"identifier":"coexist_video_number_max","name":"Maximum number of video streams that the camera can live stream at the same time.","dataType":{"type":"int","specs":{}}},{"identifier":"video_list","name":"Video stream list","dataType":{"type":"array","specs":{"item":{"type":"struct","specs":[{"identifier":"video_index","name":"Video index","dataType":{"type":"text","specs":{"length":"24"}}},{"identifier":"video_type","name":"Video type","desc":"Video lens type, for example, normal/wide/zoom/ir","dataType":{"type":"text","specs":{"length":"24"}}},{"identifier":"switchable_video_types","name":"Supported video lens type list of video stream: 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 livestreaming

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: live_start_push

Data:

ColumnNameTypeconstraintDescription
url_typeLivestream protocol typeenum{"0":"Agora","1":"RTMP","3":"GB28181"}
urlLivestream parametertext{}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 声网AGORA:(channel&sn&token&uid) Example: channel=1ZNDH360010162_39-0-7&sn=1ZNDH360010162&token=006dca67721582a48768ec4d817b7b25a86IAB4cw2JgN6iX8BpTPdc3e4S1Iendz94IFJ56aSXKvzAJei27MqF2zyCIgCLIIoBt41+YAQAAQC3jX5gAgC3jX5gAwC3jX5gBAC3jX5g&uid=50000 Notice: The token generated by Shengwang may have special characters such as '+' ' ', and need to do url encode, otherwise there will be a parsing error on the PILOT side
video_idLivestream video stream ID numberingtext{}The format is #{uav_sn}/#{camera_id}/#{video_index}, drone serial number/payload and mounted location enumeration value/payload lens numbering
video_qualityLivestream qualityenum{"0":"Custom","1":"Smooth","2":"Standard Definition(SD)","3":"High Definition(HD)","4":"Ultra High Definition(UHD)"}The resolutions and bitrates for different video quality are as follows: Smooth: 960 * 540, 512Kbps; Standard Definition: 1280 * 720, 1Mbps; High Definition: 1280 * 720, 1.5Mbps; Ultra High Definition: 1920 * 1080, 3Mbps.

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp:": 1654070968655,
	"method": "live_start_push",
	"data": {
		"url_type": 0,
		"url": "channel=1ZNDH1D0010098_39-0-7&sn=1ZNDH1D0010098&token=006dca67721582a48768ec4d817b7b25a86IADk%2Fcm%2Fdv%2BHY6qT%2FAKM6y7TcUe4lXNvZpycH7vUMAlM6pFALUKF2zyCIgA82pQE8cCoYAQAAQDxwKhgAgDxwKhgAwDxwKhgBADxwKhg&uid=50000",
		"video_id": "1ZNDH1D0010098/39-0-7/normal-0",
		"video_quality": 0
	}
}

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 livestreaming

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: live_stop_push

Data:

ColumnNameTypeconstraintDescription
video_idLivestream video stream ID numberingtext{}The format is #{uav_sn}/#{camera_id}/#{video_index}, drone serial number/payload and mounted location enumeration value/payload lens numbering

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp:": 1654070968655,
	"method": "live_stop_push",
	"data": {
		"video_id": "1ZNDH1D0010098/42-0-0/zoom-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 livestream quality

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: live_set_quality

Data:

ColumnNameTypeconstraintDescription
video_idLivestream video streamtext{}The format is #{uav_sn}/#{camera_id}/#{video_index}, drone serial number/payload and mounted location enumeration value/payload lens numbering
video_qualityLivestream qualityenum{"0":"Custom","1":"Smooth","2":"Standard Definition(SD)","3":"High Definition(HD)","4":"Ultra High Definition(UHD)"}The resolutions and bitrates for different video quality are as follows: Smooth: 960 * 540, 512Kbps; Standard Definition: 1280 * 720, 1Mbps; High Definition: 1280 * 720, 1.5Mbps; Ultra High Definition: 1920 * 1080, 3Mbps.

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 livestream lens

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: live_lens_change

Data:

ColumnNameTypeconstraintDescription
video_idID of the live video streamtext{}The format is #{uav_sn}/#{camera_id}/#{video_index}. Aircraft serial number/Enumeration value of payloads and mounted location/Lens number of payload
video_typeLens type of live video streamenum{"normal":"default","wide":"wide","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
	}
}
If you have any comments or confusion about our documentation, you can click here to give feedback and we will get back to you as soon as possible.