媒体管理
接口变更说明
✓ 提供该接口,— 未提供。未列出的接口 EVO Nest 与 Autel Nest2 一致。
| Method | 功能 | EVO Nest | Autel Nest2 | 说明 |
|---|---|---|---|---|
file_cancel | 取消文件上传 | — | ✓ |
媒体文件上传结果上报
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: file_upload_callback
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | 上传结果 | int | 固定为 0,表示文件上传成功 | |
| file | 文件信息 | struct | 媒体文件信息 | |
| »object_key | 文件在对象存储桶的 Key | text | 文件在对象存储桶中的Key | |
| »path | 文件的业务路径 | text | 文件的业务路径 | |
| »name | 文件名称 | text | 文件名称 | |
| »file_size | 文件大小 | text | 文件字节数,字符串形式;无法获取时不上报 | |
| »width | 文件宽度 | int | 像素,大于 0 时上报 | |
| »height | 文件高度 | int | 像素,大于 0 时上报 | |
| »ext | 文件扩展内容 | struct | 文件的扩展元数据 | |
| »»even_id | 关联拍摄事件ID | array_text | 字符串数组 | |
| »»flight_id | 任务 ID | text | 关联的航线任务ID | |
| »»drone_sn | 无人机序列号 | text | 拍摄该文件的无人机序列号 | |
| »»drone_model_key | 无人机产品枚举值 | text | 拍摄该文件的无人机产品枚举值 | |
| »»payload_model_key | 负载产品枚举值 | text | 拍摄该文件的负载产品枚举值 | |
| »»is_original | 是否为原图 | int | {"0":"否","1":"是"} | 是否为原始未压缩图片 |
| »metadata | 媒体元数据 | struct | 媒体文件的元数据信息 | |
| »»gimbal_yaw_degree | 云台偏航角 | double | 拍摄时云台偏航角 | |
| »»absolute_altitude | 拍摄绝对高度 | float | 拍摄时的海拔高度 | |
| »»relative_altitude | 拍摄相对高度 | float | 拍摄时的相对高度 | |
| »»create_time | 媒体拍摄时间 | date | {"format":"iso8601"} | 媒体文件创建时间 |
| »»duration | 媒体时长 | int | {"unit_name":"秒 / s"} | 视频时长,照片为 0 |
| »»file_type | 文件类型 | enum_int | {"0":"jpg","1":"mov","2":"mp4","3":"m4a","4":"dng"} | 媒体文件类型 |
| »»image_type | 图像类型 | enum_int | {"0":"广角","1":"变焦","2":"红外","3":"夜视"} | 图像通道类型 |
| »»shoot_position | 拍摄位置 | struct | 拍摄位置坐标 | |
| »»»lat | 拍摄位置纬度 | float | 拍摄位置纬度 | |
| »»»lng | 拍摄位置经度 | float | 拍摄位置经度 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"file": {
"ext": {
"drone_model_key": "0-4",
"drone_sn": "xxxxxxxxxx",
"flight_id": "xxx",
"is_original": 1,
"payload_model_key": "0-4",
"even_id": ["1", "2"]
},
"metadata": {
"absolute_altitude": 56.311,
"create_time": "2024-01-10 16:04:20",
"duration": 0,
"file_type": 0,
"gimbal_yaw_degree": 0,
"image_type": 1,
"relative_altitude": 41.124,
"shoot_position": {
"lat": 22.1,
"lng": 144.5
}
},
"name": "dog.jpeg",
"object_key": "object_key",
"path": "xxx"
},
"result": 0
},
"gateway": "xxx",
"need_reply": 1,
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1709192149431,
"method": "file_upload_callback"
}
Requests
获取上传临时凭证
Topic: thing/product/{gateway_sn}/requests
Direction: up
Method: storage_config_get
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| module | 模块枚举值 | enum_int | {"0":"媒体"} | 存储配置的功能模块标识 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"module": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1709192149431,
"method": "storage_config_get"
}
Topic: thing/product/{gateway_sn}/requests_reply
Direction: down
Method: storage_config_get
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 | |
| output | 输出 | struct | 存储配置的返回结果 | |
| »bucket | 对象存储桶名称 | text | 对象存储桶名称 | |
| »credentials | 凭证信息 | struct | 临时访问凭证 | |
| »»access_key_id | 访问密钥 ID | text | 临时 Access Key ID | |
| »»access_key_secret | 秘密访问密钥 | text | 临时 Access Key Secret | |
| »»expire | 访问密钥过期时间 | int | {"step":"1","unit_name":"秒 / s"} | 凭证过期时间 |
| »»security_token | 会话凭证 | text | 安全令牌 | |
| »endpoint | 对外服务的访问域名 | text | 对象存储服务端点地址 | |
| »provider | 云厂商枚举值 | enum_string | {"s3":"S3 协议兼容存储","aws":"亚马逊云","amazon":"亚马逊云","minio":"minio","ali":"阿里云","oss":"阿里云对象存储","cos":"腾讯云对象存储","qcloud":"腾讯云","obs":"华为云对象存储","huawei":"华为云"} | 云存储厂商类型 |
| »region | 数据中心所在的地域 | text | 存储桶所在区域 | |
| »object_key_prefix | 对象存储桶的 Key 的前缀 | text | 文件上传的Key前缀 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"output": {
"bucket": "bucket_name",
"credentials": {
"access_key_id": "access_key_id",
"access_key_secret": "access_key_secret",
"expire": 3600,
"security_token": "security_token"
},
"endpoint": "https://oss-cn-hangzhou.aliyuncs.com",
"object_key_prefix": "b4cfaae6-bd9d-4cd0-8472-63b608c3c581",
"provider": "ali",
"region": "hz"
},
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1709192149431,
"method": "storage_config_get"
}
任务文件上传状态上报
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: file_upload_status
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| tasks | 任务列表 | array | 任务信息数组 | |
| »flight_id | 任务ID | text | 关联的航线任务ID | |
| »total_video_files | 视频文件总数量 | int | 本次任务的视频文件总数 | |
| »uploaded_video_files | 已上传完成视频文件数量 | int | 已上传完成的视频文件数 | |
| »total_photo_files | 照片文件总数量 | int | 本次任务的照片文件总数 | |
| »uploaded_photo_files | 已上传照片数量 | int | 已上传完成的照片文件数 | |
| »status | 上传状态 | enum_int | {"0":"待上传","1":"上传完成","2":"上传中","4":"上传失败"} | 文件上传整体状态 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"tasks": [
{
"flight_id": "flight_123456",
"total_video_files": 10,
"uploaded_video_files": 0,
"total_photo_files": 10,
"uploaded_photo_files": 10,
"status": 0
},
{
"flight_id": "flight_123457",
"total_video_files": 10,
"uploaded_video_files": 0,
"total_photo_files": 10,
"uploaded_photo_files": 10,
"status": 1
},
{
"flight_id": "flight_123458",
"total_video_files": 10,
"uploaded_video_files": 0,
"total_photo_files": 10,
"uploaded_photo_files": 10,
"status": 2
}
]
},
"gateway": "xxx",
"need_reply": 1,
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1709192149431,
"method": "file_upload_status"
}
删除任务文件
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: file_delete
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| flight_id | 任务 ID | text | 需删除文件的航线任务ID |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"flight_id": "xxxxxxx"
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "file_delete"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: file_delete
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "file_delete"
}
重新上传任务文件
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: file_reupload
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| flight_id | 任务 ID | text | 需重新上传的航线任务ID |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"flight_id": "xxxxxxx"
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "file_reupload"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: file_reupload
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "file_reupload"
}
取消文件上传
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: file_cancel
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| files | 文件列表 | array | 需取消上传的文件列表 | |
| »file_path | 文件路径 | text | 文件完整路径,必填 | |
| »file_name | 文件名称 | text | 文件名称,可选 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"files": [
{
"file_name": "IMG_0001.JPG",
"file_path": "/media/xxxxxxx/IMG_0001.JPG"
}
]
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "file_cancel"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: file_cancel
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "file_cancel"
}