edit-icon download-icon

SubmitJobs

Last Updated: Mar 01, 2018

Description

The SubmitJobs API submits transcoding tasks. A transcoding output generates a transcoding task. This API returns the list of transcoding tasks. Tasks are added to an Media Transcoding queue for scheduling and execution. After tasks are executed, call the “query transcoding tasks” API to poll the task execution results. Asynchronous notification can be used.

If you want to use a preset transcoding template, call the SubmitAnalysisJob API to trigger template analysis and call the QueryAnalysisJobList API to obtain a list of preset transcoding templates available for the input file. If the preset template specified in the submitted transcoding task is not in the list of available preset templates, the transcoding task fails.

Request parameters

Parameter Type Required or not Description
Action String Yes API of the action, system required parameter. Set this parameter to SubmitJobs.
Input String Yes Job input, which is a JSON object. For the Input definition, see Appendix-Parameter details-19 Details of transcoding task input Example:
{
"Bucket":"example-bucket",
"Location":"oss-cn-hangzhou",
"Object":"example.flv"
}
Cloud resource authorization must be completed in the console.
OutputBucket String Yes Output bucket. Cloud resource authorization must be completed in the console.
OutputLocation String No Data center where the output bucket belongs. The default value is oss-cn-hangzhou.
Outputs String Yes Outputs consists of the Output list, which is a JSON array and has up to 30 Output parameters. For Output definition, see the glossary. For details about the Output parameter, see “2. Output” in “Parameters” of “Appendix.” Example:
[{
"OutputObject":"example-output.flv",
"TemplateId":"S00000000-000010",
"WaterMarks":[{
"InputFile":{
"Bucket":"example-bucket",
"Location":"oss-cn-hangzhou",
"Object":"example-logo.png"
},
"WaterMarkTemplateId":"88c6ca184c0e47098a5b665e2a126797"
}],
"UserData":"testid-001"
}]
PipelineId String Yes Media Transcoding queue ID. For the Media Transcoding queue definition, see the glossary. If asynchronous notification is required, ensure that the Media Transcoding queue is bound to an available message subject.

Return parameters

Name Type Description
JobResultList AliyunJobResult[ ] List of submitted transcoding task results

Example

Request example

  1. http://mts.cn-hangzhou.aliyuncs.com/?PipelineId=88c6ca184c0e47098a5b665e2a126799&Action=SubmitJobs&Input=%7b%22Bucket%22%3a%22example-bucket%22%2c%22Location%22%3a%22oss-cn-hangzhou%22%2c%22Object%22%3a%22example.flv%22%7d&Outputs=%5b%7b%22OutputObject%22%3a%22example-output.flv%22%2c%22TemplateId%22%3a%22S00000000-000010%22%2c%22WaterMarks%22%3a%5b%7b%22InputFile%22%3a%7b%22Bucket%22%3a%22example-bucket%22%2c%22Location%22%3a%22oss-cn-hangzhou%22%2c%22Object%22%3a%22example-logo.png%22%7d%2c%22WaterMarkTemplateId%22%3a%2288c6ca184c0e47098a5b665e2a126797%22%7d%5d%7d%5d&OutputBucket=example-bucket&Public Parameters>

Return example

XML

  1. <SubmitJobsResponse>
  2. <RequestId>25818875-5F78-4A13-BEF6-D7393642CA58</RequestId>
  3. <JobResultList list="true">
  4. <JobResult>
  5. <Success>true</Success>
  6. <Code> </Code>
  7. <Message> </Message>
  8. <Job>
  9. <JobId>31fa3c9ca8134f9cec2b4b0b0f787830</JobId>
  10. <Input>
  11. <Bucket>example-bucket</Bucket>
  12. <Location>oss-cn-hangzhou</Location>
  13. <Object>example.flv</Object>
  14. </Input>
  15. <Output>
  16. <OutputFile>
  17. <Bucket>example-bucket</Bucket>
  18. <Location>oss-cn-hangzhou</Location>
  19. <Object>example-output.flv</Object>
  20. </OutputFile>
  21. <TemplateId>S00000000-000010</TemplateId>
  22. <WaterMarkList list="true">
  23. <WaterMark>
  24. <InputFile>
  25. <Bucket>example-logo-bucket</Bucket>
  26. <Location>0ss-cn-hangzhou</Location>
  27. <Object>example-logo.png</Object>
  28. </InputFile>
  29. <WaterMarkTemplateId>88c6ca184c0e47098a5b665e2a126797</WaterMarkTemplateId>
  30. </WaterMark>
  31. </WaterMarkList>
  32. <UserData>testid-001</UserData>
  33. </Output>
  34. <State>Submitted</State>
  35. <Code> </Code>
  36. <Message> </Message>
  37. <Percent>0</Percent>
  38. <PipelineId>88c6ca184c0e47098a5b665e2a126797</PipelineId>
  39. <CreationTime>2014-01-10T12:00:00Z</CreationTime>
  40. </Job>
  41. </JobResult>
  42. </JobResultList>
  43. </SubmitJobsResponse>

