创建视频源
功能介绍
创建视频源。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
POST /v2/{project_id}/source
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
project_id |
是 |
String |
用户项目ID,获取方法参见获取项目ID和名称。 |
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
X-Auth-Token |
是 |
String |
用户Token,获取方法参见认证鉴权。 |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
video_source_name |
是 |
String |
视频源名称,只支持中文、英文字母(a-z,A-Z)、数字、特殊字符(空格.-_() ()),不能以空格开头和结尾,长度范围[1,100]。 |
|
access_type |
是 |
String |
接入类型。
|
|
type |
是 |
String |
类型。
|
|
latitude |
否 |
String |
视频源的地理位置信息,纬度,-90.00000~90.00000。 |
|
longitude |
否 |
String |
视频源的地理位置信息,经度,-180.00000~180.00000。 |
|
video_group_ids |
否 |
Array of strings |
系统中所有的视频源分组,只能由小写英文字母(a~z)、数字(0~9)、中划线(-)、下划线(_)组成, 长度范围为[4, 36]。 |
|
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]。 |
响应参数
状态码:200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
video_source_id |
String |
视频源id。 |
状态码:400
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error_code |
String |
错误码。 |
|
error_msg |
String |
错误信息描述。 |
|
detail |
String |
错误详情。 |
|
params |
Array of strings |
错误参数列举。 |
|
reason |
String |
错误原因。 |
|
advice |
String |
建议。 |
状态码:500
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
error_code |
String |
错误码。 |
|
error_msg |
String |
错误信息描述。 |
|
detail |
String |
错误详情。 |
|
params |
Array of strings |
错误参数列举。 |
|
reason |
String |
错误原因。 |
|
advice |
String |
建议。 |
请求示例
创建视频源请求体
/v2/{project_id}/source/sources/{video_source_id}
{
"video_source_name" : "url_test",
"access_type" : "cloud",
"type" : "url",
"longitude" : "",
"latitude" : "",
"tag" : [ ],
"video_group_ids" : [ ],
"type_config" : "<type_config> <url_address>rtsp://12.12.12.12:333</url_address> </type_config>"
}
响应示例
状态码:200
视频源信息。
{
"video_source_id" : "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx"
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
视频源信息。 |
|
400 |
参数错误。 |
|
500 |
内部错误。 |