SubmitJobs API は、トランスコード タスクを送信します。トランスコードの出力の場合、トランスコード タスクを生成します。本 API は、トランスコード タスクのリストを返します。タスクは、 MPS キューに追加され、スケジューリングされ、実行されます。タスクが実行された後に、「トランスコード タスクを照会」する API を呼び出し、タスクの実行結果をポーリングします。非同期通知を使用できます。
プリセット トランスコード テンプレートを使用する場合は、API SubmitAnalysisJob を呼び出してテンプレート分析を実行してから API QueryAnalysisJobList を呼び出し、入力ファイルで利用可能なプリセット トランスコード テンプレートのリストを取得します。利用可能なプリセット テンプレートのリストに、実行されたトランスコード タスクに指定されたプリセット テンプレートがない場合は、トランスコード タスクに失敗します。
リクエスト パラメーター
パラメーター | タイプ | 必須かどうか | 説明 |
---|---|---|---|
Action | String | はい | 操作の API、システム必須パラメーター。パラメーターの値は、 SubmitJobs にします。 |
Input | String | はい | ジョブ入力。JSON オブジェクト。Input の定義については、付録 - パラメーター詳細 - トランスコード タスク 入力の詳細 19 をご参照ください。 例:{
"Bucket":"example-bucket",
"Location":"oss-cn-hangzhou",
"Object":"example.flv"
} コンソール上で、クラウド リソースに権限を付与しておく必要があります。
|
OutputBucket | String | はい | 出力バケット。コンソール上で、クラウド リソースに権限を付与しておく必要があります。 |
OutputLocation | String | いいえ | 出力バケットの属するデータセンター。デフォルト値は oss-cn-hangzhou です。 |
Outputs | String | はい | Outputs は Output リストで構成されており、JSON 配列で、Outputパラメーターは最大30個です。出力定義については、用語集を参照してください。Output
パラメーターの詳細については、「付録」の「パラメーター」の「2. 出力」をご参照ください。例:[{
"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 | はい | MPS キュー ID。 MPS キューの定義については、用語集をご参照ください。非同期通知が必要な場合は、MPS キューが利用可能なメッセージの件名にバインドされていることをご確認ください。 |
応答パラメーター
名前 | タイプ | 説明 |
---|---|---|
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&Public Parameters>
応答例
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 is 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” cannot be empty. |
InvalidParameter.UUIDFormatInvalid | ID が UUID 形式ではありません。 | 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 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 | 無効なバケット名です。 | 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 “%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 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 | パラメータが JSON 配列ではありません。 | The parameter “%s” does not conform to the JSON Array specification. |
Parameters.NotSupported | サポートされていないパラメーターです。 | The Parameters “%s” are not supported the same time, select 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 Media Transcoding queue. |
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 | パラメーターが数値ではありません。 | The number format of parameter “%s” is invalid. |
ParameterNotBoolean | パラメーターが Boolean ではありません。 | 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 the limit. |
InvalidParameter.InvalidBase64Format | パラメーターが Base64 形式に準拠していないため、無効です。 | The specified parameter “%s” must 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. |