提交轉碼作業介面,一個轉碼輸出會產生一個轉碼作業,介面返迴轉碼作業列表。作業會添加到管道中被調度執行,執行完成後需要調用查詢轉碼作業介面輪詢作業執行結果,也可使用非同步通知機制。

说明 使用預置模板對輸入檔案進行轉碼,須要先調用 提交模板分析作業介面( 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[ ] 提交轉碼作業結果清單

樣本

請求樣本
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
<SubmitJobsResponse>
        <RequestId>25818875-5F78-4A13-BEF6-D7393642CA58</RequestId>
        <JobResultList list="true">
            <JobResult>
                <Success>true</Success>
                <Code> </Code>
                <Message> </Message>
                <Job>
                    <JobId>31fa3c9ca8134f9cec2b4b0b0f787830</JobId>
                    <Input>
                        <Bucket>example-bucket</Bucket>
                        <Location>oss-cn-hangzhou</Location>
                        <Object>example.flv</Object>
                    </Input>
                    <Output>
                         <OutputFile>
                            <Bucket>example-bucket</Bucket>
                            <Location>oss-cn-hangzhou</Location>
                            <Object>example-output.flv</Object>
                        </OutputFile>
                        <TemplateId>S00000000-000010</TemplateId>
                        <WaterMarkList list="true">
                            <WaterMark>
                                <InputFile>
                                    <Bucket>example-logo-bucket</Bucket>
                                    <Location>0ss-cn-hangzhou</Location>
                                    <Object>example-logo.png</Object>
                                </InputFile>
                                <WaterMarkTemplateId>88c6ca184c0e47098a5b665e2a126797</WaterMarkTemplateId>
                            </WaterMark>
                        </WaterMarkList>
                        <UserData>testid-001</UserData>
                    </Output>
                    <State>Submitted</State>
                    <Code> </Code>
                    <Message> </Message>
                    <Percent>0</Percent>
                    <PipelineId>88c6ca184c0e47098a5b665e2a126797</PipelineId>
                    <CreationTime>2014-01-10T12:00:00Z</CreationTime>
                </Job>
            </JobResult>
        </JobResultList>
    </SubmitJobsResponse>
JSON
{
        "RequestId": "25818875-5F78-4A13-BEF6-D7393642CA58",
        "JobResultList": {
            "JobResult": [{
                "Success": true,
                "Code": "",
                "Message": "",
                "Job": {
                    "JobId": "31fa3c9ca8134f9cec2b4b0b0f787830",
                    "Input": {
                            "Bucket": "example-bucket",
                            "Location": "oss-cn-hangzhou",
                            "Object": "example.flv"
                    },
                    "Output": {
                        "OutputFile": {
                            "Bucket": "example-bucket",
                            "Location": "oss-cn-hangzhou",
                            "Object": "example-output.flv"
                        },
                        "TemplateId": "S00000000-000010",
                        "WaterMarkList": {
                            "WaterMark": [{
                                 "InputFile": {
                                    "Bucket": "example-bucket",
                                    "Location": "oss-cn-hangzhou",
                                    "Object": "example-logo.png"
                                },
                                "WaterMarkTemplateId": "88c6ca184c0e47098a5b665e2a126797"
                            }]
                        },
                        "UserData":"testid-001"
                    },
                    "State": "Submitted",
                    "Code": "",
                    "Message": "",
                    "Percent": 0,
                    "PipelineId": "88c6ca184c0e47098a5b665e2a126797",
                    "CreationTime”:”2014-01-10T12:00:00Z"
                }
            }]
        }
    }

轉碼錯誤碼

錯誤碼 描述 詳細資料
InvalidParameter.ResourceContentBad 轉碼源檔案內容已經損壞導致轉碼失敗 The resource operated is broken.
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 must be one of the five: oss-cn-hangzhou, oss-cn-shanghai, oss-cn-beijing, oss-us-west-1 and 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” must 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 limits.
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.