全部产品
媒体转码

提交转码作业

更新时间:2017-08-31 16:36:37   分享:   

提交转码作业

描述

批量提交转码作业接口,一个转码输出会生成一个转码作业,接口返回转码作业列表。作业会添加到管道中被调度执行,执行完成后需要调用“查询转码作业”接口轮询作业执行结果,也可使用异步通知机制。

  • 使用预置模板对输入文件进行转码,须要先调用“提交模板分析作业”接口(SubmitAnalysisJob),分析作业成功完成后可以通过调用“查询模板分析作业”接口(QueryAnalysisJobList)获取该输入文件的可用预置模版列表。若提交的转码作业中指定的预置模板不在可用的预置模板列表中,则转码作业会失败。

请求参数

名称 类型 必填项 描述
Action String 操作接口名,系统规定参数,取值: SubmitJobs
Input String 作业输入,JSON对象,Input定义详见附录-参数详情-19 转码作业输入详情 。例如:
{
"Bucket":"example-bucket",
"Location":"oss-cn-hangzhou",
"Object":"example.flv"
}
需在控制台中完成云资源授权。
OutputBucket String 输出Bucket,需在控制台中完成云资源授权。
OutputLocation String 输出 Bucket 所在数据中心,默认值是oss-cn-hangzhou。
Outputs String Outputs由Output列表构成,JSON数组,大小上限为30,Output的定义详见术语表。Output的参数说明见附录 参数Output详情。例如:
[{
"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 管道ID,管道的定义详见术语表;若需要异步通知,须保证此管道绑定了可用的消息主题。

返回参数

名称 类型 描述
JobResultList AliyunJobResult[ ] 提交转码作业结果列表

示例

请求示例

  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&公共参数>

返回示例

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. }

转码错误码

错误代码 描述 详细信息
InvalidParameter.ResourceContentBad 转码源文件内容已经损坏导致转码失败 The resource operated is bad
PermissionDenied.ResourceAccess 授权存在问题 MTS not authorized to operate on the specified resource
InternalError 内部未识别错误 The operation has failed due to some unknown error, exception or failure
InvalidParameter.NullValue 参数为Null错误 The specified parameter “%s” cannot be null
InvalidParameter.EmptyValue 参数为空错误 The specified parameter “%s” can not be empty
InvalidParameter.UUIDFormatInvalid ID不符合UUID格式 The parameter “%s” is invalid.A uuid must:1)be comprised of chracters[a-f],numbers[0-9];2)be 32 characters long
InvalidParameter.OutOfRange 参数超过范围 The specified parameter “%s” is out of range
InvalidParameter.ResourceNotFound 资源不存在 The resource operated “%s” cannot be found
InvalidParameter.ResourceDeleted 资源已经被删除 The resource operated “%s” has been deleted
InvalidParameter.BucketNameInvalid Bucket名称无效 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 Location无效 The location “%s” is invalid. A location name should be one of five:oss-cn-hangzhou,oss-cn-shanghai,oss-cn-beijing,oss-us-west-1,oss-cn-shenzhen
InvalidParameter.ObjectKeyInvalid Object名称无效 The object key “%s” is invalid. An object name should 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 不是JSON数组 The parameter “%s” does not conform to the JSON Array specification
Parameters.NotSupported 参数不支持 The Parameters “%s” is not supported the same time,choose one of them
InvalidParameter.ResourceNotSupported 不支持的资源类型 The resource operated “%s” is not supported
NotSupportedJob.SystemTemplateJobNotSupported 倍速转码不支持的系统模板 The Template “%s” is a system template,cannot be supported by boost pipeline”
InvalidParameter.Format 参数格式无效 The format of parameter “%s” is invalid
InvalidParameter.TemplateNotFound 没有找到模板 The Template operated “%s” cannot be found
InvalidParameter.TemplateNotSupported 模板不支持 The template operated “%s” is not supported
InvalidParameter.NumberFormatInvalid 参数不是数字类型 he number format of parameter “%s” is invalid
ParameterNotBoolean 参数不是布尔类型 ParameterNotBoolean”, “The Parameter “%s” is not boolean value
InvalidParameter.DigiWatermark 数字水印参数无效 The specified parameter “%s” should include alternative of “InputFile” or “(NumberMark,StringMark)
InvalidParameter.WaterMarkFileFormatNotSupported 水印文件格式不支持 The resource operated “%s” is not supported, watermark only supports png file
InvalidParameter.InvalidDigitalWaterMarkType 无效的数字水印类型 The specified parameter “%s” is invalid.
InvalidParameter.ListSizeExceed 参数列表长度超过限制 The specified parameter “%s” size exceed
InvalidParameter.InvalidBase64Format 不符合Base64格式,参数无效 The specified parameter “%s” should be encoded by base64_urlsafe
InvalidParameter.ServiceNotSupportRegion 功能不支持区域 The parameter region “%s” has not support the open video service
DataEncryption.ContainerFormatNotSupported 数据加密,容器格式不支持 The container format only support: m3u8
DataEncryption.CiphertextNotExist 数据加密,密文不存在 The ciphertext does not exist
本文导读目录
本文导读目录
以上内容是否对您有帮助?