按状态列出任务 - Amazon Elastic Transcoder

通过以下方式节省成本并获得更多功能 AWS Elemental MediaConvert

MediaConvert 是一项较新的基于文件的视频转码服务,它提供了一套全面的高级转码功能,按需费率起价为每分钟 0.0075 美元。阅读更多

已经在使用 Amazon Elastic Transcoder? 迁移到很简单 MediaConvert。有关更多信息,请参阅本概述,其中包含有关迁移过程的重要信息以及指向其他资源的链接。

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

按状态列出任务

描述

要获取具有指定状态的任务列表,请向 /2012-09-25/jobsByStatus/Submitted 资源发送 GET 请求。Elastic Transcoder 会列出您最近创建的任务和当前具有指定状态的任务。

请求

语法

要获取有关过去 6 个月与当前 AWS 账户关联的具有指定状态的任务的信息,请发送以下 GET 请求。

GET /2012-09-25/jobsByStatus/Status? Ascending=true|false& PageToken=value for accessing the next page of results HTTP/1.1 Content-Type: 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

请求参数

此操作接受以下请求参数。Elastic Transcoder 将返回过去 6 个月具有指定状态的所有任务。

状态

要获取有关过去 6 个月内与当前 AWS 账户关联的具有指定状态的所有任务的信息,请指定状态:SubmittedProgressingCompleteCanceledError

升序

要按提交的日期和时间顺序列出任务,请输入 true。要按反向的时间顺序列出任务,请输入 false

PageToken

当 Elastic Transcoder 返回多个结果页面时,请使用后续 GET 请求中的 PageToken 获取每个连续的结果页面。

请求标头

此操作仅使用所有操作通用的请求标头。有关通用请求标头的信息,请参阅 HTTP 标头内容

请求正文

此操作未使用请求正文。

响应

语法

