

サポート終了通知: 2025 年 11 月 13 日、 AWS は Amazon 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="create-preset"></a>

**Topics**
+ [説明](#create-preset-description)
+ [リクエスト](#create-preset-requests)
+ [レスポンス](#create-preset-responses)
+ [エラー](#create-preset-response-errors)
+ [例](#create-preset-examples)

## 説明
<a name="create-preset-description"></a>

プリセットを作成するには、`/2012-09-25/presets` リソースに POST リクエストを送信します。

**重要**  
指定した設定は Elastic Transcoder によってチェックされ、Elastic Transcoder の要件を満たしているかどうか、該当するスタンダードに準拠しているかどうかが確認されます。設定が Elastic Transcoder に対して有効でない場合、Elastic Transcoder によって HTTP 400 応答 (`ValidationException`) が返され、プリセットは作成されません。設定が Elastic Transcoder に対して有効であっても、スタンダードに厳密に準拠していない場合、Elastic Transcoder によってプリセットは作成されますが、応答で警告メッセージが返されます。これは、設定がスタンダードに準拠しているかどうかを判断しつつ、Elastic Transcoder によって生成されるファイルをより柔軟に受け入れるためにも役立ちます。

**注記**  
Elastic Transcoder には、一般的な出力形式用にシステムプリセットがいくつか用意されています。詳細については、トピック「**」の「**PresetId[ジョブを作成する](create-job.md)」を参照してください。

## リクエスト
<a name="create-preset-requests"></a>

### 構文
<a name="create-preset-request-syntax"></a>

```
POST /2012-09-25/presets 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":"{{preset name}}",
   "Description":"{{preset description}}",
   "Container":"flac|flv|fmp4|gif|mp2|mp3|mp4|mpg|mxf|oga|ogg|ts|wav|webm",
   "Audio":{
      "Codec":"AAC|flac|mp2|mp3|pcm|vorbis",
      "CodecOptions":{
          "Profile":"auto|AAC-LC|HE-AAC|HE-AACv2",
          "BitDepth":"8|16|24|32",
          "Signed":"Signed|Unsigned",
          "BitOrder":"LittleEndian"
      },
      "SampleRate":"auto|22050|32000|44100|48000|96000",
      "BitRate":"audio bit rate of output file in kilobits/second",
      "Channels":"auto|0|1|2",
      "AudioPackingMode":"SingleTrack|OneChannelPerTrack|
          OneChannelPerTrackWithMosTo8Tracks"
   },
   "Video":{
      "Codec":"gif|H.264|mpeg2|vp8|vp9",
      "CodecOptions":{
         "Profile":"baseline|main|high|0|1|2|3",
         "Level":"1|1b|1.1|1.2|1.3|2|2.1|2.2|3|3.1|3.2|4|4.1",
         "MaxReferenceFrames":"{{maximum number of reference frames}}",
         "MaxBitRate":"{{maximum bit rate}}",
         "BufferSize":"{{maximum buffer size}}",
         "InterlacedMode":"Progressive|TopFirst|BottomFirst|Auto",
         "ColorSpaceConversion":"None|Bt709ToBt601|Bt601ToBt709|Auto",
         "ChromaSubsampling":"yuv420p|yuv422p",
         "LoopCount":"Infinite|[0,100]"
      },
      "KeyframesMaxDist":"{{maximum frames between key frames}}",
      "FixedGOP":"true|false",
      "BitRate":"auto|{{video bit rate of output file in kilobits/second}}",
      "FrameRate":"auto|10|15|23.97|24|25|29.97|30|50|60",
      "MaxFrameRate":"10|15|23.97|24|25|29.97|30|50|60",
      "MaxWidth":"auto|[128,4096]",
      "MaxHeight":"auto|[96,3072]",
      "SizingPolicy":"Fit|Fill|Stretch|Keep|ShrinkToFit|ShrinkToFill",
      "PaddingPolicy":"Pad|NoPad",
      "DisplayAspectRatio":"auto|1:1|4:3|3:2|16:9",
      "Resolution":"auto|{{width in pixelsxheight in pixels}}" {{<not recommended>}},
      "AspectRatio":"auto|1:1|4:3|3:2|16:9" {{<not recommended>}},
      "Watermarks":[
         {
            "Id":"{{unique identifier up to 40 characters}}",
            "MaxWidth":"[16,Video:MaxWidth]px|[0,100]%",
            "MaxHeight":"[16,Video:MaxHeight]px|[0,100]%", 
            "SizingPolicy":"Fit|Stretch|ShrinkToFit",
            "HorizontalAlign":"Left|Right|Center",
            "HorizontalOffset":"[0,100]%|[0,Video:MaxWidth]px",
            "VerticalAlign":"Top|Bottom|Center",
            "VerticalOffset":"[0,100]%|[0,Video:MaxHeight]px",
            "Opacity":"[0,100]",
            "Target":"Content|Frame"
         },
         {...}
      ]
   },
   "Thumbnails":{
      "Format":"jpg|png",
      "Interval":"{{number of seconds between thumbnails}}",
      "MaxWidth":"auto|[32,4096]",
      "MaxHeight":"auto|[32,3072]",
      "SizingPolicy":"Fit|Fill|Stretch|Keep|ShrinkToFit|ShrinkToFill",
      "PaddingPolicy":"Pad|NoPad",
      "Resolution":"{{width in pixelsxheight in pixels}}" {{<not recommended>}},
      "AspectRatio":"auto|1:1|4:3|3:2|16:9" {{<not recommended>}}
   }
}
```

### リクエストパラメータ
<a name="create-preset-request-parameters"></a>

このオペレーションはリクエストパラメータを使用しません。

### リクエストヘッダー
<a name="create-preset-request-headers"></a>

このオペレーションは、すべてのオペレーションに共通のリクエストヘッダーのみを使用します。共通のリクエストヘッダーの詳細については、「[HTTP ヘッダーの内容](making-http-requests.md#http-request-header)」を参照してください。

### リクエスト本文
<a name="create-preset-request-body"></a>

リクエストボディの JSON 文字列には、`CreatePreset` オペレーションの入力オブジェクトが含まれます。入力オブジェクトの詳細については、「[Elastic Transcoder プリセットの作成時に指定する設定](preset-settings.md)」を参照してください。

## レスポンス
<a name="create-preset-responses"></a>

### 構文
<a name="create-preset-response-syntax"></a>

```
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
{
   "Preset":{
      "Id":"{{Id for the new preset}}",
      "Type":"Custom|System",
      "Name":"{{preset name}}",
      "Description":"{{preset description}}",
      "Container":"flac|flv|fmp4|gif|mp2|mp3|mp4|mpg|mxf|oga|ogg|ts|wav|webm",
      "Audio":{
         "Codec":"AAC|flac|mp2|mp3|pcm|vorbis",
         "CodecOptions":{
            "Profile":"auto|AAC-LC|HE-AAC|HE-AACv2",
            "BitDepth":"8|16|24|32",
            "Signed":"Signed|Unsigned",
            "BitOrder":"LittleEndian"
         },
         "SampleRate":"auto|22050|32000|44100|48000|96000",
         "BitRate":"{{audio bit rate of output file in kilobits/second}}",
         "Channels":"auto|0|1|2",
         "AudioPackingMode":"SingleTrack|OneChannelPerTrack|
            OneChannelPerTrackWithMosTo8Tracks"
      },
      "Video":{
         "Codec":"gif|H.264|mpeg2|vp8|vp9",
         "CodecOptions":{
            "Profile":"baseline|main|high|0|1|2|3",
            "Level":"1|1b|1.1|1.2|1.3|2|2.1|2.2|3|3.1|3.2|4|4.1",
            "MaxReferenceFrames":{{maximum number of reference frames}},
            "MaxBitRate":"{{maximum bit rate}}",
            "BufferSize":"{{maximum buffer size}}",
            "InterlacedMode":"Progressive|TopFirst|BottomFirst|Auto",
            "ColorSpaceConversionMode":"None|Bt709ToBt601|Bt601ToBt709|Auto",
            "ChromaSubsampling":"yuv420p|yuv422p",
            "LoopCount":"Infinite|[0,100]"
         },
         "KeyframesMaxDist":{{maximum frames between key frames}},
         "FixedGOP":"true|false",
         "BitRate":"auto|{{video bit rate of output file in kilobits/second}}",
         "FrameRate":"auto|10|15|23.97|24|25|29.97|30|50|60",
         "MaxFrameRate":"10|15|23.97|24|25|29.97|30|50|60",
         "MaxWidth":"auto|[128,4096]",
         "MaxHeight":"auto|[96,3072]",
         "SizingPolicy":"Fit|Fill|Stretch|Keep|ShrinkToFit|ShrinkToFill",
         "PaddingPolicy":"Pad|NoPad",
         "DisplayAspectRatio":"auto|1:1|4:3|3:2|16:9",
         "Resolution":"{{width in pixels}}x{{height in pixels}}" {{<not recommended>}},
         "AspectRatio":"auto|1:1|4:3|3:2|16:9" {{<not recommended>}}
         "Watermarks":[
            {
               "Id":"{{unique identifier up to 40 characters}}",
               "MaxWidth":"[16,Video:MaxWidth]px|[0,100]%",
               "MaxHeight":"[16,Video:MaxHeight]px|[0,100]%", 
               "SizingPolicy":"Fit|Stretch|ShrinkToFit",
               "HorizontalAlign":"Left|Right|Center",
               "HorizontalOffset":"[0,100]%|[0,Video:MaxWidth]px",
               "VerticalAlign":"Top|Bottom|Center",
               "VerticalOffset":"[0,100]%|[0,Video:MaxHeight]px",
               "Opacity":"[0,100]",
               "Target":"Content|Frame"
            }
         ]
      },   
      "Thumbnails":{
         "Format":"jpg|png",
         "Interval":"{{number of seconds between thumbnails}}",
         "MaxWidth":"auto|[32,4096]",
         "MaxHeight":"auto|[32,3072]",
         "SizingPolicy":"Fit|Fill|Stretch|Keep|ShrinkToFit|ShrinkToFill",
         "PaddingPolicy":"Pad|NoPad",
         "Resolution":"{{width in pixels}}x{{height in pixels}}",
         "AspectRatio":"auto|1:1|4:3|3:2|16:9"
      }
   },
   "Warning":"{{message about codec compatibility}}"
}
```

### レスポンスヘッダー
<a name="create-preset-response-headers"></a>

この操作はほとんどのレスポンスに共通のレスポンスヘッダーのみを使用します。共通のレスポンスヘッダーの詳細については、「[HTTP レスポンス](making-http-requests.md#http-response-header)」を参照してください。

### レスポンス本文
<a name="create-preset-response-body"></a>

ジョブを作成すると、リクエストで指定した値が Elastic Transcoder によって返されます。詳細については、「[リクエスト本文](#create-preset-request-body)」を参照してください。

また、以下の値も Elastic Transcoder によって返されます。

**(自動) Id**  
新しいプリセットの識別子。この値を使用して、プリセットの設定の取得や削除を行います。

**(自動) Type**  
そのプリセットが、Elastic Transcoder によって提供されるデフォルトのプリセット (`System`) であるか、または定義したプリセット (`Custom`) であるかが示されます。

**(自動) Warning**  
プリセットの設定が**コーデック**の基準に準拠していないものの、その設定によって許容可能な出力が生成される可能性がある場合、Elastic Transcoder によりプリセットが作成され、プリセット設定が準拠していないことを示す警告が表示されます。

## エラー
<a name="create-preset-response-errors"></a>

Elastic Transcoder の例外とエラーメッセージについては、「[Elastic Transcoder でのエラー処理](error-handling.md)」を参照してください。

## 例
<a name="create-preset-examples"></a>

以下のリクエスト例では、DefaultPreset という名前のプリセットを作成しています。

### リクエスト例
<a name="create-preset-examples-sample-request"></a>

```
POST /2012-09-25/presets 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":"DefaultPreset",
   "Description":"Use for published videos",
   "Container":"mp4",
   "Audio":{
      "Codec":"AAC",
      "CodecOptions":{
         "Profile":"AAC-LC"
      },
      "SampleRate":"44100",
      "BitRate":"96",
      "Channels":"2"
   },
   "Video":{
      "Codec":"H.264",
      "CodecOptions":{
         "Profile":"main",
         "Level":"2.2",
         "MaxReferenceFrames":"3",
         "MaxBitRate":"",
         "BufferSize":"",
         "InterlacedMode":"Progressive",
         "ColorSpaceConversionMode":"None"
      },
      "KeyframesMaxDist":"240",
      "FixedGOP":"false",
      "BitRate":"1600",
      "FrameRate":"auto",
      "MaxFrameRate":"30",
      "MaxWidth":"auto",
      "MaxHeight":"auto",
      "SizingPolicy":"Fit",
      "PaddingPolicy":"Pad",
      "DisplayAspectRatio":"auto",
      "Watermarks":[
         {
            "Id":"company logo",
            "MaxWidth":"20%",
            "MaxHeight":"20%", 
            "SizingPolicy":"ShrinkToFit",
            "HorizontalAlign":"Right",
            "HorizontalOffset":"10px",
            "VerticalAlign":"Bottom",
            "VerticalOffset":"10px",
            "Opacity":"55.5",
            "Target":"Content"
         }
      ]
   },
   "Thumbnails":{
      "Format":"png",
      "Interval":"120",
      "MaxWidth":"auto",
      "MaxHeight":"auto",
      "SizingPolicy":"Fit",
      "PaddingPolicy":"Pad"
   }
}
```

### レスポンス例
<a name="create-preset-examples-sample-response"></a>

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

{
   "Preset":{
      "Id":"5555555555555-abcde5",
      "Type":"Custom",
      "Name":"DefaultPreset",
      "Description":"Use for published videos",
      "Container":"mp4",
      "Audio":{
         "Codec":"AAC",
         "CodecOptions":{
            "Profile":"AAC-LC"
         },
         "SampleRate":"44100",
         "BitRate":"96",
         "Channels":"2"
      },
      "Video":{
         "Codec":"H.264",
         "CodecOptions":{
            "Profile":"main",
            "Level":"2.2",
            "MaxReferenceFrames":"3",
            "MaxBitRate":"",
            "BufferSize":"",
            "InterlacedMode":"Progressive",
            "ColorSpaceConversionMode":"None|Bt709ToBt601|Bt601ToBt709|Auto"
         },
         "KeyframesMaxDist":"240",
         "FixedGOP":"false",
         "BitRate":"1600",
         "FrameRate":"auto",
         "MaxFrameRate":"30",
         "MaxWidth":"auto",
         "MaxHeight":"auto",
         "SizingPolicy":"Fit",
         "PaddingPolicy":"Pad",
         "DisplayAspectRatio":"auto",
         "Watermarks":[
            {
               "Id":"company logo",
               "MaxWidth":"20%",
               "MaxHeight":"20%", 
               "SizingPolicy":"ShrinkToFit",
               "HorizontalAlign":"Right",
               "HorizontalOffset":"10px",
               "VerticalAlign":"Bottom",
               "VerticalOffset":"10px",
               "Opacity":"55.5",
               "Target":"Content"
            }
         ]
      },
      "Thumbnails":{
         "Format":"png",
         "Interval":"120",
         "MaxWidth":"auto",
         "MaxHeight":"auto",
         "SizingPolicy":"Fit",
         "PaddingPolicy":"Pad"
      }
   },
   "Warning":""
}
```