建立管道 - Amazon Elastic Transcoder

節省成本並獲得更多功能 AWS Elemental MediaConvert

MediaConvert 是一項較新的檔案型視訊轉碼服務,提供全方位的進階轉碼功能,按需費率從每分鐘 $0.0075 起。閱讀更多

已經使用 Amazon Elastic Transcoder? 遷移到 MediaConvert. 如需詳細資訊,請參閱此概觀,其中包含有關移轉程序的重要資訊以及其他資源的連結。

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

建立管道

Description (描述)

欲建立管道,請將 POST 請求傳送到 /2012-09-25/pipelines/ 資源。

請求

Syntax (語法)

POST /2012-09-25/pipelines HTTP/1.1 Content-Type: application/json; charset=UTF-8 Accept: */* Host: elastictranscoder.Elastic Transcoder endpoint.amazonaws.com:443 x-amz-date: 20130114T174952Z Authorization: AWS4-HMAC-SHA256 Credential=AccessKeyID/request-date/Elastic Transcoder endpoint/elastictranscoder/aws4_request, SignedHeaders=host;x-amz-date;x-amz-target, Signature=calculated-signature Content-Length: number of characters in the JSON string { "Name":"pipeline name", "InputBucket":"Amazon S3 bucket that contains files to transcode and graphics to use as watermarks", "OutputBucket":"Use this, or use ContentConfig:Bucket plus ThumbnailConfig:Bucket", "Role":"IAM role ARN", "AwsKmsKeyArn":"AWS-KMS key arn of the AWS-KMS key you want to use with this pipeline", "Notifications":{ "Progressing":"SNS topic to notify when Elastic Transcoder has started to process the job", "Complete":"SNS topic to notify when Elastic Transcoder has finished processing the job", "Warning":"SNS topic to notify when Elastic Transcoder encounters a warning condition" "Error":"SNS topic to notify when Elastic Transcoder encounters an error condition" }, "ContentConfig":{ "Bucket":"Use this plus ThumbnailConfig:Bucket, or use OutputBucket", "Permissions":[ { "GranteeType":"Canonical|Email|Group", "Grantee":"AWS user ID or CloudFront origin access identity"| "registered email address for AWS account"| AllUsers|AuthenticatedUsers|LogDelivery", "Access":[ "Read|ReadAcp|WriteAcp|FullControl", ... ] }, {...} ], "StorageClass":"Standard|ReducedRedundancy" }, "ThumbnailConfig":{ "Bucket":"Use this plus ContentConfig:Bucket, or use OutputBucket", "Permissions":[ { "GranteeType":"Canonical|Email|Group", "Grantee":"AWS user ID or CloudFront origin access identity"| "registered email address for AWS account"| AllUsers|AuthenticatedUsers|LogDelivery", "Access":[ "Read|ReadAcp|WriteAcp|FullControl", ... ] }, {...} ], "StorageClass":"Standard|ReducedRedundancy" } }

請求參數

此操作不使用請求參數。

請求標頭

此操作僅使用所有操作常見的請求標頭。如需常見請求標頭的資訊,請參閱 HTTP 標頭內容

請求主體

請求本文的 JSON 字串包含 CreatePipeline 操作的輸入物件。如需輸入物件的詳細資訊,請參閱您在建立 Elastic Transcoder 管道時指定的設定

回應

Syntax (語法)

Status: 201 Created x-amzn-RequestId: c321ec43-378e-11e2-8e4c-4d5b971203e9 Content-Type: application/json Content-Length: number of characters in the response Date: Mon, 14 Jan 2013 06:01:47 GMT { "Pipeline":{ "Id":"Id for the new pipeline", "Name":"pipeline name", "InputBucket":"Amazon S3 bucket that contains files to transcode and graphics to use as watermarks", "OutputBucket":"Use this, or use ContentConfig:Bucket plus ThumbnailConfig:Bucket", "Role":"IAM role ARN", "AwsKmsKeyArn":"AWS-KMS key arn of the AWS-KMS key you want to use with this pipeline", "Notifications":{ "Progressing":"SNS topic to notify when Elastic Transcoder has started to process the job", "Complete":"SNS topic to notify when Elastic Transcoder has finished processing the job", "Warning":"SNS topic to notify when Elastic Transcoder encounters a warning condition", "Error":"SNS topic to notify when Elastic Transcoder encounters an error condition" }, "ContentConfig":{ "Bucket":"Use this plus ThumbnailConfig:Bucket, or use OutputBucket", "Permissions":[ { "GranteeType":"Canonical|Email|Group", "Grantee":"AWS user ID or CloudFront origin access identity"| "registered email address for AWS account| AllUsers|AuthenticatedUsers|LogDelivery", "Access":[ "Read|ReadAcp|WriteAcp|FullControl", ... ] }, {...} ], "StorageClass":"Standard|ReducedRedundancy" }, "ThumbnailConfig":{ "Bucket":"Use this plus ContentConfig:Bucket, or use OutputBucket", "Permissions":[ { "Access":[ "Read|ReadAcp|WriteAcp|FullControl", ... ], "Grantee":"AWS user ID or CloudFront origin access identity"| "registered email address for AWS account| AllUsers|AuthenticatedUsers|LogDelivery", "GranteeType":"Canonical|Email|Group" }, {...} ], "StorageClass":"Standard|ReducedRedundancy" }, "Status":"Active|Paused" }, "(自動) 警告": [ { "Code": "6000|6001|6002|6003|6004|6005|6006|6007|6008", "Message": "The code message" }, {...} ] }

回應標頭

此操作僅使用大部分回應常見的回應標頭。如需常見回應標頭的資訊,請參閱 HTTP 回應

回應內文

建立管道時,Elastic Code 會回傳您在請求內指定的值。如需詳細資訊,請參閱 請求主體

此外,Elastic Transcoder 會回傳下列值。

Id (自動) Id

管道的標識符。您可以使用此值來標識要在其中執行各種操作(例如創建作業或預設)的管道。

Status (自動) Status

管道的目前狀態:

  • Active:管道正在處理作業。

  • Paused:管道當前未處理作業。

(自動) 警告

當您創建使用其他區域中的資源的管道時,Elastic Transcoder 會返回一個或多個警告。您的管道仍在創建,但可能會增加處理時間並產生跨區域費用。警告的格式如下:

程式碼
— 警告代碼。

Message― 警告代碼相關聯的訊息。

可回傳的警告代碼和訊息如下:

6000

輸入存儲桶和管道位於不同的區域,這會增加管道中作業的處理時間,並可能產生額外費用。要縮短處理時間並防止跨區域收費,請對輸入存儲桶和管道使用相同的區域。

6001

CONTENTConfig 存儲桶和管道位於不同的區域,這會增加管道中作業的處理時間,並可能產生額外費用。要縮短處理時間並防止跨區域收費,請對 CONTENTConfig 存儲桶和管道使用相同的區域。

6002

ThumNailConfig 存儲桶和管道位於不同的區域,這會增加管道中作業的處理時間,並可能產生額外費用。要縮短處理時間並防止跨區域收費,請對 ThunailConfig 存儲桶和管道使用相同的區域。

6003

正在進行的事件和管道的 SNS 通知主題位於不同區域,這會增加管道中作業的處理時間,並可能產生額外費用。要縮短處理時間並防止跨區域收費,請對 SNS 通知主題和管道使用相同的區域。

6004

警告事件和管道的 SNS 通知主題位於不同的區域,這會增加管道中作業的處理時間,並可能產生額外費用。要縮短處理時間並防止跨區域收費,請對 SNS 通知主題和管道使用相同的區域。

6005

完成事件和管道的 SNS 通知主題位於不同的區域,這會增加管道中作業的處理時間,並可能產生額外費用。要縮短處理時間並防止跨區域收費,請對 SNS 通知主題和管道使用相同的區域。

6006

錯誤事件和管道的 SNS 通知主題位於不同的區域,這會增加管道中作業的處理時間,並可能產生額外費用。要縮短處理時間並防止跨區域收費,請對 SNS 通知主題和管道使用相同的區域。

6007

為此管道指定的 AWS KMS 密鑰和 CONTENTConfig 存儲桶位於不同的區域,這會導致使用 s3-aws-km 加密模式的輸出失敗。要使用 s3-aws-km 加密模式,請對 KMS 密鑰和內容配置存儲桶使用相同的區域。

6008

為此管道指定的 AWS KMS 密鑰和縮略圖配置存儲桶位於不同的區域,這會導致使用 s3-aws-km 加密模式的輸出失敗。要使用 s3-aws-km 加密模式,請對 KMS 密鑰和縮略圖配置存儲桶使用相同的區域。

錯誤

如需 Elastic Transcoder 例外和錯誤訊息的詳細資訊,請參處理 Elastic Transcoder 中的錯誤

範例

以下範例請求建立名為 Default 的管道。

請求範例

POST /2012-09-25/pipelines HTTP/1.1 Content-Type: application/json; charset=UTF-8 Accept: */* Host: elastictranscoder.Elastic Transcoder endpoint.amazonaws.com:443 x-amz-date: 20130114T174952Z Authorization: AWS4-HMAC-SHA256 Credential=AccessKeyID/request-date/Elastic Transcoder endpoint/elastictranscoder/aws4_request, SignedHeaders=host;x-amz-date;x-amz-target, Signature=calculated-signature Content-Length: number of characters in the JSON string { "Name":"Default", "InputBucket":"salesoffice.example.com-source", "Role":"arn:aws:iam::123456789012:role/Elastic_Transcoder_Default_Role", "AwsKmsKeyArn":"base64-encoded key from KMS", "Notifications":{ "Progressing":"", "Complete":"", "Warning":"", "Error":"arn:aws:sns:us-east-1:111222333444:ET_Errors" }, "ContentConfig":{ "Bucket":"salesoffice.example.com-public-promos", "Permissions":[ { "GranteeType":"Email", "Grantee":"marketing-promos@example.com", "Access":[ "FullControl" ] } ], "StorageClass":"Standard" }, "ThumbnailConfig":{ "Bucket":"salesoffice.example.com-public-promos-thumbnails", "Permissions":[ { "GranteeType":"Email", "Grantee":"marketing-promos@example.com", "Access":[ "FullControl" ] } ], "StorageClass":"ReducedRedundancy" } }