Status: 200 OK 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 { "Jobs":[ { "Id":"Id that Elastic Transcoder assigned to the job", "Inputs":[{ "Key":"name of the file to transcode", "Encryption":{ "Mode":"aes-cbc-pkcs7|aes-ctr|aes-gcm", "Key":"encrypted and base64-encoded decryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" }, "TimeSpan":{ "StartTime":"starting place of the clip, in HH:mm:ss.SSS or sssss.SSS", "Duration":"duration of the clip, in HH:mm:ss.SSS or sssss.SSS" }, "FrameRate":"auto|10|15|23.97|24|25|29.97|30|50|60", "Resolution":"auto|width in pixelsxheight in pixels", "AspectRatio":"auto|1:1|4:3|3:2|16:9", "Interlaced":"auto|true|false", "Container":"auto|aac|asf|avi|divx|flv|m4a|mkv|mov|mp2|mp3| mp4|mpeg|mpeg-ps|mpeg-ts|mxf|ogg|vob|wav|webm", "DetectedProperties":{ "Width":"video width in pixels", "Height":"video height in pixels", "FrameRate":"video frame rate in fps", "FileSize":"file size in bytes", "DurationMillis":"file duration in milliseconds" }, "InputCaptions":{ "MergePolicy":"MergeOverride|MergeRetain|Override", "CaptionSources":[ { "Key":"name of the input caption file", "Language":"language of the input caption file", "TimeOffset":"starting place of the captions, in either [-+]SS.sss or [-+]HH:mm:SS.ss", "Label":"label for the caption" "Encryption":{ "Mode":"aes-cbc-pkcs7|aes-ctr|aes-gcm", "Key":"encrypted and base64-encoded decryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" }, }, {...} ] } }, {...}], "OutputKeyPrefix":"prefix for file names in Amazon S3 bucket", "Outputs":[{ "Id":"sequential counter", "Key":"name of the transcoded file", "Encryption":{ "Mode":"s3||aes-cbc-pkcs7|aes-ctr| aes-gcm", "Key":"encrypted and base64-encoded encryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" }, "ThumbnailPattern":""|"pattern", "Rotate":"auto|0|90|180|270", "PresetId":"preset to use for the job", "SegmentDuration":"[1,60]", "Watermarks":[ { "InputKey":"name of the .png or .jpg file", "Encryption":{ "Mode":"s3||aes-cbc-pkcs7| aes-ctr|aes-gcm", "Key":"encrypted and base64-encoded encryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" }, "PresetWatermarkId":"value of Video:Watermarks:Id in preset" }, {...} ], "AlbumArt":[ { "AlbumArtMerge":"Replace|Prepend|Append|Fallback", "AlbumArtArtwork":"can be empty, but not null":[ { "AlbumArtInputKey":"name of the file to use as album art", "Encryption":{ "Mode":"s3||aes-cbc-pkcs7| aes-ctr|aes-gcm", "Key":"encrypted and base64-encoded encryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" }, "AlbumArtMaxWidth":"maximum width of output album art in pixels", "AlbumArtMaxHeight":"maximum height of output album art in pixels", "AlbumArtSizingPolicy":"Fit|Fill|Stretch|Keep| ShrinkToFit|ShrinkToFill", "AlbumArtPaddingPolicy":"Pad|NoPad", "AlbumArtFormat":"jpg|png" }, {...} ] }, {...}], "Duration":"duration in seconds", "DurationMillis":"duration in milliseconds", "Height":"height in pixels", "Width":"width in pixels", "FrameRate":"frame rate in fps", "FileSize":"file size in bytes", "Status":"Submitted|In Progress|Complete|Error", "StatusDetail":"detail associated with Status", "Captions":{ "CaptionFormats":[ { "Format":"cea-708|dfxp|mov-text|scc|srt|webvtt", "Pattern":"myCaption/file-language", "Encryption":{ "Mode":"s3||aes-cbc-pkcs7| aes-ctr|aes-gcm", "Key":"encrypted and base64-encoded encryption key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector" } }, {...} ] }, "AppliedColorSpaceConversion":"None|Bt601ToBt709| Bt709ToBt601" }, {...} ], "Playlists":[ { "Format":"HLSv3|HLSv4|MPEG-DASH|Smooth", "Name":"name", "OutputKeys":[ "Outputs:Key to include in this playlist", {...} ], "HlsContentProtection":{ "Method":"aes-128", "Key":"encrypted and base64-encoded protection key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector", "LicenseAcquisitionUrl":"license acquisition url", "KeyStoragePolicy":"NoStore|WithVariantPlaylists" }, "PlayReadyDrm":{ "Format":"microsoft|discretix-3.0", "Key":"encrypted and base64-encoded DRM key", "KeyId":"id of the DRM key", "KeyMd5":"base64-encoded key digest", "InitializationVector":"base64-encoded initialization vector", "LicenseAcquisitionUrl":"license acquisition url" } }, {...} ], "UserMetadata": { "Key":"Value", "Second user metadata key":"Second user metadata value" }, "PipelineId":"PipelineId for the job", "Status":"Submitted|Progressing|Complete|Canceled|Error", "Timing":{ "SubmitTimeMillis":"job submitted time in epoch milliseconds", "StartTimeMillis":"job start time in epoch milliseconds", "FinishTimeMillis":"job finish time in epoch milliseconds" } }, {...} ], "NextPageToken":value for accessing the next page of results|null }

响应标头

此操作仅使用大多数响应通用的响应标头。有关通用响应标头的信息,请参阅 HTTP 响应

响应正文

对于满足搜索条件的每个任务,响应正文均包含一个元素,而且每个元素均包含您在创建任务时指定的值。有关任务值的更多信息,请参阅 您在创建 Elastic Transcoder 任务时指定的设置

此外,Elastic Transcoder 将返回以下值。

(自动)Id

Elastic Transcoder 为任务分配的标识符。您使用该值获取任务的设置或删除任务。

(自动)Inputs:DetectedProperties

检测到的输入文件的属性。Elastic Transcoder 从输入文件识别这些值。

(自动)Inputs:Width

检测到的输入文件宽度(以像素为单位)。

(自动)Inputs:Height

