Todos os produtos
Search
Central de documentação

ApsaraVideo Media Processing:UpdateTemplate

Última atualização: Jun 28, 2026

Atualiza as configurações do modelo de transcodificação personalizado.

Descrição da operação

Se qualquer trabalho com o status "Submitted" especificar o uso deste modelo personalizado, as informações do modelo de transcodificação correspondente não poderão ser atualizadas.

Limite de QPS

O limite de consultas por segundo (QPS) para esta API é de 100 solicitações por segundo por usuário. Se o limite for excedido, as chamadas de API estarão sujeitas à limitação de taxa, o que pode impactar seus negócios. Invoque a API de forma adequada. Para mais informações, consulte Limites de QPS.

Experimente agora

Experimente esta API no OpenAPI Explorer, sem necessidade de assinatura manual. Chamadas bem-sucedidas geram automaticamente código SDK correspondente aos seus parâmetros. Faça o download com segurança de credenciais integrada para uso local.

Testar

Autorização RAM

A tabela abaixo descreve a autorização necessária para chamar esta API. Você pode defini-la em uma política do Resource Access Management (RAM). As colunas da tabela estão detalhadas abaixo:

  • Ação: As ações que podem ser usadas no elemento Action das instruções de política de permissão do RAM para conceder permissões para executar a operação.

  • API: A API que você pode chamar para executar a ação.

  • Nível de acesso: O nível de acesso predefinido concedido para cada API. Valores válidos: create, list, get, update e delete.

  • Tipo de recurso: O tipo de recurso que suporta autorização para executar a ação. Indica se a ação suporta permissão em nível de recurso. O recurso especificado deve ser compatível com a ação. Caso contrário, a política será ineficaz.

    • Para APIs com permissões em nível de recurso, os tipos de recursos obrigatórios são marcados com um asterisco (*). Especifique o Nome de Recurso Alibaba Cloud (ARN) correspondente no elemento Resource da política.

    • Para APIs sem permissões em nível de recurso, é exibido como Todos os Recursos. Use um asterisco (*) no elemento Resource da política.

  • Chave de condição: As chaves de condição definidas pelo serviço. A chave permite controle granular, aplicando-se somente a ações ou a ações associadas a recursos específicos. Além das chaves de condição específicas do serviço, o Alibaba Cloud fornece um conjunto de chaves de condição comuns aplicáveis a todos os serviços compatíveis com RAM.

  • Ação dependente: As ações dependentes necessárias para executar a ação. Para concluir a ação, o usuário RAM ou a função RAM deve ter permissões para executar todas as ações dependentes.

Ação

Nível de acesso

Tipo de recurso

Chave de condição

Ação dependente

mts:UpdateTemplate

update

*All Resource

*

Nenhuma Nenhuma

Parâmetros da solicitação

Parâmetro

Tipo

Obrigatório

Descrição

Exemplo

TemplateId

string

Sim

O nome do modelo. O nome pode ter até 128 bytes de comprimento.

16f01ad6175e4230ac42bb5182cd****

Name

string

Sim

O formato do contêiner. O valor é um objeto JSON. Formato padrão: MP4.

  • Formatos de vídeo: FLV, MP4, HLS (M3U8 + TS) e MPEG-DASH (MPD + fMP4)

  • Formatos de áudio: MP3, MP4, OGG, FLAC e M4A

  • Formatos de imagem: GIF e WebP

Para mais informações, consulte o parâmetro Container do tópico "Detalhes dos parâmetros".

MPS-example

Container

string

Não

As configurações do fluxo de vídeo. O valor é um objeto JSON. Para mais informações, consulte o parâmetro Video do tópico "Detalhes dos parâmetros".

{"Format":"mp4"}

Video

string

Não

As configurações do fluxo de áudio. O valor é um objeto JSON. Para mais informações, consulte o parâmetro Audio do tópico "Detalhes dos parâmetros".

{"Codec":"H.264","Profile":"high","Bitrate":"500","Crf":"15","Width":"256","Height":"800","Fps":"25","Gop":"10"}

Audio

string

Não

