查询录像列表

最近更新时间:2026-03-19 18:16:28

天翼云智能视图服务API

1.查询录像列表

接口功能介绍

本接口用于查询设备录制于云端的录像文件列表,PlayUrl可用于点播该文件。

接口约束

URI

GET /devices/{DeviceId}/records

路径参数

参数是否必填参数类型说明示例下级对象
DeviceIdString设备ID。719340484461969408

Query参数

参数是否必填参数类型说明示例下级对象
OutNetworkString播放网络类型,默认internet。取值:internet:互联网;vpn:视频专网。internet
RecordSourceString录像来源。取值:cloud:默认云端;local:设备侧录像(仅国标设备支持)。cloud
RecordTypeInteger根据录制类型查询,取值:-1:所有录制类型;1:全天录制(按需计费);2:循环定时录制(按需计费);3:指定时间录制(按需计费);5:手动录制(按需计费);6:全天录制(资源包计费)。1
StartTimeString根据开始时间查询,小于结束时间,格式:yyyy-mm-dd HH:MM:SS。2023-05-06 00:00:00
EndTimeString根据结束时间查询,大于开始时间,格式:yyyy-mm-dd HH:MM:SS。2023-05-07 00:00:00
SortByString选择按一个字段排序。取值:StartTime:开始时间。StartTime
SortDirectionString排序方式,默认升序。取值:asc(升序),desc(降序)。asc
PageNumInteger第几个分页,默认为1。该字段仅在查询云端录像时有效。1
PageSizeInteger分页大小,默认为20,取值范围为1~1000。该字段仅在查询云端录像时有效。50

请求参数

请求头header参数

参数是否必填参数类型说明示例下级对象
AuthorizationString认证信息。CT-HMAC-SHA256 Credential=FQ01GA2RR9IJFM1PWIPR/2023-07-18/vss, SignedHeaders=content-type;host;timestamp, Signature=c6e72dffcfb2d25d276e119781e1deb6656d966702191b2bd862d1691e39394f
Content-TypeString互联网媒体类型。application/json;charset=utf-8
HostString主机。vssapi.ctyun.cn
VersionString版本。2021-11-25
TimestampString时间戳。1689643309

请求体body参数

响应参数

参数参数类型说明示例下级对象
statusCodeInteger响应状态码。200
errorString错误码,执行成功时,不返回该字段。VSS_0001
messageString响应信息。请求成功
requestIdString请求ID。362d4e78556b47129182d0881fade86b
returnObjObject响应数据,执行失败时,不返回该字段。returnObj

表 returnObj

参数参数类型说明示例下级对象
DeviceIdString设备ID。719340484461969408
RecordsArray of Objects录制文件列表。Record
PageNumInteger第几个分页。1
PageSizeInteger分页大小。10
TotalPageInteger分页总数。1
TotalNumInteger录制文件总数。10
RequestIdString请求ID。b537b9e84f8c4adfb46bfd95df26d14b

表 Record

参数参数类型说明示例下级对象
RecordIdString录制文件Id,该录制文件的唯一性标识。725052043643404288
FileFormatString录制文件格式。取值:m3u8,hls,mp4,ps。hls
FileDurationInteger录制文件时长,单位秒。1812
FileSizeInteger录制文件大小,单位字节。39125432
CoverUrlString封面Url。http://example.ctyun.cn/example
StartTimeString录制文件开始时间。2023-05-06 08:42:49
EndTimeString录制文件结束时间。2023-05-06 09:13:01
AudioObject音频属性信息。Audio
VideoObject视频属性信息。Video
PlayUrlObject录制文件点播Url。PlayUrl

表 Audio

参数参数类型说明示例下级对象
CodecString编码格式,取值:g711a,aac,opus,mp3。aac

表 Video

参数参数类型说明示例下级对象
CodecString编码格式,取值:h264,h265。h265

表 PlayUrl

参数参数类型说明示例下级对象
HlsUrlStringhls播放url。FileFormat值为hls时,该字段有效。http://example.ctyun.cn/example
PsUrlStringps播放url。FileFormat值为ps时,该字段有效。http://example.ctyun.cn/example