检测到的输入文件高度(以像素为单位)。

(自动)Inputs:FrameRate

检测到的输入文件帧率(以每秒帧数为单位)。

(自动)Inputs:FileSize

检测到的输入文件大小(以字节为单位)。

(自动)Inputs:DurationMillis

检测到的输入文件持续时间(以毫秒为单位)。

(自动)Outputs:Id

以 1 开头的顺序计数器,用于在当前任务的输出中标识输出。在 Output 语法中,此值始终为 1

(自动)Outputs:Duration

输出文件的持续时间(以秒为单位),向上取整。

(自动)Outputs:DurationMillis

输出文件的持续时间(以毫秒为单位)。

(自动)Outputs:Width

输出文件的宽度(以像素为单位)。

(自动)Outputs:Height

输出文件的高度(以像素为单位)。

(自动)Outputs:FrameRate

输出文件的帧率(以每秒帧数为单位)。

(自动)Outputs:FileSize

输出文件的文件大小(以字节为单位)。

(自动)Outputs:Status

任务中一个输出的状态。如果您只为该任务指定了一个输出,则 Outputs:Status 始终与 Job:Status 相同。如果您指定了多个输出:

  • 所有输出的 Job:StatusOutputs:Status 都是 Submitted,直到 Elastic Transcoder 开始处理第一个输出。

  • 当 Elastic Transcoder 开始处理第一个输出时,该输出的 Outputs:StatusJob:Status 都更改为 Progressing。对于每个输出,Outputs:Status 的值将保持为 Submitted,直到 Elastic Transcoder 开始处理输出。

  • Job:Status 保持为 Progressing,直到所有输出都达到终端状态,Complete 或者 Error

  • 当所有输出都达到终端状态时,仅当所有输出的 Outputs:Status 都是 Complete 时,Job:Status 才会更改为 Complete。如果一个或多个输出的 Outputs:StatusError,则 Job:Status 的终端状态也是 Error

Status 的值为以下值之一:SubmittedProgressingCompleteCanceledError

(自动)Outputs:StatusDetail

进一步解释 Outputs:Status 的信息。

(自动) Outputs:AppliedColorSpaceConversion

如果 Elastic Transcoder 使用带有 ColorSpaceConversionMode 的预设对输出文件进行转码,则 AppliedColorSpaceConversion 参数会显示所使用的转换。如果在预设中未定义 ColorSpaceConversionMode,则此参数将不会包含在任务响应中。

(自动)Status

如果您为任务指定了多个输出,则为整个任务的状态。当 Elastic Transcoder 开始处理任务时,Job:Status 的值会更改为 Progressing,并且在 Elastic Transcoder 完成对所有输出的处理之前不会发生变化。处理完成后,Job:Status 更改为 Complete,如果有任何输出失败,则更改为 Error

如果您只为该任务指定了一个输出,则 Job:StatusOutputs:Status 相同。

Job:Status 的值为以下值之一:SubmittedProgressingCompleteCanceledError

(自动)Timing

有关任务时间的详细信息。

(自动)Timing:SubmitTimeMillis

任务提交给 Elastic Transcoder 的时间(以纪元毫秒为单位)。

(自动)Timing:StartTimeMillis

任务开始转码的时间(以纪元毫秒为单位)。

(自动)Timing:FinishTimeMillis

任务完成转码的时间(以纪元毫秒为单位)。

要了解有关纪元时间的更多信息,请访问 Wikipedia 上的纪元计算页面。

(自动)NextPageToken

用于访问第二页及后续结果页的值(如果有)。当指定管道中的任务适合放在一页上时,或当您已到达结果的最后一页时,NextPageToken 的值为 null

错误

有关 Elastic Transcoder 异常和错误消息的信息,请参阅 处理 Elastic Transcoder 中的错误

示例

以下示例请求创建一个任务。

示例请求

以下示例请求获取过去 6 个月创建的状态为 Complete 的所有任务的列表。

GET /2012-09-25/jobsByStatus/Complete?Ascending=true HTTP/1.1 Content-Type: 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