As configurações de transmuxing. O valor é um objeto JSON. Para mais informações, consulte o parâmetro MuxConfig do tópico "Detalhes dos parâmetros".

{"Codec":"aac","Samplerate":"44100","Bitrate":"500","Channels":"2"}

MuxConfig

string

Não

As configurações gerais de transcodificação. O valor é um objeto JSON. Para mais informações, consulte o parâmetro TransConfig do tópico "Detalhes dos parâmetros".

{"Segment":{"Duration":"10"}}

TransConfig

string

Não

O ID da solicitação.

{"TransMode":"onepass"}

Elementos de resposta

Elemento

Tipo

Descrição

Exemplo

object

RequestId

string

O tipo do modelo de transcodificação.

5E4FB22E-B9EA-4E24-8FFC-B407EA71QW21

Template

object

O tipo do modelo de transcodificação.

Video

object

As configurações do codec de vídeo.

LongShortMode

string

The size of the buffer.

  • Unit: KB.

  • Default value: 6000.

false

Bufsize

string

The level of quality control on the video.

6000

Degrain

string

The average bitrate range of the video.

10

BitrateBnd

object

The upper limit of the total bitrate. Unit: Kbit/s.

Max

string

The lower limit of the total bitrate. Unit: Kbit/s.

500

Min

string

The pixel format. Valid values: standard pixel formats such as yuv420p and yuvj420p.

100

PixFmt

string

The black borders added to the video.

  • Format: width:height:left:top.

  • Example: 1280:800:0:140.

yuv420p

Pad

string

The video codec. Default value: H.264.

1280:800:0:140

Codec

string

The height of the output video.

  • Unit: pixel.

  • Default value: the height of the input video.

H.264

Height

string

The level of the independent denoising algorithm.

800

Qscale

string

The method used to crop the video.

  • border: automatically detects and removes borders.

  • Value in the width:height:left:top format: crops the video based on custom settings.**** Example: 1280:800:0:140.

1

Crop

string

The average bitrate of the video. Unit: Kbit/s.

border

Bitrate

string

The maximum bitrate of the video. Unit: Kbit/s.

200

Maxrate

string

The maximum frame rate.

500

MaxFps

string

The encoding profile. Valid values:

  • baseline: applicable to mobile devices.

  • main: applicable to standard-definition devices.

  • high: applicable to high-definition devices.

  • Default value: high.

60

Profile

string

The bitrate quality control factor.

  • Default value if the Codec parameter is set to H.264: 23. Default value if the Codec parameter is set to H.265: 26.

  • If this parameter is returned, the setting of the Bitrate parameter is invalid.

high

Crf

string

Indicates whether the video stream is deleted. Valid values:

  • true: The video stream is deleted.

  • false: The video stream is retained.

  • Default value: false.

15

Remove

string

The maximum number of frames between two keyframes. Default value: 250.

false

Gop

string

The width of the video.

  • Unit: pixel.

  • Default value: the width of the input video.

10

Width

string

The frame rate.

  • A value of 60 is returned if the frame rate of the input video exceeds 60.

  • Default value: the frame rate of the input video.

256

Fps

string

The preset video algorithm. Default value: medium. Valid values:

  • veryfast

  • fast

  • medium

  • slow

  • slower

25

Preset

string

The scan mode. Valid values:

  • interlaced: An interlaced scan is performed.

  • progressive: A progressive scan is performed.

medium

ScanMode

string

The policy of resolution adjustment.

interlaced

ResoPriority

string

The general transcoding configurations.

1

Hdr2sdr

string

Indicates whether the HDR2SDR conversion feature is enabled. If this feature is enabled, high dynamic range (HDR) videos are transcoded to standard dynamic range (SDR) videos.

true

NarrowBand

object

The Narrowband HD settings.

Version

string

The Narrowband HD version. Only 1.0 may be returned.

1.0

Abrmax

number

The upper limit of the dynamic bitrate. If this parameter is set, the average bitrate is in the range of (0, 1000000].

3000

MaxAbrRatio

number

The maximum ratio of the upper limit of dynamic bitrate. If this parameter is set, the value of Abrmax does not exceed x times of the source video bitrate. Valid values: (0,1.0].

