All Products
Search
Document Center

ApsaraVideo Media Processing:SearchTemplate

Last Updated:Jun 11, 2026

Mengkueri template Transcoding kustom dalam status yang ditentukan.

Deskripsi operasi

You can call this operation up to 100 times per second. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. For more information, see QPS limit.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

mts:SearchTemplate

get

*全部资源

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

PageSize

integer

No

Jumlah entri per halaman untuk kueri berhalaman.

  • Nilai maksimum: 100.

  • Nilai default: 10.

10

PageNumber

integer

No

Nomor halaman yang akan dikembalikan. Nilai default: 1.

1

State

string

No

Status template Transcoding kustom yang akan dikueri. Nilai valid:

  • All: Semua template Transcoding kustom dikueri.

  • Normal: Template Transcoding kustom dalam status normal dikueri.

  • Deleted: Template Transcoding kustom yang dihapus dikueri.

Nilai default: All.

Normal

NamePrefix

string

No

Awalan nama yang digunakan untuk mencari templat.

S00000001

Elemen respons

Element

Type

Description

Example

object

The response parameters.

TotalCount

integer

The total number of search results.

1

TemplateList

object

Template

array<object>

The transcoding templates.

array<object>

The video codec configurations.

Video

object

The video codec configurations.

Bufsize

string

The buffer size.

  • Unit: KB.

  • Default value: 6000.

6000

LongShortMode

string

Indicates whether the auto-rotate screen feature is enabled.

  • If this feature is enabled, the width of the output video corresponds to the long side of the input video, which is the height of the input video in portrait mode. The height of the output video corresponds to the short side of the input video, which is the width of the input video in portrait mode. Valid values:

  • true

  • false

  • Default value: false.

false

Degrain

string

The level of video quality control.

10

BitrateBnd

object

The average bitrate range of the video.

Max

string

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

500

Min

string

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

100

PixFmt

string

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

yuv420p

Pad

string

The black bars that are added to the video.

  • Format: width:height:left:top.

  • Example: 1280:800:0:140.

1280:800:0:140

Codec

string

The codec.

  • Valid values: H.264 and H.265.

  • Default value: H.264.

H.264

Height

string

The height of the video.

  • Unit: pixel.

  • Default value: the height of the input video.

800

Qscale

string

The strength of the independent denoising algorithm.

1

Crop

string

The method of video cropping. Valid values:

  • border: automatically detects and removes black bars.

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

border

Bitrate

string

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

200

Maxrate

string

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

500

NarrowBand

object

The Narrowband HD settings.

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

Version

string

The Narrowband HD version. Only 1.0 may be returned.

1.0

MaxFps

string

The maximum frame rate.

60

Profile

string

The codec profile. Valid values:

  • baseline: applicable to mobile devices.

  • main: applicable to standard-definition devices.

  • high: applicable to high-definition devices.

  • Default value: high.

high

Crf

string

The constant rate factor.

  • Default value when the value of Codec is H.264: 23, default value when the value of Codec is H.265: 26.

  • If this parameter is set, the value of Bitrate becomes invalid.

15

Remove

string

Indicates whether the video stream is deleted. Valid values:

  • true

  • false

  • Default value: false.

false

Gop

string

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

10

Width

string

The width of the video.

  • Valid values: [128,4096].

  • Unit: pixel.

  • Default value: the width of the input video.

256

Fps

string

The frame rate of the video.

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

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

25

Preset

string

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

  • veryfast

  • fast

  • medium

  • slow

  • slower

medium

ScanMode

string

The scan mode. Valid values:

  • interlaced

  • progressive

interlaced

ResoPriority

string

The policy of resolution adjustment.

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

TransConfig

object

The general transcoding configurations.

IsCheckAudioBitrate

string

Indicates whether the audio bitrate is checked. If the bitrate of the output audio is higher than that of the input audio, the input bitrate is retained and the specified audio bitrate does not take effect. This parameter has a lower priority than IsCheckAudioBitrateFail. Valid values:

  • true

  • false

  • Default value:

    • If this parameter is empty and the codec of the output audio is different from that of the input audio, the default value is false.

    • If this parameter is empty and the codec of the output audio is the same as that of the input audio, the default value is true.

false

TransMode

string

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

  • onepass

  • twopass

  • CBR

onepass

IsCheckReso

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. Valid values:

  • true

  • false

  • Default value: false.

false

IsCheckVideoBitrateFail

string

Indicates whether video bitrate check errors are allowed. This parameter has a higher priority than IsCheckVideoBitrate. Valid values:

  • true: If the video bitrate check fails, the input file is not transcoded.

  • false: The video bitrate is not checked.

  • Default value: false.