示例响应

Status: 200 OK 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 { "Jobs":[ { "Id":"3333333333333-abcde3", "Input":[{ "Key":"cooking/lasagna.mp4", "FrameRate":"auto", "Resolution":"auto", "AspectRatio":"auto", "Interlaced":"auto", "Container":"mp4", "InputCaptions"{ "MergePolicy":"MergeOverride", "CaptionSources":[ { "Key":"scc/lasagna-kindlefirehd.scc", "Language":"en", "Label":"English" }, { "Key":"srt/lasagna-kindlefirehd.srt", "Language":"fr", "TimeOffset":"1:00:00", "Label":"French" } ] }, "DetectedProperties":{ "Width":"1280", "Height":"720", "FrameRate":"30.00", "FileSize":"5872000", "DurationMillis":"1003000" } }], "OutputKeyPrefix":"", "Outputs":[ { "Id":"1", "Key":"mp4/lasagna-kindlefirehd.mp4", "ThumbnailPattern":"mp4/thumbnails/lasagna-{count}", "Rotate":"0", "PresetId":"1351620000000-100080", "Watermarks":[ { "InputKey":"logo/128x64.png", "PresetWatermarkId":"company logo 128x64", } ], "Duration":"1003", "DurationMillis":"1003000", "Width":"1280", "Height":"720", "FrameRate":"30.00", "FileSize":"5872000", "Status":"Complete", "StatusDetail":"", "Captions":{ "CaptionFormats":[ { "Format":"scc", "Pattern":"scc/lasagna-{language}" }, { "Format":"srt", "Pattern":"srt/lasagna-{language}" }, { "Format":"mov-text" } ] }, "AppliedColorSpaceConversion":"None" }, { "Id":"2", "Key":"iphone/lasagna-1024k", "ThumbnailPattern":"iphone/th1024k/lasagna-{count}", "Rotate":"0", "PresetId":"1351620000000-987654", "SegmentDuration":"5", "Duration":"1003", "DurationMillis":"1003000", "Width":"1136", "Height":"640", "FrameRate":"30.00", "FileSize":"4718600", "Status":"Complete", "StatusDetail":"" }, ], "PipelineId":"1111111111111-abcde1", "Playlists":[ { "Format":"HLSv3", "Name":"playlist-iPhone-lasagna.m3u8", "OutputKeys":[ "iphone/lasagna-1024k", "iphone/lasagna-512k" ] } ], "Timing":{ "SubmitTime":"1427212800000", "StartTime":"1427212856000", "FinishTime":"1427212875000" }, "Status":"Complete" }, { "Id":"4444444444444-abcde4", "Input":{ "Key":"cooking/spaghetti.mp4", "FrameRate":"auto", "Resolution":"auto", "AspectRatio":"auto", "Interlaced":"auto", "Container":"mp4", "DetectedProperties":{ "Width":"1280", "Height":"720", "FrameRate":"30.00", "FileSize":"5872000", "DurationMillis":"1003000" } }, "Outputs":[ { "Id":"3", "Key":"iphone/spaghetti-512k", "ThumbnailPattern":"iphone/th512k/spaghetti-{count}", "Rotate":"0", "PresetId":"1351620000000-456789", "SegmentDuration":"5", "Watermarks":[ { "InputKey":"logo/128x64.png", "PresetWatermarkId":"company logo 128x64" } ], "Duration":"1003", "DurationMillis":"1003000", "Width":"1136", "Height":"640", "FrameRate":"30.00", "FileSize":"5872000", "Status":"Complete", "StatusDetail":"" } ], "Playlists":[ { "Format":"HLSv3", "Name":"playlist-iPhone-spaghetti.m3u8", "OutputKeys":[ "iphone/spaghetti-512k" ] } ], "UserMetadata": { "Food type":"Italian", "Cook book":"recipe notebook" }, "Status":"Complete", "Timing":{ "SubmitTime":"1427212800000", "StartTime":"1427212856000", "FinishTime":"1427212875000" } } ], "NextPageToken":null }