1.0

TransConfig

object

Indica se a taxa de bits de áudio é verificada. Se a taxa de bits do áudio de saída for maior que a taxa de bits do áudio de entrada, a taxa de bits do áudio de entrada será mantida após a transcodificação. Nesse caso, a taxa de bits de áudio especificada não entra em vigor. Este parâmetro tem uma prioridade menor que o parâmetro IsCheckAudioBitrateFail. Valores válidos:

  • true: A taxa de bits de áudio é verificada.

  • false: A taxa de bits de áudio não é verificada.

  • Valor padrão:

    • Se o parâmetro for deixado em branco e o codec do áudio de saída for diferente do codec do áudio de entrada, o valor padrão é false.

    • Se o parâmetro for deixado em branco e o codec do áudio de saída for igual ao codec do áudio de entrada, o valor padrão é true.

IsCheckAudioBitrate

string

The transcoding mode. Default value: onepass. Valid values:

  • onepass

  • twopass

  • CBR

false

TransMode

string

Indicates whether the resolution is checked. If the output resolution is higher than the input resolution based on the width or height, the input resolution is retained after transcoding. Valid values:

  • true: The resolution is checked.

  • false: The resolution is not checked.

  • Default value: false.

onepass

IsCheckReso

string

Indicates whether the video bitrate is checked. This parameter has a higher priority than the IsCheckVideoBitrate parameter. Valid values:

  • true: The video bitrate is checked

  • false: The video bitrate is not checked.

  • Default value: false.

false

IsCheckVideoBitrateFail

string

The method of resolution adjustment. Default value: none. Valid values:

  • rescale: The input video is rescaled.

  • crop: The input video is cropped.

  • none: No change is made.

false

AdjDarMethod

string

Indicates whether the video bitrate is checked. If this parameter is set to true and the system detects that the video bitrate of the output file is greater than that of the input file, the video bitrate of the input file is retained after transcoding. Valid values:

  • true: The video bitrate is checked.

  • false: The video bitrate is not checked.

  • Default value: false.

none

IsCheckVideoBitrate

string

Indicates whether the resolution is checked. If this parameter is set to true and the system detects that the resolution of the output file is higher than that of the input file based on the width or height, an error that indicates a transcoding failure is returned. Valid values:

  • true: The resolution is checked.

  • false: The resolution is not checked.

  • Default value: false.

false

IsCheckResoFail

string

Indicates whether the audio bitrate is checked. This parameter has a higher priority than the IsCheckAudioBitrate parameter. Valid values:

  • true: The audio bitrate is checked.

  • false: The audio bitrate is not checked.

  • Default value: false.

false

IsCheckAudioBitrateFail

string

The status of the template. Valid values:

  • Normal: The template is normal.

  • Deleted: The template is deleted.

false

State

string

As configurações de transmuxing.

Normal

MuxConfig

object

As configurações de transmuxing para WebP.

Webp

object

The loop count.

Loop

string

The transmuxing configurations for GIF.

0

Gif

object

The duration for which the final frame is paused. Unit: milliseconds.

FinalDelay

string

The color dithering algorithm of the palette. Valid values: sierra and bayer.

false

DitherMode

string

The loop count.

bayer

Loop

string

Indicates whether the custom palette is used.

0

IsCustomPalette

string

The segment configurations.

0

Segment

object

The length of the segment. Unit: seconds.

Duration

string

The name of the template.

10

Name

string

As configurações do codec de áudio.

MPS-example

Audio

object

As configurações do codec de áudio.

Profile

string

Indicates whether the audio stream is deleted.

  • true: The audio stream is deleted.

  • false: The audio stream is retained.

  • Default value: false.

aac_low

Remove

string

The audio codec format. Default value: aac. Valid values:

  • aac

  • mp3

  • vorbis

  • flac

false

Codec

string

The sampling rate.

  • Unit: Hz.

  • Default value: 44100.

aac

Samplerate

string

The level of the independent denoising algorithm.

44100

Qscale

string

The number of sound channels. Default value: 2.

1

Channels

string