false

AdjDarMethod

string

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

  • rescale

  • crop

  • none

none

IsCheckVideoBitrate

string

Indicates whether the video bitrate is checked. If the bitrate of the output video is higher than that of the input video, the input bitrate is retained. Valid values:

  • true

  • false

  • Default value: false.

false

IsCheckResoFail

string

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

  • true

  • false

  • Default value: false.

false

IsCheckAudioBitrateFail

string

Indicates whether audio bitrate check errors are allowed. This parameter has a greater priority than IsCheckAudioBitrate. Valid values:

  • true: If the audio bitrate check fails, the input file is not transcoded.

  • false: The audio bitrate is not checked.

  • Default value: false.

false

State

string

The status of the template. Valid values:

  • Normal

  • Deleted

Normal

MuxConfig

object

The transmuxing configurations.

Gif

object

The transmuxing configurations for GIF.

FinalDelay

string

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

0

DitherMode

string

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

sierra

Loop

string

The loop count.

0

IsCustomPalette

string

Indicates whether a custom palette is used.

false

Segment

object

The segment configurations.

Duration

string

The length of the segment. Unit: seconds.

10

Name

string

The name of the template.

MPS-example

Audio

object

The audio codec configurations.

Profile

string

The codec profile of the audio. Valid values when the value of Codec is aac:

  • aac_low

  • aac_he

  • aac_he_v2

  • aac_ld

  • aac_eld

aac_low

Remove

string

Indicates whether the audio stream is deleted. Valid values:

  • true

  • false

  • Default value: false.

false

Codec

string

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

  • aac

  • mp3

  • vorbis

  • flac

aac

Samplerate

string

The sampling rate.

  • Unit: Hz

  • Default value: 44100.

44100

Qscale

string

The strength of the independent denoising algorithm. Valid values: [1,9].

1

Channels

string

The number of sound channels. Default value: 2.

2

Bitrate

string

The audio bitrate of the output file.

  • Unit: Kbit/s.

  • Default value: 128.

500

Id

string

The transcoding template ID.

16f01ad6175e4230ac42bb5182cd****

Container

object

The container format configurations.

Format

string

The format of the container. Valid values:

  • flv

  • mp4

  • ts

  • m3u8

  • gif

  • mp3

  • ogg

  • flac

mp4

CreationTime

string

The time when the template was created.

2021-03-04T06:44:43Z

PageSize

integer

The page number of the returned page.

10

RequestId

string

The ID of the request.

BC860F04-778A-472F-AB39-E1BF329C****

PageNumber

integer

The number of the page to return.

1

Contoh

Respons sukses

JSONformat

{
  "TotalCount": 1,
  "TemplateList": {
    "Template": [
      {
        "Video": {
          "Bufsize": "6000",
          "LongShortMode": "false",
          "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",
          "NarrowBand": {
            "Abrmax": 3000,
            "MaxAbrRatio": 1,
            "Version": "1.0"
          },
          "MaxFps": "60",
          "Profile": "high",
          "Crf": "15",
          "Remove": "false",
          "Gop": "10",
          "Width": "256",
          "Fps": "25",
          "Preset": "medium",
          "ScanMode": "interlaced",
          "ResoPriority": "1",
          "Hdr2sdr": "true"
        },
        "TransConfig": {
          "IsCheckAudioBitrate": "false",
          "TransMode": "onepass",
          "IsCheckReso": "false",
          "IsCheckVideoBitrateFail": "false",
          "AdjDarMethod": "none",
          "IsCheckVideoBitrate": "false",
          "IsCheckResoFail": "false",
          "IsCheckAudioBitrateFail": "false"
        },
        "State": "Normal",
        "MuxConfig": {
          "Gif": {
            "FinalDelay": "0",
            "DitherMode": "sierra",
            "Loop": "0",
            "IsCustomPalette": "false"
          },
          "Segment": {
            "Duration": "10"
          }
        },
        "Name": "MPS-example",
        "Audio": {
          "Profile": "aac_low",
          "Remove": "false",
          "Codec": "aac",
          "Samplerate": "44100",
          "Qscale": "1",
          "Channels": "2",
          "Bitrate": "500"
        },
        "Id": "16f01ad6175e4230ac42bb5182cd****",
        "Container": {
          "Format": "mp4"
        },
        "CreationTime": "2021-03-04T06:44:43Z"
      }
    ]
  },
  "PageSize": 10,
  "RequestId": "BC860F04-778A-472F-AB39-E1BF329C****",
  "PageNumber": 1
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.