直播功能

2023-10-08
暂无评分

State

直播能力更新

Topic: thing/product/{device_sn}/state

Direction: up

Data:

ColumnNameTypeconstraintDescription
live_capacity直播能力struct
»available_video_number可用于直播的视频流总数int{}表明飞机或设备所拥有的所有可用于直播视频流的总数
»coexist_video_number_max可同时进行直播的最大视频流总数int{}
»device_list子设备列表array{}
»»[array_item]Elements in arraystruct{}{"size": "2"}
»»»sn设备序列号text{"length":"10240"}
»»»available_video_number可用于直播的视频流总数int{}表明飞机或设备所拥有的所有可用于直播视频流的总数
»»»coexist_video_number_max可同时进行直播的最大视频流总数int{}
»»»camera_list该设备上的相机列表array{"item":{"type":"struct","specs":[{"identifier":"camera_index","name":"相机索引,由类型枚举值和云台位置编号组成","dataType":{"type":"text","specs":{"length":"24"}}},{"identifier":"available_video_number","name":"可用于直播的视频流总数","desc":"表明该相机可用于直播视频流的总数","dataType":{"type":"int","specs":{}}},{"identifier":"coexist_video_number_max","name":"该相机可同时进行直播的最大视频流总数","dataType":{"type":"int","specs":{}}},{"identifier":"video_list","name":"视频流列表","dataType":{"type":"array","specs":{"item":{"type":"struct","specs":[{"identifier":"video_index","name":"视频索引","dataType":{"type":"text","specs":{"length":"24"}}},{"identifier":"video_type","name":"视频类型","desc":"表明视频镜头的类型,如normal/wide/zoom/ir等","dataType":{"type":"text","specs":{"length":"24"}}},{"identifier":"switchable_video_types","name":"该视频流支持切换的视频镜头类型列表: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

开始直播

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: live_start_push

Data:

ColumnNameTypeconstraintDescription
url_type直播协议类型enum{"0":"声网Agora","1":"RTMP","3":"GB28181"}
url直播参数text{}RTMP: (rtmp://xxxxxxx)示例:rtmp://192.168.1.1:8080/live GB28181:(serverIP&serverPort&serverID&agentID&agentPassword&localPort&channel) 示例: serverIP=192.168.1.1&serverPort=8080&serverID=34000000000000000000&agentID=300000000010000000000&agentPassword=0000000&localPort=7060&channel=340000000000000000000 声网AGORA:(channel&sn&token&uid) 示例: channel=1ZNDH360010162_39-0-7&sn=1ZNDH360010162&token=006dca67721582a48768ec4d817b7b25a86IAB4cw2JgN6iX8BpTPdc3e4S1Iendz94IFJ56aSXKvzAJei27MqF2zyCIgCLIIoBt41+YAQAAQC3jX5gAgC3jX5gAwC3jX5gBAC3jX5g&uid=50000 注意:声网生成的token可能带有'+' ' '等特殊字符,需要做一次url encode,不然PILOT端会出现解析错误的情况
video_id直播视频流的ID编号text{}格式为 #{uav_sn}/#{camera_id}/#{video_index};飞机SN号/负载及挂载位置枚举值/负载lens编号
video_quality直播质量enum{"0":"自适应","1":"流畅","2":"标清","3":"高清","4":"超清"}不同清晰度的分辨率与码率分别为,流畅:960 * 540、512Kbps,标清:1280 * 720、1Mbps,高清:1280 * 720、1.5Mbps,超清: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
	}
}

停止直播

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: live_stop_push

Data:

ColumnNameTypeconstraintDescription
video_id直播视频流的ID编号text{}格式为 #{uav_sn}/#{camera_id}/#{video_index};飞机SN号/负载及挂载位置枚举值/负载lens编号

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

设置直播清晰度

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: live_set_quality

Data:

ColumnNameTypeconstraintDescription
video_id直播视频流的IDtext{}格式为 #{uav_sn}/#{camera_id}/#{video_index};飞机SN号/负载及挂载位置枚举值/负载lens编号
video_quality直播质量enum{"0":"自适应","1":"流畅","2":"标清","3":"高清","4":"超清"}不同清晰度的分辨率与码率分别为,流畅:960 * 540、512Kbps,标清:1280 * 720、1Mbps,高清:1280 * 720、1.5Mbps,超清: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
	}
}

设置直播镜头

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: live_lens_change

Data:

ColumnNameTypeconstraintDescription
video_id直播视频流的IDtext{}格式为 #{uav_sn}/#{camera_id}/#{video_index};飞机SN号/负载及挂载位置枚举值/负载lens编号
video_type直播视频流镜头类型enum{"normal":"默认","wide":"广角","zoom":"变焦","ir":"红外"}

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
	}
}
若您对文档有意见或疑惑,点击可快速反馈,我们会与您联系。