The audio bitrate of the output file.

  • Valid values: 8 to 1000.****

  • Unit: Kbit/s.

  • Default value: 128.

2

Bitrate

string

The ID of the transcoding template.

500

Volume

object

The volume control configurations.

Method

string

The volume adjustment method. Valid values:

  • auto

  • dynamic

  • linear

auto

TruePeak

string

The peak volume.

  • This parameter takes effect only if the value of Method is dynamic.

  • Unit: decibel.

  • Valid values: [-9,0].

  • Default value: -1.

-1

IntegratedLoudnessTarget

string

The expected volume.

  • This parameter takes effect only if the value of Method is dynamic.

  • Unit: decibel.

  • Valid values: [-70,-5].

  • Default value: -6.

-6

Level

string

The increased volume relative to the volume of the input audio.

  • This parameter takes effect only if the value of Method is linear.

  • Unit: decibel.

  • Valid values: less than or equal to 20.

  • Default value: -20.

-20

LoudnessRangeTarget

string

The range of the volume relative to the expected volume.

  • This parameter takes effect only if the value of Method is dynamic.

  • Unit: decibel.

  • Valid values: [1,20].

  • Default value: 8.

8

PeakLevel

string

The volume adjustment coefficient.

This parameter takes effect only if the value of Method is adaptive.

Valid values: [0,1].

Default value: 0.9.

0.9

Id

string

As configurações do contêiner.

16f01ad6175e4230ac42bb5182cd****

Container

object

O formato do contêiner.

Format

string

The container format.

mp4

Exemplos

Resposta de sucesso

JSON formato

{
  "RequestId": "5E4FB22E-B9EA-4E24-8FFC-B407EA71QW21",
  "Template": {
    "Video": {
      "LongShortMode": "false",
      "Bufsize": "6000",
      "Degrain": "10",
      "BitrateBnd": {
        "Max": "500",
        "Min": "100"
      },
      "PixFmt": "yuv420p",
      "Pad": "1280:800:0:140",
      "Codec": "H.264",
      "Height": "800",
      "Qscale": "1",
      "Crop": "border",
      "Bitrate": "200",
      "Maxrate": "500",
      "MaxFps": "60",
      "Profile": "high",
      "Crf": "15",
      "Remove": "false",
      "Gop": "10",
      "Width": "256",
      "Fps": "25",
      "Preset": "medium",
      "ScanMode": "interlaced",
      "ResoPriority": "1",
      "Hdr2sdr": "true",
      "NarrowBand": {
        "Version": "1.0",
        "Abrmax": 3000,
        "MaxAbrRatio": 1
      }
    },
    "TransConfig": {
      "IsCheckAudioBitrate": "false",
      "TransMode": "onepass",
      "IsCheckReso": "false",
      "IsCheckVideoBitrateFail": "false",
      "AdjDarMethod": "none",
      "IsCheckVideoBitrate": "false",
      "IsCheckResoFail": "false",
      "IsCheckAudioBitrateFail": "false"
    },
    "State": "Normal",
    "MuxConfig": {
      "Webp": {
        "Loop": "0"
      },
      "Gif": {
        "FinalDelay": "false",
        "DitherMode": "bayer",
        "Loop": "0",
        "IsCustomPalette": "0"
      },
      "Segment": {
        "Duration": "10"
      }
    },
    "Name": "MPS-example",
    "Audio": {
      "Profile": "aac_low",
      "Remove": "false",
      "Codec": "aac",
      "Samplerate": "44100",
      "Qscale": "1",
      "Channels": "2",
      "Bitrate": "500",
      "Volume": {
        "Method": "auto",
        "TruePeak": "-1",
        "IntegratedLoudnessTarget": "-6",
        "Level": "-20",
        "LoudnessRangeTarget": "8",
        "PeakLevel": "0.9"
      }
    },
    "Id": "16f01ad6175e4230ac42bb5182cd****",
    "Container": {
      "Format": "mp4"
    }
  }
}

Códigos de erro

Consulte Códigos de Erro para uma lista completa.

Notas de versão

Consulte Notas de Versão para uma lista completa.