此接口支持通过 TemplateId
模板 ID,获取任务模板。
请求说明
- 接口名称:GetTaskTemplate
- 接口地址:https://vod.volcengineapi.com?Action=GetTaskTemplate&Version=2023-07-01
请求参数
参数 | 类型 | 是否必选 | 描述 |
---|
Action | String | 是 | 接口名称。当前接口取值为 GetTaskTemplate 。 |
Version | String | 是 | 接口版本。当前接口取值为 2023-07-01 。 |
TemplateId | String | 否 | 模板 ID。 |
返回参数
参数 | 类型 | 描述 |
---|
RequestId | String | 请求 ID |
Action | String | 请求接口 |
Version | String | 版本 |
Service | String | 服务 |
Region | String | 区域 |
Error | ResponseError | 异常信息 |
ResponseError
参数 | 类型 | 描述 |
---|
Code | String | 错误码 |
Message | String | 详细错误信息 |
VodTaskTemplateResult
示例
请求示例
https://vod.volcengineapi.com?Action=GetTaskTemplate&Version=2023-07-01&TemplateId=YourTemplateId
正常返回示例
{
"ResponseMetadata": {
"RequestId": "20220726*******************051B513A",
"Action": "GetTaskTemplate",
"Version": "2023-07-01",
"Service": "vod",
"Region": "cn-north-1"
},
"Result": {
"TemplateId": "TemplateId",
"SpaceName": "SpaceName",
"Name": "Name",
"Description": "Description",
"CommitId": "CommitId",
"Hash": "Hash",
"CreatedAt": "2022-04-18T20:00:00Z",
"UpdatedAt": "2022-04-18T22:00:00Z",
"TaskType": "TaskType",
"TranscodeVideoTaskParams": {
"TranscodeTemplateType": "TranscodeTemplateType",
"Container": "Container",
"Video": {
"Res": "Res",
"ScaleMethod": "ScaleMethod",
"ScaleType": 1,
"ScaleMode": 1,
"ScaleWidth": 1,
"ScaleHeight": 1,
"ScaleShort": 1,
"ScaleLong": 1,
"Codec": "Codec",
"RateControlMode": "RateControlMode",
"MaxBitrate": 1,
"Bitrate": 1,
"Crf": 0.1,
"Preset": "Preset",
"MaxFps": 1,
"Vsync": "Vsync",
"Fps": 0.1,
"HDRMode": 0
},
"Audio": {
"Codec": "Codec",
"SampleRate": 1,
"RateControlMode": "RateControlMode",
"Bitrate": 1,
"MinRate": 1,
"MaxRate": 1,
"Channels": 1,
"Profile": "Profile"
},
"DisableAudio": "false",
"Quality": "Quality",
"UserTag": "UserTag",
"Encrypt": "false",
"Encryption": {
"Vendor": "Vendor"
},
"Segment": {
"Format": "Format",
"Type": "Type",
"Duration": 1
}
},
"ByteHDTaskParams": {
"Container": "Container",
"Video": {
"Res": "Res",
"ScaleMethod": "ScaleMethod",
"ScaleType": 1,
"ScaleMode": 1,
"ScaleWidth": 1,
"ScaleHeight": 1,
"ScaleShort": 1,
"ScaleLong": 1,
"Codec": "Codec",
"RateControlMode": "RateControlMode",
"MaxBitrate": 1,
"Bitrate": 1,
"Crf": 0.1,
"Preset": "Preset",
"MaxFps": 1,
"Vsync": "Vsync",
"Fps": 0.1,
"HDRMode": 0
},
"Audio": {
"Codec": "Codec",
"SampleRate": 1,
"RateControlMode": "RateControlMode",
"Bitrate": 1,
"MinRate": 1,
"MaxRate": 1,
"Channels": 1,
"Profile": "Profile"
},
"DisableAudio": "false",
"Quality": "Quality",
"UserTag": "UserTag",
"Encrypt": "false",
"Encryption": {
"Vendor": "Vendor"
},
"Segment": {
"Format": "Format",
"Type": "Type",
"Duration": 1
}
},
"TranscodeAudioTaskParams": {
"Container": "Container",
"Audio": {
"Codec": "Codec",
"SampleRate": 1,
"RateControlMode": "RateControlMode",
"Bitrate": 1,
"MinRate": 1,
"MaxRate": 1,
"Channels": 1,
"Profile": "Profile"
},
"Quality": "Quality",
"UserTag": "UserTag",
"Encrypt": "false",
"Encryption": {
"Vendor": "Vendor"
},
"Segment": {
"Format": "Format",
"Type": "Type",
"Duration": 1
}
}
}
}
异常返回示例
{
"ResponseMetadata": {
"RequestId": "20220726*******************051B513A",
"Action": "GetTaskTemplate",
"Version": "2023-07-01",
"Service": "vod",
"Region": "cn-north-1",
"Error": {
"Code": "InternalError",
"Message": "InternalError:some error!"
}
}
}
错误码
详见视频点播公共错误码。
服务端 SDK
点播 OpenAPI 提供了配套的服务端 SDK,支持多种编程语言,帮助您实现快速开发。建议使用服务端 SDK 来调用 API,此 API 各语言调用的示例代码,请参考如下: