You need to enable JavaScript to run this app.
导航

更新转码配置

最近更新时间2023.10.23 16:14:00

首次发布时间2023.09.25 14:34:03

更新转码模版相关配置,若未填写非必选参数,则转码模板配置不发生改变。

注意事项

请求频率:单用户请求频率限制为 10 次/秒

请求说明

  • 请求方式:POST
  • 请求地址:https://live.volcengineapi.com?Action=UpdateTranscodePreset&Version=2023-01-01

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

Query

参数类型是否必选示例值描述
ActionStringUpdateTranscodePreset接口名称。当前 API 的名称为 UpdateTranscodePreset
VersionString2023-01-01接口版本。当前 API 的版本为 2023-01-01

Body

参数类型是否必选示例值描述
PresetStringPresetName模板名称。
VhostStringpush.example.com域名空间名称。
AppStringlive应用名称,由 1 到 30 位数字、字母、下划线及"-"和"."组成。

SuffixName

String

hd

转码流后缀名。支持 10 个字符以内的大小写字母、下划线与中划线,常见后缀包括:_sd、_hd、_uhd。
例如,配置的转码流后缀名为_hd,则拉转码流时转码的流名为 stream-123456789_hd。

VideoBitrateInteger0视频码率,单位为 bps,取值范围为 [0,30000000];取值为 0 时,表示使用源流码率。

Vcodec

String

h265

视频编码格式。

  • h264:使用 H.264 编码格式;
  • h265:使用 H.265 编码格式;
  • copy:不进行转码,所有视频编码参数不生效。
AudioBitrateInteger30音频码率,单位为 kbps。

Acodec

String

aac

音频编码格式。支持以下 3 种类型。

  • aac:使用 aac 编码格式;
  • copy:不进行转码,所有音频编码参数不生效;
  • opus:使用 opus 编码格式。
FPSInteger60视频帧率,单位为 fps,取值范围为 [0,60],帧率越大,画面越流畅
GOPInteger500IDR 帧之间的最大间隔,单位为 s,取值范围为 [0,1000]。

Width

Integer

1366

视频宽度。取值范围为 [0,8192]。

说明

  • As 的取值为 0 时,参数生效;反之则不生效;
  • As 的取值为 0 时,如果 WidthHeight 任意取值为 0,表示保持源流尺寸。

Height

Integer

768

视频高度。取值范围为 [0,8192]。

说明

  • As 的取值为 0 时,参数生效;反之则不生效;
  • As 的取值为 0 时,如果 WidthHeight 任意取值为 0,表示保持源流尺寸。

As

String

1

宽高自适应模式开关。支持两种取值。

  • 0:关闭宽高自适应,按照 WidthHeight 的取值进行拉伸;
  • 1:开启宽高自适应,按照 ShortSideLongSide 等比缩放。

注意

  • 修改 As 为 0 时,请确认 WidthHeight 的取值是否超出阈值;
  • 修改 As 为 1 时,请确认 ShortSideLongSide 的取值是否超出阈值。

ShortSide

Integer

500

短边长度。

  • Roi 取 false 时,取值范围为 [0,4096];
  • Roi 取 true 时,取值范围为 [0,1080]。

说明

  • As 的取值为 1 时,参数生效,反之则不生效。
  • As 的取值为 1 时,如果 LongSideShortSide 同时取 0,表示保持源流尺寸。
  • As 的取值为 1 时,如果同时配置 LongSideShortSide 的值,则按照 ShortSide 进行等比缩放。

LongSide

Integer

600

长边长度。

  • Roi 取 false 时,取值范围为 [0,8192];
  • Roi 取 true 时,取值范围为 [0,1920]。

说明

  • As 的取值为 1 时,参数生效,反之则不生效。
  • As 的取值为 1 时,如果 LongSideShortSide 同时取 0,表示保持源流尺寸。
  • As 的取值为 1 时,如果同时配置 LongSideShortSide 的值,则按照 ShortSide 进行等比缩放。

BFrames

Integer

3

2 个参考帧之间的最大 B 帧数。不同编码格式的取值存在差异。

  • H.264:取值范围为 [0,7];
  • H.265:取值范围为 [0,1,2,3,7,15];
    BFrames 取 0 时,表示去 B 帧。

Roi

Boolean

true

是否极智超清转码。

  • true:极智超清;
  • false:标准转码。

注意

修改 Roi 为 true,且 As 为 1 时,请确认 ShortSideLongSide 的取值是否超出阈值。

返回参数

本接口无特有的返回参数。更多信息请见返回结构

示例

请求示例

POST https://live.volcengineapi.com?Action=UpdateTranscodePreset&Version=2023-01-01
{
  "Preset": "PresetName",
  "Vhost": "push.example.com",
  "App": "live",
  "SuffixName": "hd"
}

返回示例

{
  "ResponseMetadata": {
    "RequestId": "201806041104200100100232280022D30",
    "Action": "UpdateTranscodePreset",
    "Version": "2023-01-01",
    "Service": "live",
    "Region": "cn-north-1"
  }
}

错误码

下表仅列出本接口特有的错误码。更多信息请参见公共错误码获取详细信息。

状态码错误码错误信息说明
200CommonErr-未分类错误。建议重试,如果仍返回该错误码,请联系技术支持
400InvalidParam-输入的参数无效或不符合要求,请参照请求参数说明进行检查。
400InvalidParam.BindErrorRequest parameter error, please check input data参数未通过校验,请检查参数类型是否正确。
403RequestForbidden-请求被拒绝,当前账号下无请求的资源(域名空间、域名、应用、配置模版、证书)。
403RequestForbidden.AccountIDNotAllowthis AccountID does not have permission to access the corresponding resource, please check the request parameters请求被拒绝,当前账号下无请求的资源(域名空间、域名、应用、配置模版、证书)。
403RequestForbidden.BillingStatusBilling status is not available for the AccountID, please activate the service or recharge.未开通视频直播服务或账号欠费,造成账单不可用,请检查服务开通情况和账号欠费情况。
404ResourceNotFound-未找到资源(域名空间、域名、应用、配置模版、证书)。建议重试,如果仍返回该错误码,请联系技术支持
500InternalErroran internal error occurred, please contact the administrator.出现内部错误,请联系技术支持
500InternalError.Presetan internal error related to preset occurred, please contact the administrator.出现与功能配置相关的内部错误,请联系技术支持
502InternalServiceErroran internal error occurred, please contact the administrator.服务间出现错误,请联系技术支持
502InternalServiceError.BadResponsean internal error occurred, please contact the administrator.服务间出现错误,请联系技术支持
504InternalServiceTimeoutInternal Service is timeout. please contact the administrator.内部服务超时,请联系技术支持