All Products
Search
Document Center

ApsaraVideo Media Processing:QueryTemplateList

Last Updated:Mar 03, 2024

You can call this operation to query up to 10 transcoding templates at a time. \### QPS limits 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]\(~~342832~~).

Operation description

The IDs of the transcoding templates that you want to query. You can query up to 10 transcoding templates at a time. Separate multiple IDs of custom transcoding templates with commas (,).

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
TemplateIdsstringYes

The response parameters.

16f01ad6175e4230ac42bb5182cd****,88c6ca184c0e424d5w5b665e2a12****

Response parameters

ParameterTypeDescriptionExample
object

The templates that do not exist.

NonExistTidsarray

The IDs of the templates that do not exist. This parameter is not returned if all specified transcoding templates are found.

string

The details of transcoding templates.

88c6ca184c0e424d5w5b665e2a12****
TemplateListobject []

The details of the transcoding template.

Videoobject

The size of the buffer.

  • Unit: KB.
  • Default value: 6000.
Bufsizestring

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: The auto-rotate screen feature is enabled.
  • false: The auto-rotate screen feature is disabled.
  • Default value: false.
6000
LongShortModestring

The level of quality control on the video.

false
Degrainstring

The average bitrate range of the video.

10
BitrateBndobject

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

Maxstring

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

100
Minstring

The pixel format of the video. Standard pixel formats such as yuv420p and yuvj420p are supported.

500
PixFmtstring

The black borders added to the video. Format: width:height:left:top. Example: 1280:800:0:140.

yuv420p
Padstring

The video codec. Default value: H.264.

1280:800:0:140
Codecstring

The height of the video.

  • Unit: pixel.
  • Default value: the height of the input video.
H.264
Heightstring

The level of the independent denoising algorithm.

800
Qscalestring

The method used to crop the video. Valid values:

  • 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
Cropstring

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

border
Bitratestring

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

200
Maxratestring

The maximum frame rate.

500
MaxFpsstring

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.
60
Profilestring

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
Crfstring

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
Removestring

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

false
Gopstring

The width of the video.

  • Unit: pixel.
  • Default value: the width of the input video.
10
Widthstring

The frame rate.

  • The value is 60 if the frame rate of the input video exceeds 60.
  • Default value: the frame rate of the input video.
256
Fpsstring

The preset video algorithm. Valid values: veryfast, fast, medium, slow, and slower. Default value: medium.

25
Presetstring

The scan mode. Valid values:

  • interlaced: An interlaced scan is performed.
  • progressive: A progressive scan is performed.
medium
ScanModestring

The policy of resolution adjustment. Valid values: cropFirst, widthFirst, and heightFirst.

interlaced
ResoPrioritystring

The general transcoding configurations.

heightFirst
TransConfigobject

Indicates whether the audio bitrate is checked. If the bitrate of the output audio is greater than the bitrate of the input audio, the bitrate of the input audio is retained after transcoding. In this case, the specified audio bitrate does not take effect. This parameter has a lower priority than the IsCheckAudioBitrateFail parameter. Valid values:

  • true: The audio bitrate is checked.

  • false: The audio bitrate is not checked.

  • Default value:

    • If the parameter is left empty and the codec of the output audio is different from that of the input audio, the default value is false.
    • If the parameter is left empty and the codec of the output audio is the same as that of the input audio, the default value is true.
IsCheckAudioBitratestring

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

  • onepass
  • twopass
  • CBR
false
TransModestring

Indicates whether the resolution is checked. If the resolution of the output video is higher than the resolution of the input video 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
IsCheckResostring

Indicates whether video bitrate check errors are allowed. This parameter has a higher priority than the IsCheckVideoBitrate parameter. 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
IsCheckVideoBitrateFailstring

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
AdjDarMethodstring

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
IsCheckVideoBitratestring

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
IsCheckResoFailstring

Indicates whether audio bitrate check errors are allowed. This parameter has a higher priority than the IsCheckAudioBitrate parameter.

  • true: If the audio bitrate check fails, the input file is not transcoded.
  • false: The audio bitrate is not checked.
  • Default value: false.
false
IsCheckAudioBitrateFailstring

The status of the template. Valid values:

  • Normal: The template is normal.
  • Deleted: The template is deleted.
false
Statestring

The transmuxing configurations.

Normal
MuxConfigobject

The transmuxing configuration for WebP.

Webpobject

The loop count.

Loopstring

The transmuxing configuration for GIF.

0
Gifobject

The duration for which the final frame is paused.

FinalDelaystring

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

0
DitherModestring

The loop count.

sierra
Loopstring

Indicates whether the custom palette is used.

0
IsCustomPalettestring

The segment configuration.

false
Segmentobject

The length of the segment. Unit: seconds.

Durationstring

The name of the template.

10
Namestring

The audio codec configurations.

MPS-example
Audioobject

The codec profile of the audio. Valid values if the Codec parameter is set to aac:

  • aac_low
  • aac_he
  • aac_he_v2
  • aac_ld
  • aac_eld
Profilestring

Indicates whether the audio stream is deleted.

  • true: The audio stream is deleted.
  • false: The audio stream is retained.
  • Default value: false.
aac_low
Removestring

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

  • aac
  • mp3
  • vorbis
  • flac
false
Codecstring

The sampling rate.

  • Unit: Hz.
  • Default value: 44100.
aac
Sampleratestring

The level of the independent denoising algorithm.

44100
Qscalestring

The number of sound channels. Default value: 2.

1
Channelsstring

The audio bitrate of the output file.

  • Valid values: 8 to 1000.****
  • Unit: Kbit/s.
  • Default value: 128.
2
Bitratestring

The ID of the transcoding template.

500
Idstring

The container configurations.

16f01ad6175e4230ac42bb5182cd****
Containerobject

The container format. Valid values: flv, mp4, ts, m3u8, gif, mp3, ogg, and flac.

Formatstring

The ID of the request.

flv

Examples

Sample success responses

JSONformat

{
  "NonExistTids": {
    "String": [
      "88c6ca184c0e424d5w5b665e2a12****"
    ]
  },
  "TemplateList": {
    "Template": [
      {
        "Video": {
          "Bufsize": "6000",
          "LongShortMode": "false",
          "Degrain": "10",
          "BitrateBnd": {
            "Max": "100",
            "Min": "500"
          },
          "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": "heightFirst"
        },
        "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": "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": "flv"
        }
      }
    ]
  },
  "RequestId": "BC860F04-778A-472F-AB39-E1BF329C1EA8"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-01-04The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.
2023-07-13The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.