Updated on 2024-04-22 GMT+08:00

Modifying a Video Source

Function

This API is used to modify video sources.

URI

PUT /v2/{project_id}/source/{video_source_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID and Name.

Maximum: 64

video_source_id

Yes

String

ID of a created video source. The value is a string of 4 to 36 characters consisting of only lowercase letters, digits, hyphens (-), and underscores (_).

Maximum: 36

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. For details about how to obtain a user token, see Authentication.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

video_source_name

Yes

String

Video source name. The value can contain only letters, digits, spaces, and the following special characters: .-_(). It cannot start or end with a space.

Minimum: 0

Maximum: 100

latitude

No

String

Latitude of the video source. The value ranges from -90.00000 to 90.00000.

longitude

No

String

Longitude of the video source. The value ranges from -180.00000 to 180.00000.

type_config

Yes

String

XML file of video source configuration information URL format: <type>URL</type> <config> <URL_ADDRESS></URL_ADDRESS> </config> VCN format: <type>VCN</type> <config> <DATA_SOURCE_ID></DATA_SOURCE_ID> <STREAM_TYPE></STREAM_TYPE> <IP></IP> <PORT></PORT> <USER_NAME></USER_NAME> <PASSWORD></PASSWORD> </config> RESTful format: <type>RESTFUL</type> <config> <HTTP_CHECK></HTTP_CHECK> <URL></URL> <RTSP_URL></RTSP_URL> </config> Camera format: <type>CAMERA</type> <config> <EDGE_CAMERA_ID></EDGE_CAMERA_ID> </config>

Maximum: 1024

tag

No

Array of strings

Video source tag. A maximum of four tags can be selected. Only letters, digits, hyphens (-), and underscores (_) are allowed. Minimum length: 1 character Maximum length: 10 characters

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

video_source_name

String

Video source name. The value can contain only letters, digits, spaces, and the following special characters: .-_(). It cannot start or end with a space. Minimum length: 1 character Maximum length: 100 characters

access_type

String

Access type, which can be cloud or edge.

status

VideoSourceStatusInfoDto object

Data source status

type

String

Type: obs, vcn, url, restful, and camera

latitude

String

Latitude of the video source. The value ranges from -90.00000 to 90.00000.

longitude

String

Longitude of the video source. The value ranges from -180.00000 to 180.00000.

create_at

Long

Creation time

type_config

String

XML file of video source configuration information

video_packages

Array of VideoGroupInfoDto objects

Group to which the video source belongs

service_config_templates

Array of VideoServiceConfigTemplateDto objects

Algorithm template body

stream_path

String

Stream address

image

String

Base64-encoded video source snapshot

tag

Array of strings

Video source tag. A maximum of four tags can be selected. Only letters, digits, hyphens (-), and underscores (_) are allowed. Minimum length: 1 character Maximum length: 10 characters

scene_recommend

Array of strings

Tags recommended by an intelligent algorithm

video_source_quality

Array of strings

Video source quality. Blurry: blurry image; ColorDistortion: color distortion; AbnormalLight: abnormal image light; ScreenSplash: image artifact; ScreenJitter: image jitter; ScreenMovement: image movement; SceneUpheaval: image upheaval; ScreenFreeze: image freezing; BlackScreen: black screen; SnowNoise: static noise; Occlude: blocking; GrayScreen: gray screen; ScreenSmudge: screen smudge

Table 5 VideoSourceStatusInfoDto

Parameter

Type

Description

status

String

Video source status

name

String

Status name

level

String

Status level (used for color matching of frontend images)

Table 6 VideoGroupInfoDto

Parameter

Type

Description

video_group_id

String

ID of the group to which the video source belongs

video_group_name

String

Name of the group to which the video source belongs

description

String

Description of the group to which the video source belongs

access_type

String

Access type, which can be cloud or edge.

create_at

Long

Creation time

modify_at

Long

Modification time

num_video_source

Integer

Number of video resources

group_status

GroupStatusDto object

Video source status

num_batch_task

Integer

Number of configured batch tasks

Table 7 GroupStatusDto

Parameter

Type

Description

num_online

Integer

Number of online video sources

num_exception

Integer

Number of abnormal video sources

num_offline

Integer

Number of offline video sources

Table 8 VideoServiceConfigTemplateDto

Parameter

Type

Description

name

String

Algorithm service name

roi

String

Public ROI

serviceConfig

String

Common configuration of algorithm services

createAt

Long

Creation time

modifyAt

Long

Modification time

numTask

Integer

Number of running algorithms

Example Requests

Request body for modifying a video source

/v2/{project_id}/source/{video_source_id}

{
  "video_source_name" : "url_test",
  "access_type" : "cloud",
  "type" : "url",
  "longitude" : "",
  "latitude" : "",
  "tag" : [ "1" ],
  "video_group_ids" : [ ],
  "type_config" : "<type_config>        <url_address>rtsp://12.12.12.12:333</url_address>      </type_config>"
}

Example Responses

Status code: 200

Response body for updating a video source

{
  "video_source_name" : "url_test",
  "access_type" : "cloud",
  "status" : {
    "status" : "Online",
    "name" : "Online",
    "level" : "1"
  },
  "type" : "url",
  "latitude" : "",
  "longitude" : "",
  "create_at" : 1680772763191,
  "type_config" : "<type_config>        <url_address>rtsp://12.12.12.12:333</url_address>      </type_config>",
  "stream_path" : "rtsp://12.12.12.12:333",
  "tag" : [ "1" ],
  "device_id" : "1680772763191",
  "scene_recommend" : [ ],
  "video_source_quality" : [ ]
}

Status Codes

Status Code

Description

200

Response body for updating a video source

Error Codes

See Error Codes.