Available in Classic and VPC
Create encoding options for converting media source files stored in Object Storage for viewing on different devices, such as mobile and PC, in different quality.
Request
This section describes the request format. The method and URI are as follows:
Method | URI |
---|---|
POST | /api/v2/encoding-option |
Request headers
For information about the headers common to all VOD Station APIs, see VOD Station request headers.
Request body
You can include the following data in the body of your request:
Field | Type | Required | Description |
---|---|---|---|
encodingOptionType |
String | Optional | Encoding option type
|
name |
String | Required | Custom encoding option name
|
format |
String | Required | Converted media file's container format
|
video |
Object | Required | Video encoding option information
|
video.codec |
String | Required | Video codec format
|
video.codecOptions |
Object | Required | Video codec detailed option information |
video.codecOptions.profile |
String | Required | Video codec profile
|
video.codecOptions.level |
String | Required | Video codec level
|
video.bitrate |
Integer | Required | Video stream's bitrate (Kbps)
|
video.width |
Integer | Required | Width of the output video (pixel)
|
video.height |
Integer | Required | Height of the output video (pixel)
|
video.framerate |
Double | Required | Frames per second (fps)
|
video.maxFramerate |
Double | Optional | Maximum number of frames per second (fps)
|
video.keyframeInterval |
Integer | Required | Interval of key frames created in video (second)
|
video.rateControl |
String | Required | Bitrate allocation method when converting video
|
video.pass |
String | Required | Encoding pass settings when converting video
|
audio |
Object | Required | Audio encoding option information |
audio.codec |
String | Required | Audio codec format
|
audio.bitrate |
Integer | Required | Audio stream's bitrate (Kbps)
|
audio.channel |
Integer | Required | Output audio's channel settings
|
audio.samplingRate |
Integer | Required | Output audio's sampling rate (Hz)
|
Request example
The request example is as follows:
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
}
}'
Response
This section describes the response format.
Response body
The response body includes the following data:
Field | Type | Required | Description |
---|---|---|---|
content |
Object | - | Response result |
content.disabled |
Boolean | - | Whether Sub Account is disabled
|
content.id |
Integer | - | Encoding option ID |
content.encodingOptionType |
String | - | Encoding option type
|
content.name |
String | - | Encoding option name |
content.format |
String | - | Converted media file's container format |
content.video |
Object | - | Video encoding option information |
content.video.codec |
String | - | Video codec format |
content.video.codecOptions |
Object | - | Video codec detailed option information |
content.video.codecOptions.profile |
String | - | Video codec profile |
content.video.codecOptions.level |
String | - | Video codec level |
content.video.bitrate |
Integer | - | Video stream's bitrate (Kbps) |
content.video.width |
Integer | - | Output video width (pixel) |
content.video.height |
Integer | - | Output video height (pixel) |
content.video.framerate |
Double | - | Number of frames per second (fps) |
content.video.maxFramerate |
Double | - | Maximum number of frames per second (fps) |
content.video.keyframeInterval |
Double | - | Interval of key frames created in video (second) |
content.video.rateControl |
String | - | Bitrate distribution method
|
content.video.pass |
String | - | Encoding pass settings when converting video
|
content.audio |
Object | - | Audio encoding option information |
content.audio.codec |
String | - | Audio codec format |
content.audio.bitrate |
Integer | - | Audio stream's bitrate (Kbps) |
content.audio.channel |
Integer | - | Channel count settings for output audio
|
content.audio.samplingRate |
Double | - | Output audio sampling rate (Hz) |
content.regionNo |
String | - | Region number
|
content.memberNo |
Integer | - | Member number |
Response status codes
For information about the HTTP status codes common to all VOD Station APIs, see VOD Station response status codes.
Response example
The response example is as follows:
{
"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
}
}