回應範例

Status: 201 Created x-amzn-RequestId: c321ec43-378e-11e2-8e4c-4d5b971203e9 Content-Type: application/json Content-Length: number of characters in the response Date: Mon, 14 Jan 2013 06:01:47 GMT { "Pipeline":{ "Id":"1111111111111-abcde1", "Name":"Default", "InputBucket":"salesoffice.example.com-source", "Role":"arn:aws:iam::123456789012:role/Elastic_Transcoder_Default_Role", "AwsKmsKeyArn":"base64-encoded key from KMS", "Notifications":{ "Complete":"", "Error":"arn:aws:sns:us-east-1:111222333444:ET_Errors", "Progressing":"", "Warning":"" }, "ContentConfig":{ "Bucket":"salesoffice.example.com-public-promos", "Permissions":[ { "GranteeType":"Email", "Grantee":"marketing-promos@example.com", "Access":[ "FullControl" ] } ], "StorageClass":"Standard" }, "ThumbnailConfig":{ "Bucket":"salesoffice.example.com-public-promos-thumbnails", "Permissions":[ { "GranteeType":"Email", "Grantee":"marketing-promos@example.com", "Access":[ "FullControl" ] } ], "StorageClass":"ReducedRedundancy" }, "Status":"Active" }, "Warnings": [ { "Code": "6000", "Message": "The input bucket and the pipeline are in different regions, which increases processing time for jobs in the pipeline and can incur additional charges. To decrease processing time and prevent cross-regional charges, use the same region for the input bucket and the pipeline." }, {...} ] }