提交转码作业。当控制台创建的转码任务和工作流均无法满足您的使用场景时,可以按需调用SubmitJobs接口进行转码。根据您的业务逻辑配置所需的转码参数即可。
接口说明
-
转码作业为异步执行,不保证时效性。在提交转码作业后,任务会添加到管道中排队,被调度执行。所以在接口返回时,不保证转码已经完成。执行完成后需要调用查询转码作业接口轮询执行结果,或通过为管道绑定 MNS 消息接收执行结果,详细操作请参见接收消息通知。
-
输入单个文件大小最大支持 100 GB,超过可能导致执行失败。
-
使用预置智能模板对输入文件进行转码时,必须要先调用提交预置模板分析作业接口( SubmitAnalysisJob ),分析作业成功完成后可以通过调用查询模板分析作业接口( QueryAnalysisJobList )获取该输入文件的可用预置模板列表。在提交转码作业时,将 TemplateId 参数设置为可用的预置模板 ID 即可。若提交的转码作业中指定的模板不在可用的预置模板列表中,会导致转码作业失败。
-
使用预置静态模板对输入文件进行转码时,不需要提交模板分析作业。
-
如需在 MPS 服务中使用多个账号,可以为阿里云账号创建 RAM 用户,详细说明请参见创建 RAM 用户并授权。如果提交转码作业和查询转码作业使用的是不同的阿里云账号,则会导致查询不到数据。
-
更多转码常见问题,请参见媒体处理常见问题。
QPS 限制
本接口的单用户 QPS 限制为 100 次/秒。超过限制,API 调用会被限流,这可能会影响您的业务,请合理调用。更多信息,请参见 QPS 限制。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用背景高亮的方式表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
mts:SubmitJobs |
|
| 无 |
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
Input | string | 是 | 作业输入。详细说明,请参见 Input 详情。 说明
| {"Bucket":"exampleBucket","Location":"oss-cn-hangzhou","Object":"example.flv","Referer": "用户自行在OSS控制台设置的OSS防盗链参数"} |
Outputs | string | 是 | 作业输出配置。详细说明,请参见 Output 详情。
| [{"OutputObject":"exampleOutput.mp4","TemplateId":"6181666213ab41b9bc21da8ff5ff****","WaterMarks":[{"InputFile":{"Bucket":"exampleBucket","Location":"oss-cn-hangzhou","Object":"image_01.png"},"WaterMarkTemplateId":"9b772ce2740d4d55876d8b542d47****"}],"UserData":"testid-001"}] |
OutputBucket | string | 是 | 输出文件所在的 OSS Bucket。
| exampleBucket |
OutputLocation | string | 否 | 输出文件所在的 OSS Bucket 的地域(OSS Region)。
| oss-cn-hangzhou |
PipelineId | string | 是 | dd3dae411e704030b921e52698e5**** |
返回参数
示例
正常返回示例
JSON
格式
{
"JobResultList": {
"JobResult": [
{
"Job": {
"CreationTime": "2014-01-10T12:00:00Z",
"Percent": 100,
"FinishTime": "2014-01-10T12:20:00Z",
"State": "Submitted",
"JobId": "31fa3c9ca8134f9cec2b4b0b0f78****",
"Code": "InternalError",
"Message": "The operation has failed due to some unknown error, exception or failure.",
"Output": {
"Video": {
"Bufsize": "1000",
"Degrain": "5",
"BitrateBnd": {
"Max": "20",
"Min": "10"
},
"PixFmt": "yuvj420p",
"Pad": "1280:800:0:140",
"Codec": "H.264",
"Height": "1280",
"Qscale": "15",
"Crop": "1280:800:0:140",
"Bitrate": "10",
"Maxrate": "10",
"MaxFps": "15",
"Profile": "baseline",
"Crf": "22",
"Gop": "1",
"Width": "1080",
"Fps": "60",
"Preset": "veryfast",
"ScanMode": "interlaced",
"ResoPriority": "1"
},
"TransConfig": {
"IsCheckAudioBitrate": "false",
"TransMode": "onepass",
"IsCheckReso": "false",
"IsCheckVideoBitrateFail": "true",
"AdjDarMethod": "crop",
"IsCheckVideoBitrate": "false",
"IsCheckResoFail": "false",
"IsCheckAudioBitrateFail": "true"
},
"Encryption": {
"Type": "hls-aes-128",
"Key": "encryptionkey128",
"KeyType": "Base64",
"Id": "31fa3c9ca8134f9cec2b4b0b0f78****",
"KeyUri": "https://1161758785*****.cn-shanghai.fc.aliyuncs.com/2016-08-15/proxy/HLS-decyptServer/decyptServer/",
"SkipCnt": "3"
},
"WaterMarkList": {
"WaterMark": [
{
"Type": "Image",
"ReferPos": "TopRight",
"Dx": "1",
"Width": "1080",
"Height": "1280",
"InputFile": {
"Object": "example-logo-****.png",
"Location": "oss-cn-hangzhou",
"Bucket": "example-bucket"
},
"WaterMarkTemplateId": "88c6ca184c0e47098a5b665e2a12****",
"Dy": "1"
}
]
},
"WaterMarkConfigUrl": "http://example.com/configure",
"DeWatermark": "{\"0\": [{\"l\": 10,\"t\": 10,\"w\": 10,\"h\": 10},{\"l\": 100,\"t\": 0.1,\"w\": 10,\"h\": 10}],\"128000\": [],\"250000\": [{\"l\": 0.2,\"t\": 0.1,\"w\": 0.01,\"h\": 0.05}]}",
"M3U8NonStandardSupport": {
"TS": {
"SizeSupport": true,
"Md5Support": true
}
},
"Priority": "5",
"Audio": {
"Profile": "aac_low",
"Codec": "aac",
"Samplerate": "32000",
"Qscale": "15",
"Channels": "6",
"Volume": {
"Method": "auto",
"Level": "-20"
},
"Bitrate": "128"
},
"AudioStreamMap": "0:a:0",
"MergeList": {
"Merge": [
{
"Start": "00000.50",
"RoleArn": "acs:ram::<your uid>:role/<your role name>",
"MergeURL": "http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com/example-object-****.flv",
"Duration": "00000.20"
}
]
},
"SuperReso": {
"IsHalfSample": "true"
},
"UserData": "example data",
"OutSubtitleList": {
"OutSubtitle": [
{
"Map": "0:v:0",
"OutSubtitleFile": {
"RoleArn": "acs:ram::<your uid>:role/<your role name>",
"Object": "example-output.flv",
"Location": "oss-cn-hangzhou",
"Bucket": "example-bucket-****"
},
"Success": true,
"Message": "The specified parameter “%s” cannot be null."
}
]
},
"DigiWaterMark": {
"Type": "Image",
"Alpha": "1.0",
"InputFile": {
"Object": "example-intput.flv",
"Location": "oss-cn-hangzhou",
"Bucket": "example-bucket-****"
}
},
"VideoStreamMap": "0:a:0",
"OutputFile": {
"RoleArn": "acs:ram::<your uid>:role/<your role name>",
"Object": "example-output.flv",
"Location": "oss-cn-hangzhou",
"Bucket": "example-bucket-****"
},
"AmixList": {
"Amix": [
{
"Map": "0:a:0",
"Start": "0",
"AmixURL": "https://outpu***.oss-cn-shanghai.aliyuncs.com/mp4-to-mp3%5E1571025263578816%40.mp3",
"Duration": "20",
"MixDurMode": "long"
}
]
},
"Rotate": "180",
"Container": {
"Format": "flv"
},
"Clip": {
"TimeSpan": {
"Seek": "01:59:59.999",
"Duration": "01:00:59.999"
}
},
"MergeConfigUrl": "`{\"MergeList\":[{\"MergeURL\":\"http://exampleBucket****.oss-cn-hangzhou.aliyuncs.com/video_01.mp4\"}]}",
"OpeningList": {
"Opening": [
{
"openUrl": "http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com/opening_01.flv",
"Start": "1",
"Width": "1920",
"Height": "1080"
}
]
},
"MuxConfig": {
"Webp": {
"Loop": "0"
},
"Gif": {
"FinalDelay": "0",
"DitherMode": "bayer",
"Loop": "0",
"IsCustomPalette": "false"
},
"Segment": {
"Duration": "20"
}
},
"TailSlateList": {
"TailSlate": [
{
"Start": "1",
"BgColor": "White",
"IsMergeAudio": false,
"Width": "1920",
"Height": "1080",
"BlendDuration": "2",
"TailUrl": "http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com/opening_01.flv"
}
]
},
"TemplateId": "S00000000-000010",
"SubtitleConfig": {
"ExtSubtitleList": {
"ExtSubtitle": [
{
"CharEnc": "UTF-8",
"FontName": "\"WenQuanYi Zen Hei\", \"Yuanti SC Regular\", \"SimSun\"",
"Input": {
"Object": "example-output.flv",
"Location": "oss-cn-hangzhou",
"Bucket": "example-bucket-****"
}
}
]
},
"SubtitleList": {
"Subtitle": [
{
"Map": "0:a:0"
}
]
}
},
"Properties": {
"Width": "1280",
"Height": "720",
"Duration": "55",
"Fps": "25",
"Bitrate": "1000",
"FileFormat": "QuickTime / MOV",
"Streams": {
"VideoStreamList": {
"VideoStream": [
{
"Index": "0",
"Timebase": "1/24000",
"AvgFPS": "23.976025",
"PixFmt": "yuv420p",
"Sar": "1:1",
"Lang": "eng",
"CodecLongName": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"Height": "720",
"NumFrames": "25",
"Bitrate": "1496.46",
"CodecTagString": "avc1",
"HasBFrames": "2",
"Profile": "high",
"StartTime": "0.000000",
"NetworkCost": {
"PreloadTime": "8",
"AvgBitrate": "100",
"CostBandwidth": "10"
},
"Dar": "16:9",
"CodecName": "h264",
"Width": "1280",
"Duration": "17.225542",
"Fps": "23.976025",
"CodecTag": "0x31637661",
"CodecTimeBase": "1001/48000",
"Level": "51"
}
]
},
"AudioStreamList": {
"AudioStream": [
{
"Timebase": "1/44100",
"Index": "1",
"SampleFmt": "fltp",
"ChannelLayout": "stereo",
"Lang": "eng",
"Samplerate": "44100",
"CodecLongName": "AAC (Advanced Audio Coding)",
"Channels": "2",
"NumFrames": "25",
"Bitrate": "128.806",
"CodecTagString": "mp4a",
"StartTime": "0.000000",
"CodecName": "aac",
"Duration": "17.159546",
"CodecTag": "0x6134706d",
"CodecTimeBase": "1/44100"
}
]
},
"SubtitleStreamList": {
"SubtitleStream": [
{
"Index": "1",
"Lang": "eng"
}
]
}
},
"Format": {
"StartTime": "0.000000",
"NumPrograms": "0",
"Size": "3509895",
"NumStreams": "2",
"FormatLongName": "QuickTime / MOV",
"Duration": "55",
"Bitrate": "1000",
"FormatName": "mov"
},
"FileSize": "3509895"
}
},
"PipelineId": "88c6ca184c0e47098a5b665e2a126797",
"Input": {
"Object": "example.flv",
"Location": "oss-cn-hangzhou",
"Bucket": "example-bucket-****"
},
"MNSMessageResult": {
"MessageId": "123",
"ErrorMessage": "The resource operated \"%s\" cannot be found.",
"ErrorCode": "InvalidParameter.ResourceNotFound"
}
},
"Success": true,
"Code": "InvalidParameter.NullValue",
"Message": "The specified parameter \"%s\" cannot be null."
}
]
},
"RequestId": "25818875-5F78-4A45S71F6-D73936451234"
}
错误码
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 |
---|