通过以下方式节省成本并获得更多功能 AWS Elemental MediaConvert
MediaConvert 是一项较新的基于文件的视频转码服务,它提供了一套全面的高级转码功能,按需费率起价为每分钟 0.0075 美元。阅读更多
已经在使用 Amazon Elastic Transcoder? 迁移到很简单 MediaConvert。有关更多信息,请参阅本概述
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
创建管道
描述
要创建管道,可向 /2012-09-25/pipelines/
资源发送 POST 请求。
请求
语法
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 管道时指定的设置。
响应
语法
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" }, "(自动)Warnings": [ { "Code": "6000|6001|6002|6003|6004|6005|6006|6007|6008", "Message": "The code message
" }, {...} ] }
响应标头
此操作仅使用大多数响应通用的响应标头。有关通用响应标头的信息,请参阅 HTTP 响应。
响应正文
创建管道时,Elastic Transcoder 将返回在请求中指定的值。有关更多信息,请参阅 请求正文。
此外,Elastic Transcoder 将返回以下值。
- (自动)Id
-
管道的标识符。您可以使用此值来标识要在其中执行各种操作的管道,例如创建任务或预设。
- (自动)Status
-
管道的当前状态:
Active
:管道正在处理任务。Paused
:管道当前未处理任务。
(自动)Warnings
当您创建使用其他区域资源的管道时,Elastic Transcoder 会返回一个或多个警告。您的管道仍在创建中,但处理时间可能会增加并产生跨区域费用。警告的格式如下所示:
- 代码——警告代码。
-
消息——与警告代码关联的消息。
可返回的警告代码和消息如下所示:
- 6000
-
输入存储桶和管道位于不同的区域,这会增加管道中任务的处理时间,并可能产生额外费用。要缩短处理时间并防止跨区域收费,请为输入存储桶和管道使用相同的区域。
- 6001
-
ContentConfig 存储桶和管道位于不同的区域,这会增加管道中任务的处理时间,并可能产生额外费用。要缩短处理时间并防止跨区域收费,请为 ContentConfig 存储桶和管道使用相同的区域。
- 6002
-
ThumbnailConfig 存储桶和管道位于不同的区域,这会增加管道中任务的处理时间,并可能产生额外费用。要缩短处理时间并防止跨区域收费,请为 ThumbnailConfig 存储桶和管道使用相同的区域。
- 6003
-
正在进行的事件和管道的 SNS 通知主题位于不同的区域,这会增加管道中任务的处理时间,并可能产生额外费用。要缩短处理时间并防止跨区域收费,请在 SNS 通知主题和渠道中使用相同的区域。
- 6004
-
警告事件和管道的 SNS 通知主题位于不同的区域,这会增加管道中任务的处理时间,并可能产生额外费用。要缩短处理时间并防止跨区域收费,请在 SNS 通知主题和渠道中使用相同的区域。
- 6005
-
完成事件和管道的 SNS 通知主题位于不同的区域,这会增加管道中任务的处理时间,并可能产生额外费用。要缩短处理时间并防止跨区域收费,请在 SNS 通知主题和渠道中使用相同的区域。
- 6006
-
错误事件和管道的 SNS 通知主题位于不同的区域,这会增加管道中任务的处理时间,并可能产生额外费用。要缩短处理时间并防止跨区域收费,请在 SNS 通知主题和渠道中使用相同的区域。
- 6007
-
为此管道指定的 AWS KMS 密钥和 ContentConfig 存储桶位于不同的区域,这会导致使用 s3-aws-kms 加密模式的输出失败。要使用 s3-aws-kms 加密模式,请对 KMS 密钥和 ContentConfig 存储桶使用相同的区域。
- 6008
-
为此管道指定的 AWS KMS 密钥和 ThumbnailConfig 存储桶位于不同的区域,这会导致使用 s3-aws-kms 加密模式的输出失败。要使用 s3-aws-kms 加密模式,请对 KMS 密钥和 ThumbnailConfig 存储桶使用相同的区域。
错误
有关 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." }, {...} ] }