请求示例

请求url

GET '/devices/719340484461969408/records?EndTime=2023-05-06+10%3A00%3A00&RecordType=-1&StartTime=2023-05-06+08%3A00%3A00'

请求头header

{
    "Authorization": "CT-HMAC-SHA256 Credential=FVAQ9J9SQXS3P37SXDPT/2023-05-06/vss, SignedHeaders=content-type;host;timestamp, Signature=b30e6014ba6f769711780fdc912d4783167c4c1a1b87803b081e2ec8478eeb8e",
    "Content-Type": "application/json;charset=utf-8",
    "Host": "vssapi.ctyun.cn",
    "Version": "2021-11-25",
    "Timestamp": "1683354940"
}

请求体body

响应示例

{
  "statusCode": 200,
  "message": "请求成功",
  "requestId": "b537b9e84f8c4adfb46bfd95df26d14b",
  "returnObj": {
    "DeviceId": "719340484461969408",
    "PageNum": 1,
    "PageSize": 5,
    "TotalPage": 5,
    "TotalNum": 25,
    "Records": [
      {
        "RecordId": "725052043643404288",
        "FileFormat": "hls",
        "Audio": {
          "Codec": "aac"
        },
        "Video": {
          "Codec": "h265"
        },
        "PlayUrl": {
          "HlsUrl": "http://example.ctyun.cn/example",
          "PsUrl": ""
        },
        "StartTime": "2023-05-06 08:42:49",
        "EndTime": "2023-05-06 09:13:01",
        "FileDuration": "1812",
        "CoverUrl": "http://example.ctyun.cn/example",
        "FileSize": "39125432"
      },
      {
        "RecordId": "725059053030031360",
        "FileFormat": "hls",
        "Audio": {
          "Codec": ""
        },
        "Video": {
          "Codec": "h265"
        },
        "PlayUrl": {
          "HlsUrl": "http://example.ctyun.cn/example",
          "PsUrl": ""
        },
        "StartTime": "2023-05-06 09:13:02",
        "EndTime": "2023-05-06 09:26:38",
        "FileDuration": "816",
        "CoverUrl": "http://example.ctyun.cn/example",
        "FileSize": "17653764"
      },
      {
        "RecordId": "725059499706630144",
        "FileFormat": "hls",
        "Audio": {
          "Codec": ""
        },
        "Video": {
          "Codec": "h265"
        },
        "PlayUrl": {
          "HlsUrl": "http://example.ctyun.cn/example",
          "PsUrl": ""
        },
        "StartTime": "2023-05-06 09:27:05",
        "EndTime": "2023-05-06 09:27:30",
        "FileDuration": "25",
        "CoverUrl": "http://example.ctyun.cn/example",
        "FileSize": "529220"
      },
      {
        "RecordId": "725062145406484480",
        "FileFormat": "hls",
        "Audio": {
          "Codec": ""
        },
        "Video": {
          "Codec": "h265"
        },
        "PlayUrl": {
          "HlsUrl": "http://example.ctyun.cn/example",
          "PsUrl": ""
        },
        "StartTime": "2023-05-06 09:31:32",
        "EndTime": "2023-05-06 09:32:36",
        "FileDuration": "64",
        "CoverUrl": "http://example.ctyun.cn/example",
        "FileSize": "1373528"
      },
      {
        "RecordId": "725064722386862080",
        "FileFormat": "hls",
        "Audio": {
          "Codec": ""
        },
        "Video": {
          "Codec": "h265"
        },
        "PlayUrl": {
          "HlsUrl": "http://example.ctyun.cn/example",
          "PsUrl": ""
        },
        "StartTime": "2023-05-06 09:36:32",
        "EndTime": "2023-05-06 09:37:36",
        "FileDuration": "64",
        "CoverUrl": "http://example.ctyun.cn/example",
        "FileSize": "1366760"
      }
    ],
    "RequestId": "b537b9e84f8c4adfb46bfd95df26d14b",
    "RecordType": 0
  }
}

状态码

请参考状态码说明。

错误码

请参考错误码说明。