JSON

  1. {
  2. "RequestId": "25818875-5F78-4A13-BEF6-D7393642CA58",
  3. "JobResultList": {
  4. "JobResult": [{
  5. "Success": true,
  6. "Code": "",
  7. "Message": "",
  8. "Job": {
  9. "JobId": "31fa3c9ca8134f9cec2b4b0b0f787830",
  10. "Input": {
  11. "Bucket": "example-bucket",
  12. "Location": "oss-cn-hangzhou",
  13. "Object": "example.flv"
  14. },
  15. "Output": {
  16. "OutputFile": {
  17. "Bucket": "example-bucket",
  18. "Location": "oss-cn-hangzhou",
  19. "Object": "example-output.flv"
  20. },
  21. "TemplateId": "S00000000-000010",
  22. "WaterMarkList": {
  23. "WaterMark": [{
  24. "InputFile": {
  25. "Bucket": "example-bucket",
  26. "Location": "oss-cn-hangzhou",
  27. "Object": "example-logo.png"
  28. },
  29. "WaterMarkTemplateId": "88c6ca184c0e47098a5b665e2a126797"
  30. }]
  31. },
  32. "UserData":"testid-001"
  33. },
  34. "State": "Submitted",
  35. "Code": "",
  36. "Message": "",
  37. "Percent": 0,
  38. "PipelineId": "88c6ca184c0e47098a5b665e2a126797",
  39. "CreationTime”:”2014-01-10T12:00:00Z"
  40. }
  41. }]
  42. }
  43. }

Transcoding error codes

Error code Description Detailed information
InvalidParameter.ResourceContentBad The transcoding fails because the transcoding source file is damaged. The resource operated is broken.
PermissionDenied.ResourceAccess The operation has no authorization. MTS is not authorized to operate on the specified resource.
InternalError Internal unrecognized error The operation has failed due to some unknown error, exception or failure.
InvalidParameter.NullValue The parameter value is Null. The specified parameter “%s” cannot be null.
InvalidParameter.EmptyValue The parameter is blank. The specified parameter “%s” cannot be empty.
InvalidParameter.UUIDFormatInvalid The ID is not in UUID format. The parameter “%s” is invalid. A uuid must: 1) be comprised of characters[a-f], numbers[0-9]; 2) be 32 characters long.
InvalidParameter.EmptyValue The parameter value is out of the value range. The specified parameter “%s” is out of range.
InvalidParameter.ResourceNotFound The resource does not exist. The resource operated “%s” cannot be found.
InvalidParameter.ResourceDeleted The resource is deleted. The resource operated “%s” has been deleted.
InvalidParameter.BucketNameInvalid The bucket name is invalid. The bucket name “%s” is invalid. A bucket name must: 1) be comprised of lower-case characters, numbers, underscore(_) or dash(-); 2) start with lower case or numbers; 3) be between 3-255 characters long.
InvalidParameter.LocationInvalid The location is invalid. The location “%s” is invalid. A location name should be one of the five: oss-cn-hangzhou, oss-cn-shanghai, oss-cn-beijing, oss-us-west-1, and oss-cn-shenzhen.
InvalidParameter.ObjectKeyInvalid The object name is invalid. The object key “%s” is invalid. An object name must be between 1 - 1023 bytes long when encoded as UTF-8 and cannot contain LF or CR or unsupported chars in XML1.0.
InvalidParameter.JsonArrayFormatInvalid The parameter is not a JSON array. The parameter “%s” does not conform to the JSON Array specification.
Parameters.NotSupported The parameter is not supported. The Parameters “%s” are not supported the same time, select one of them.
InvalidParameter.ResourceNotSupported The resource type is not supported. The resource operated “%s” is not supported.
NotSupportedJob.SystemTemplateJobNotSupported The system template does not support high-speed transcoding. The Template “%s” is a system template, cannot be supported by boost Media Transcoding queue.
InvalidParameter.Format The parameter format is incorrect. The format of parameter “%s” is invalid.
InvalidParameter.TemplateNotFound The template cannot be found. The Template operated “%s” cannot be found.
InvalidParameter.TemplateNotSupported The template is not supported. The template operated “%s” is not supported.
InvalidParameter.NumberFormatInvalid The parameter is not a number. The number format of parameter “%s” is invalid.
ParameterNotBoolean The parameter is not a Boolean value. ParameterNotBoolean, The Parameter “%s” is not boolean value.
InvalidParameter.DigiWatermark The digital watermarking parameter is invalid. The specified parameter “%s” should include alternative of “InputFile” or (NumberMark, StringMark).
InvalidParameter.WaterMarkFileFormatNotSupported The watermarking format is not supported. The resource operated “%s” is not supported, watermark only supports png file.
InvalidParameter.InvalidDigitalWaterMarkType The digital watermarking type is invalid. The specified parameter “%s” is invalid.
InvalidParameter.ListSizeExceed The length of the parameter list exceeds the threshold. The specified parameter “%s” size exceed the limit.
InvalidParameter.InvalidBase64Format The parameter does not conform to the Base64 format and is invalid. The specified parameter “%s” must be encoded by base64_urlsafe.
InvalidParameter.ServiceNotSupportRegion The feature is not supported in this region. The parameter region “%s” has not support the open video service.
DataEncryption.ContainerFormatNotSupported The data is encrypted, and the container format is not supported. The container format only support: m3u8.
DataEncryption.CiphertextNotExist The data is encrypted, and the ciphertext does not exist. The ciphertext does not exist.
Thank you! We've received your feedback.