

终止支持通知：2025 年 11 月 13 日， AWS 我们将停止对亚马逊 Elastic Transcoder 的支持。2025 年 11 月 13 日之后，您将无法再访问 Elastic Transcoder 控制台或 Elastic Transcoder 资源。

有关过渡到的更多信息 AWS Elemental MediaConvert，请访问此[博客文章](https://aws.amazon.com/blogs/media/how-to-migrate-workflows-from-amazon-elastic-transcoder-to-aws-elemental-mediaconvert/)。

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

# 按管道列出任务
<a name="list-jobs-by-pipeline"></a>

**Topics**
+ [描述](#list-jobs-by-pipeline-description)
+ [请求](#list-jobs-by-pipeline-requests)
+ [响应](#list-jobs-by-pipeline-responses)
+ [错误](#list-jobs-by-pipeline-response-errors)
+ [示例](#list-jobs-by-pipeline-examples)

## 描述
<a name="list-jobs-by-pipeline-description"></a>

要获取已分配给管道的任务的列表，请将 GET 请求发送到 `/2012-09-25/jobsByPipeline/pipelineId` 资源。按管道列出任务时，Elastic Transcoder 将列出您最近为指定管道创建的任务。

## 请求
<a name="list-jobs-by-pipeline-requests"></a>

### 语法
<a name="list-jobs-by-pipeline-request-syntax"></a>

要获取有关管道中的当前任务的信息，请发送以下 GET 请求。

```
GET /2012-09-25/jobsByPipeline/pipeline Id?
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
```

### 请求参数
<a name="list-jobs-by-pipeline-request-parameters"></a>

此操作接受以下请求参数。Elastic Transcoder 将返回指定管道中过去 6 个月的任务。

**PipelineId**  
要获取有关您添加到给定管道的任务的信息，请指定该管道的 `Id` 对象的值。

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

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

### 请求标头
<a name="list-jobs-by-pipeline-request-headers"></a>

此操作仅使用所有操作通用的请求标头。有关通用请求标头的信息，请参阅 [HTTP 标头内容](making-http-requests.md#http-request-header)。

### 请求正文
<a name="list-jobs-by-pipeline-request-body"></a>

此操作未使用请求正文。

## 响应
<a name="list-jobs-by-pipeline-responses"></a>

### 语法
<a name="list-jobs-by-pipeline-response-syntax"></a>

```
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
}
```

### 响应标头
<a name="list-jobs-by-pipeline-response-headers"></a>

此操作仅使用大多数响应通用的响应标头。有关通用响应标头的信息，请参阅 [HTTP 响应](making-http-requests.md#http-response-header)。

### 响应正文
<a name="list-jobs-by-pipeline-response-body"></a>

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

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

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

**（自动）输入：DetectedProperties**  
检测到的输入文件的属性。Elastic Transcoder 从输入文件识别这些值。

**（自动）Inputs:Width**  
检测到的输入文件宽度（以像素为单位）。

**（自动）Inputs:Height**  
检测到的输入文件高度（以像素为单位）。

**（自动）输入：FrameRate**  
检测到的输入文件帧率（以每秒帧数为单位）。

**（自动）输入：FileSize**  
检测到的输入文件大小（以字节为单位）。

**（自动）输入：DurationMillis**  
检测到的输入文件持续时间（以毫秒为单位）。

**（自动）Outputs:Id**  
以 1 开头的顺序计数器，用于在当前任务的输出中标识输出。在 `Output` 语法中，此值始终为 `1`。

**（自动）Outputs:Duration**  
输出文件的持续时间（以秒为单位），向上取整。

**（自动）输出：DurationMillis**  
输出文件的持续时间（以毫秒为单位）。

**（自动）Outputs:Width**  
输出文件的宽度（以像素为单位）。

**（自动）Outputs:Height**  
输出文件的高度（以像素为单位）。

**（自动）输出：FrameRate**  
输出文件的帧率（以每秒帧数为单位）。

**（自动）输出：FileSize**  
输出文件的文件大小（以字节为单位）。

**（自动）Outputs:Status**  
任务中一个输出的状态。如果您只为该任务指定了一个输出，则 `Outputs:Status` 始终与 `Job:Status` 相同。如果您指定了多个输出：  
+ 所有输出的 `Job:Status` 和 `Outputs:Status` 都是 `Submitted`，直到 Elastic Transcoder 开始处理第一个输出。
+ 当 Elastic Transcoder 开始处理第一个输出时，该输出的 `Outputs:Status` 和 `Job:Status` 都更改为 `Progressing`。对于每个输出，`Outputs:Status` 的值将保持为 `Submitted`，直到 Elastic Transcoder 开始处理输出。
+ `Job:Status` 保持为 `Progressing`，直到所有输出都达到终端状态，`Complete` 或者 `Error`。
+ 当所有输出都达到终端状态时，仅当所有输出的 `Outputs:Status` 都是 `Complete` 时，`Job:Status` 才会更改为 `Complete`。如果一个或多个输出的 `Outputs:Status` 是 `Error`，则 `Job:Status` 的终端状态也是 `Error`。
`Status` 的值为以下值之一：`Submitted`、`Progressing`、`Complete`、`Canceled` 或 `Error`。

**（自动）输出：StatusDetail**  
进一步解释 `Outputs:Status` 的信息。

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

**（自动）Status**  
如果您为任务指定了多个输出，则为整个任务的状态。当 Elastic Transcoder 开始处理任务时，`Job:Status` 的值会更改为 `Progressing`，并且在 Elastic Transcoder 完成对所有输出的处理之前不会发生变化。处理完成后，`Job:Status` 更改为 `Complete`，如果有任何输出失败，则更改为 `Error`。  
如果您只为该任务指定了一个输出，则 `Job:Status` 与 `Outputs:Status` 相同。  
`Job:Status` 的值为以下值之一：`Submitted`、`Progressing`、`Complete`、`Canceled` 或 `Error`。

**（自动）Timing**  
有关任务时间的详细信息。

**（自动）定时：SubmitTimeMillis**  
任务提交给 Elastic Transcoder 的时间（以纪元毫秒为单位）。

**（自动）定时：StartTimeMillis**  
任务开始转码的时间（以纪元毫秒为单位）。

**（自动）定时：FinishTimeMillis**  
任务完成转码的时间（以纪元毫秒为单位）。  
要了解有关纪元时间的更多信息，请访问 Wikipedia 上的[纪元计算](https://en.wikipedia.org/wiki/Epoch_%28reference_date%29#Computing)页面。

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

## 错误
<a name="list-jobs-by-pipeline-response-errors"></a>

有关 Elastic Transcoder 异常和错误消息的信息，请参阅 [处理 Elastic Transcoder 中的错误](error-handling.md)。

## 示例
<a name="list-jobs-by-pipeline-examples"></a>

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

### 示例请求
<a name="list-jobs-by-pipeline-examples-sample-request"></a>

以下示例请求获取过去 6 个月向管道 ID `1111111111111-abcde1` 分配的所有任务的列表。

```
GET /2012-09-25/jobsByPipeline/1111111111111-abcde1?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
```

### 示例响应
<a name="list-jobs-by-pipeline-examples-sample-response"></a>

```
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",
         "Inputs":[{
            "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"
            }
         }],
         "Outputs":[
            {
               "Id":"1",
               "Key":"cooking/lasagna-KindleFireHD.mp4",
               "ThumbnailPattern":"cooking/lasagna-{count}-KindleFireHD",
               "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":"Submitted",
               "StatusDetail":"Job has been received.",
               "Captions":{
                  "CaptionFormats":[
                     {
                        "Format":"scc",
                        "Pattern":"scc/lasagna-{language}",
                     },
                     {
                        "Format":"srt",
                        "Pattern":"srt/lasagna-{language}"
                     },
                     {
                        "Format":"mov-text"
                     }
                  ]
               }
            },
            {
               "Id":"2",
               "Key":"cooking/lasagna-iPhone4s.mp4",
               "ThumbnailPattern":"cooking/lasagna-{count}-iPhone4s",
               "Rotate":"0",
               "PresetId":"1351620000000-100020",
               "Watermarks":[
                  {
                     "InputKey":"logo/128x64.png",
                     "PresetWatermarkId":"company logo 128x64"
                  }
               ],
               "Duration":"1003",
               "DurationMillis":"1003000",
               "Width":"1920",
               "Height":"1080",
               "FrameRate":"30.00",
               "FileSize":"4718600",
               "Status":"Submitted",
               "StatusDetail":"Job has been received.",
               "AppliedColorSpaceConversion":"None"
            }
         ],
         "PipelineId":"1111111111111-abcde1",
         "Timing":{
            "SubmitTime":"1427212800000",
            "StartTime":"1427212856000",
            "FinishTime":"1427212875000"
         }
      },
      {
         "Id":"4444444444444-abcde4",
         "Input":{
            "Key":"cooking/baked-ziti.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":"1",
               "Key":"cooking/baked-ziti-KindleFireHD.mp4",
               "ThumbnailPattern":"cooking/baked-ziti-{count}-KindleFireHD",
               "Rotate":"0",
               "PresetId":"1351620000000-100080",
               "Watermarks":[
                  {
                     "InputKey":"logo/128x64.png",
                     "PresetWatermarkId":"company logo 128x64"
                  }
               ],
               "Duration":"596",
               "DurationMillis":"1003000",
               "Width":"1280",
               "Height":"720",
               "FrameRate":"30.00",
               "FileSize":"4718600",
               "Status":"Complete",
               "StatusDetail":""
            }
         ],
         "UserMetadata":
            {
               "Food type":"Italian",
               "Cook book":"recipe notebook"
            },
         "PipelineId":"1111111111111-abcde1",
         "Timing":{
            "SubmitTime":"1427212800000",
            "StartTime":"1427212856000",
            "FinishTime":"1427212875000"
         }
      }
   ],
   "NextPageToken":null
}
```