更新时间:2025-11-19 GMT+08:00
分享

获取视频源列表

功能介绍

获取视频源列表。

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v2/{project_id}/source/sources

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

用户项目ID,获取方法参见获取项目ID和名称

表2 Query参数

参数

是否必选

参数类型

描述

scope

String

模糊查找参数,可选,根据名称查找。长度范围[0,255]。

scope_name

String

模糊查找参数字段名,可选,名称(取值source_name)或分组名称(取值group_name)。

status

Array of strings

视频源状态,可选,取值为1 2 9,分别代表在线、离线、异常。

type

Array of strings

视频源类型列表。视频源类型:

  • ivm

  • restful

  • url

  • vcn

  • obs

  • camera

  • vcn_restful

video_group_id

Array of strings

视频源分组,可选。若传入则需要符合正则表达式^[0-9a-zA-Z-_]{1,36}$。

sort_name

String

排序项。可选,值范围(create_at,num_task,num_template)。默认create_at。

order_by

String

排序顺序,可选asc(正序)、desc(倒序),默认倒序。

is_paged

Boolean

是否分页。

page_size

Integer

分页每页显示的条目。取值范围[5,200],默认10。

page_num

Integer

第几页,取值范围[1,100000],默认1。

access_type

Array of strings

接入方式。

platform_name

String

平台名称。

tag

String

标签。

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token,获取方法参见认证鉴权

响应参数

状态码:200

表4 响应Body参数

参数

参数类型

描述

video_source_number

Integer

视频源数量。

total_number

Integer

视频源总数。

quota_number

Integer

视频源限额。

video_source_list

Array of ListVideoSourceInfoDto objects

视频源列表数据。

表5 ListVideoSourceInfoDto

参数

参数类型

描述

video_source_id

String

已创建成功的视频源id。

video_source_name

String

视频源名称,只支持中文、英文字母(a-z,A-Z)、数字、特殊字符(空格.-_() ()),不能以空格开头和结尾

最小长度:1

最大长度:100

status

VideoSourceStatusInfoDto object

视频源状态。

access_type

String

接入类型(cloud、edge)。

type

String

类型:obs、vcn、url、restful、camera。

latitude

String

视频源的地理位置信息,纬度,-90.00000~90.00000。

longitude

String

视频源的地理位置信息,经度,-180.00000~180.00000。

create_at

Long

创建时间。

video_packages

Array of VideoGroupInfoDto objects

视频源所在分组。

num_tasks

Integer

视频源已运行算法作业数量。

num_service_config_templates

Integer

视频源算法服务配置模板数量。

type_config

String

视频源配置信息xml,长度范围[1,1024]。

url形式:

<type_config>
  <url_address></url_address>
</type_config>

vcn形式:

<type_config>
  <data_source_id></data_source_id>
  <stream_type></stream_type>
  <ip></ip>
  <port></port>
  <user_name></user_name>
  <password></password>
</type_config>

restful形式:

<type_config>
  <http_check></http_check>
  <url></url>
  <rtsp_url></rtsp_url>
</type_config>

ivm形式:

<type_config>
  <device_id></device_id>
  <channel_id></channel_id>
</type_config>

obs形式:

<type_config>
  <bucket></bucket>
  <path></path>
</type_config>

camera形式:

<type_config>
  <device_id></device_id>
  <name></name>
</type_config>

vcn_restful形式:

<type_config>
  <data_source_id></data_source_id>
  <stream_type></stream_type>
  <ip></ip>
  <port></port>
  <user_name></user_name>
  <password></password>
  <vcn_protocol>restful</vcn_protocol>
</type_config>

tag

Array of strings

视频源标签,标签最多选择4个,标签内容只能由中文, 英文字母(a~z, A~Z)、数字(0~9)、中划线(-)、下划线(_)组成,

最小长度:1

最大长度:10

stream_path

String

流地址。

scene_recommend

Array of strings

智能算法推荐的标签。

video_source_quality

Array of strings

视频源的视频流质量:

  • Blurry:画面模糊。

  • ColorDistortion:画面颜色失真。

  • AbnormalLight:画面光线异常。

  • ScreenSplash:画面花屏异常。

  • ScreenJitter:画面抖动。

  • ScreenMovement:画面移动。

  • SceneUpheaval:画面剧变。

  • ScreenFreeze:画面冻结。

  • BlackScreen:黑屏。

  • SnowNoise:雪花噪声。

  • Occlude:遮挡。

  • GrayScreen:灰屏。

  • ScreenSmudge:画面污迹。

表6 VideoSourceStatusInfoDto

参数

参数类型

描述

status

String

视频源状态:

  • Online:在线。

  • Offline:离线。

  • exception:异常。

name

String

状态中文名。

level

String

状态等级(用于前端图片颜色匹配)。

表7 VideoGroupInfoDto

参数

参数类型

描述

video_group_id

String

视频源所在分组id。

video_group_name

String

视频源所在分组名称。

description

String

视频源所在分组描述。

access_type

String

接入类型。

  • cloud:云上。

  • edge: 边缘。

create_at

Long

创建时间。

modify_at

Long

修改时间。

num_video_source

Integer

视频源数量。

group_status

GroupStatusDto object

视频源状态。

num_batch_task

Integer

已配置批量作业数量。

表8 GroupStatusDto

参数

参数类型

描述

num_online

Integer

在线视频源数量。

num_exception

Integer

异常视频源数量。

num_offline

Integer

离线视频源数量。

状态码:400

表9 响应Body参数

参数

参数类型

描述

error_code

String

错误码。

error_msg

String

错误信息描述。

detail

String

错误详情。

params

Array of strings

错误参数列举。

reason

String

错误原因。

advice

String

建议。

状态码:500

表10 响应Body参数

参数

参数类型

描述

error_code

String

错误码。

error_msg

String

错误信息描述。

detail

String

错误详情。

params

Array of strings

错误参数列举。

reason

String

错误原因。

advice

String

建议。

请求示例

获取视频源列表,展示出账户下的所有视频源信息。

v2/{project_id}/source/sources

https://{endpoint}/v2/{project_id}/source/sources?is_paged=true&page_size=10&page_num=1&scope_name=source_name

响应示例

状态码:200

视频源列表响应体。

{
  "video_source_number" : 230,
  "total_number" : 230,
  "quota_number" : 5000,
  "video_source_list" : [ {
    "video_source_id" : "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx",
    "video_source_name" : "url_test",
    "status" : {
      "status" : "Online",
      "name" : "在线",
      "level" : "1"
    },
    "access_type" : "cloud",
    "type" : "url",
    "latitude" : "",
    "longitude" : "",
    "create_at" : 1680772763191,
    "video_packages" : [ ],
    "num_tasks" : 0,
    "num_service_config_templates" : 0,
    "type_config" : "<type_config>        <url_address>rtsp://12.12.12.12:333</url_address>      </type_config>",
    "tag" : [ ],
    "stream_path" : "rtsp://12.12.12.12:333",
    "device_id" : "1680772763191",
    "scene_recommend" : [ ],
    "video_source_quality" : [ ]
  } ]
}

状态码

状态码

描述

200

视频源列表响应体。

400

参数错误。

500

内部错误。

相关文档