edit-icon download-icon

UpdateTemplate

Last Updated: Feb 08, 2018

Description

The UpdateTemplate API updates custom template settings. If the custom transcoding template to be updated is used by “Submitted” tasks, the template cannot be updated.

Request parameters

Parameter Type Required or not Description
Action String Yes API of the action, system required parameter. Set this parameter to UpdateTemplate.
TemplateId String Yes Template ID.
Name String Yes Template name, up to 128 bytes.
Container String No Container, which is a JSON object. For details, see “7. Container” in “Parameters” of “Appendix.” Example:
{
"Format":"mp4"
}
Video String No Video stream configuration, which is a JSON object. For details, see “8. Video” in Parameters” of “Appendix.” Example:
{
"Codec":"H.264",
"Profile":"high",
"Bitrate":"500",
"Crf":"15",
"Width":"256",
"Height":"800",
"Fps":"25",
" Gop ":"10"
}
Audio String No Audio stream configuration, which is a JSON object. For details, see “10. Audio” in “Parameters” of “Appendix.” Example:
{
"Codec":"aac",
"Samplerate":"44100",
"Bitrate":"500",
"Channels":"2"
}
TransConfig String No General transcoding configuration, which is a JSON object. For details, see “16. TransConfig” in “Parameters” of “Appendix.” Example:
{
"TransMode":"fixCRF"
}
MuxConfig String No Encapsulation configuration, which is a JSON object. For details, see “17. MuxConfig” in “Parameters” of “Appendix.” Example:
{
"Segment":{
"Duration":"12"
}
}

Return parameters

Name Type Description
Template AliyunTemplate Template

Example

Request example

  1. http://mts.cn-hangzhou.aliyuncs.com/?TemplateId=88c6ca184c0e47098a5b665e2a126799&Container=%7B%22Format%22%3A%22mp4%22%7D&Video=%7B%22Codec%22%3A%20%22H.264%22%2C%22Profile%22%3A%20%22high%22%2C%20%22BitRate%22%3A%20%22500%EF%BC%8C%22CRF%22%3A%20%2215%22%2C%20%22Width%22%3A%20%22256%22%2C%22Height%22%3A%20%22800%22%2C%20%22FPS%22%3A%20%2225%22%2C%20%22GOP%22%3A%20%2210%22%20%7D&Audio=%7B%20%22Codec%22%3A%20%22AAC%22%2C%22SampleRate%22%3A%20%2244100%22%2C%20%22BitRate%22%3A%20%22500%22%2C%20%22Channels%22%3A%20%222%22%20%7D&Action=UpdateTemplate&<Public parameter>

Return example

XML

  1. <UpdateTemplateResponse>
  2. <RequestId>017F1B2D-2B5B-4441-ABBA-E0DC08F5AFEC</RequestId>
  3. <Template>
  4. <Id>88c6ca184c0e47098a5b665e2a126799</Id>
  5. <Name>MTS-example</Name>
  6. <Container>
  7. <Format>mp4</Format>
  8. </Container>
  9. <Video>
  10. <Codec>H.264</Codec>
  11. <Profile>high</Profile>
  12. <Bitrate>Auto</Bitrate>
  13. <Crf>15</Crf>
  14. <Width>256</Width>
  15. <Height>800</Height>
  16. <Fps>25</Fps>
  17. <Gop>10</Gop>
  18. <Preset>lower</Preset>
  19. <ScanMode></ScanMode>
  20. <Bufsize>6000</Bufsize>
  21. <Maxrate></Maxrate>
  22. <BitrateBnd>
  23. <Max></Max>
  24. <Min></Min>
  25. </BitrateBnd>
  26. </Video>
  27. <Audio>
  28. <Codec>aac</Codec>
  29. <Samplerate>44100</Samplerate>
  30. <Bitrate>500</Bitrate>
  31. <Channels>2</Channels>
  32. </Audio>
  33. <State>Normal</State>
  34. </Template >
  35. </UpdateTemplateResponse>

JSON

  1. {
  2. "RequestId":"3E767BAD-9F4C-4FC8-9FAE-E3F4A639066B",
  3. "Template": {
  4. "Id": "88c6ca184c0e47098a5b665e2a126799",
  5. "Name": "MTS-example",
  6. "Container": {
  7. "Format": "mp4"
  8. },
  9. "Video": {
  10. "Codec": "H.264",
  11. "Profile": "high",
  12. "Bitrate": "Auto",
  13. "Crf": "15",
  14. "Width": "256",
  15. "Height": "800",
  16. "Fps": "25",
  17. "Gop": "10",
  18. "Preset": "lower",
  19. "ScanMode": "",
  20. "Bufsize": "6000",
  21. "Maxrate": "500",
  22. "BitrateBnd":{
  23. "Max":"",
  24. "Min":""
  25. }
  26. },
  27. "Audio": {
  28. "Codec": "aac",
  29. "Samplerate": "44100",
  30. "Bitrate": "500",
  31. "Channels": "2"
  32. },
  33. "State": "Normal"
  34. }
  35. }
Thank you! We've received your feedback.