Classic/VPC環境で利用できます。
Object Storageに保存されているメディアソースファイルをモバイル、PCなど各種デバイスでさまざまな画質で視聴できるように変換するエンコードオプションを作成します。
リクエスト
リクエスト形式を説明します。リクエスト形式は次の通りです。
| メソッド | URI |
|---|---|
| POST | /api/v2/encoding-option |
リクエストヘッダ
VOD Station APIで共通して使用されるヘッダの詳細は、VOD Stationのリクエストヘッダをご参照ください。
リクエストボディ
リクエストボディの説明は次の通りです。
| フィールド | タイプ | 必須の有無 | 説明 |
|---|---|---|---|
encodingOptionType |
String | Optional | エンコードオプションタイプ
|
name |
String | Required | ユーザー指定エンコードオプション名
|
format |
String | Required | 変換されたメディアファイルコンテナの形式
|
video |
Object | Required | ビデオエンコードオプション情報
|
video.codec |
String | Required | ビデオコーデックの形式
|
video.codecOptions |
Object | Required | ビデオコーデックの詳細オプション情報 |
video.codecOptions.profile |
String | Required | ビデオコーデックプロファイル(Video Codec Profile)
|
video.codecOptions.level |
String | Required | ビデオコーデックレベル(Video Codec Level)
|
video.bitrate |
Integer | Required | ビデオストリームのビットレート(Kbps)
|
video.width |
Integer | Required | 出力ビデオの幅(ピクセル)
|
video.height |
Integer | Required | 出力ビデオの高さ(ピクセル)
|
video.framerate |
Double | Required | 1秒当たりのフレーム数(fps)
|
video.maxFramerate |
Double | Optional | 1秒当たりの最大フレーム数(fps)
|
video.keyframeInterval |
Integer | Required | ビデオにキーフレームが作成される間隔(秒)
|
video.rateControl |
String | Required | ビデオ変換時のビットレート配分方式
|
video.pass |
String | Required | ビデオ変換時のエンコードパス設定
|
audio |
Object | Required | オーディオエンコードオプション情報 |
audio.codec |
String | Required | オーディオコーデックの形式
|
audio.bitrate |
Integer | Required | オーディオストリームのビットレート(Kbps)
|
audio.channel |
Integer | Required | 出力オーディオのチャンネル数設定
|
audio.samplingRate |
Integer | Required | 出力オーディオサンプリングレート(Hz)
|
リクエスト例
リクエストのサンプルコードは次の通りです。
curl --location --request POST 'https://vodstation.apigw.ntruss.com/api/v2/encoding-option' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--data '{
"encodingOptionType": "NORMAL",
"name": "vodstation_uhd",
"format": "MP4",
"video": {
"codec": "AVC",
"codecOptions": {
"profile": "HIGH",
"level": "5.1"
},
"bitrate": 18000,
"width": 3840,
"height": 2160,
"framerate": -2.0,
"maxFramerate": 30,
"keyframeInterval": 2,
"rateControl": "ABR",
"pass": "1-Pass"
},
"audio": {
"codec": "AAC",
"bitrate": 192,
"channel": 2,
"samplingRate": 48000.0
}
}'
レスポンス
レスポンス形式を説明します。
レスポンスボディ
レスポンスボディの説明は次の通りです。
| フィールド | タイプ | 必須の有無 | 説明 |
|---|---|---|---|
content |
Object | - | レスポンス結果 |
content.disabled |
Boolean | - | Sub Accountは無効化するか
|
content.id |
Integer | - | エンコードオプション ID |
content.encodingOptionType |
String | - | エンコードオプションタイプ
|
content.name |
String | - | エンコードオプション名 |
content.format |
String | - | 変換されたメディアファイルコンテナの形式 |
content.video |
Object | - | ビデオエンコードオプション情報 |
content.video.codec |
String | - | ビデオコーデックの形式 |
content.video.codecOptions |
Object | - | ビデオコーデックの詳細オプション情報 |
content.video.codecOptions.profile |
String | - | ビデオコーデックプロファイル(Video Codec Profile) |
content.video.codecOptions.level |
String | - | ビデオコーデックレベル(Video Codec Level) |
content.video.bitrate |
Integer | - | ビデオストリームのビットレート(Kbps) |
content.video.width |
Integer | - | 出力ビデオの幅(ピクセル) |
content.video.height |
Integer | - | 出力ビデオの高さ(ピクセル) |
content.video.framerate |
Double | - | 1秒当たりのフレーム数(fps) |
content.video.maxFramerate |
Double | - | 1秒当たりの最大フレーム数(fps) |
content.video.keyframeInterval |
Double | - | ビデオにキーフレームが作成される間隔(秒) |
content.video.rateControl |
String | - | ビットレートの配分方式
|
content.video.pass |
String | - | ビデオ変換時のエンコードパス設定
|
content.audio |
Object | - | オーディオエンコードオプション情報 |
content.audio.codec |
String | - | オーディオコーデックの形式 |
content.audio.bitrate |
Integer | - | オーディオストリームのビットレート(Kbps) |
content.audio.channel |
Integer | - | 出力オーディオのチャンネル数設定
|
content.audio.samplingRate |
Double | - | 出力オーディオサンプリングレート(Hz) |
content.regionNo |
String | - | リージョン番号
|
content.memberNo |
Integer | - | メンバー番号 |
レスポンスステータスコード
VOD Station APIで共通して使用されるレスポンスステータスコードの詳細は、VOD Stationのレスポンスステータスコードをご参照ください。
レスポンス例
レスポンスのサンプルコードは次の通りです。
{
"content": {
"disabled": false,
"id": 1111,
"encodingOptionType": "NORMAL",
"name": "vodstation_uhd",
"format": "MP4",
"video": {
"codec": "AVC",
"codecOptions": {
"profile": "HIGH",
"level": "5.1"
},
"bitrate": 18000,
"width": 3840,
"height": 2160,
"framerate": -2.0,
"maxFramerate": 30.0,
"keyframeInterval": 2.0,
"rateControl": "ABR",
"pass": "1-Pass"
},
"audio": {
"codec": "AAC",
"bitrate": 192,
"channel": 2,
"samplingRate": 48000.0
},
"regionNo": "1",
"memberNo": 2*****2
}
}