Creating encoding options
- Print
- PDF
Creating encoding options
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
VOD Station provides an API to create encoding options, and provides an encoding option list query API and an encoding option information query APIto query the created encoding options.
Requests
POST https://vodstation.apigw.ntruss.com/api/v2/encoding-option
Request headers
Header name | Description |
---|---|
x-ncp-region_code | NAVER Cloud Platform's region code x-ncp_region_code:{Region Code} |
x-ncp-apigw-timestamp | This is the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC. If the time difference compared to the API Gateway server is more than 5 minutes, then the request is considered invalid. x-ncp-apigw-timestamp:{Timestamp} |
x-ncp-iam-access-key | Access key ID value issued by the NAVER Cloud Platform portalx-ncp-iam-access-key:{Sub Account Access Key} |
x-ncp-apigw-signature-v2 | Signature encrypted with the Access Key ID value and Secret Keyx-ncp-apigw-signature-v2:{API Gateway Signature} |
Content-Type | Specify the request body content type as application/jsonContent-Type: application/json |
Request body
API field names in the request body are case sensitive.
Field name | Requirement status | Type | Restrictions | Default value | Description |
---|---|---|---|---|---|
name | Yes | String | 3 to 20 characters consisting of English letters, numbers, colons (:), hyphens (-), and underscores (_) are allowed. | Name of user-defined encoding option to be created | |
format | Yes | String | MP4 | Converted media file's container format | |
encodingOptionType | No | String | NORMAL, AUDIO | NORMAL | - Type of user-defined encoding option Select either the normal preset including video and audio, or audio preset including only audio streams. |
audio | Yes | Object | Object for setting transcoding audio option | ||
audio.codec | Yes | String | AAC | Audio codec settings | |
audio.channel | Yes | String | AUTO, 1, 2 | - Output audio's channel settings Use the original audio channel when setting up AUTO 참고: 인풋 미디어 파일의 오디오 채널과 다른 설정으로 인코딩 시 볼륨의 변화가 발생 할 수 있음 | |
audio.bitrate | Yes | Integer | An integer between 16 and 320, unit: Kbps | Bit transfer rate settings of the video stream subject for transcoding | |
audio.samplingRate | Yes | Integer | AUTO, -2, 22050 , 32000, 44100, 48000 Unit: Hz | Output audio's sampling rate settings. The source's audio sampling rate is used when set to AUTO. | |
video | Yes | Object | - Object for setting transcoding video option The video object is omitted when encodingOptionType is AUDIO. | ||
video.codec | Yes | String | AVC | Video codec settings Supports AVC (H.264) | |
video.codecOptions | Yes | Object | Object for setting video codec detailed options | ||
video.codecOptions.profile | Yes | String | BASELINE, MAIN, HIGH | Video codec profile is a pre-defined standard specification so specific technologies of the H.264 codec can be used according to the video's purpose of use. | |
video.codecOptions.level | Yes | String | 1, 1b, 1.1, 1.2, 1.3, 2.1, 2.2, 3.1, 3.2, 4.1, 4.2, 5.1, 5.2 | Video codec level is a standard specification set to indicate how many resources are required by the player (decoder) of the device that plays the video. | |
video.bitrate | Yes | Integer | Bitrate> 0, unit: Kbps | Video stream's bit transfer rate settings. It's a very important element that determines the video's image quality, and it also decides how much data is in a 1 second video. | |
video.width | Yes | Integer | AUTO (-2), an integer between 96 and 4096, unit: pixel | The horizontal length of the output video. If only the output video's width is set to AUTO, then the height will be fixed and the width will change according to the video's ratio. | |
video.height | Yes | Integer | AUTO (-2), an integer between 96 and 4096, unit: pixel | The vertical length of the output video. If only the output video's height is set to AUTO, then the width will be fixed and the height will change according to the video's ratio. | |
video.framerate | Yes | Double | AUTO(-2), 10, 15, 23.97, 24, 29.97, 30, 50, 60 | Sets the number of frames per second and how many frames per second to show in a video stream. | |
video.maxFramerate | No | Integer | Integer value between 10 and 60 | Only used when video.framerate is AUTO and sets the maximum framerate. | |
video.keyframeInterval | Yes | Integer | An integer between 1 and 100 | Key frame interval settings, interval of key frames created in video (unit: seconds) | |
video.rateControl | Yes | String | AUTO,ABR, CRF, CBR Only ABR is allowed when the video.pass is 2-pass. | ABR | - Bitrate distribution method when converting videos CBR: fixed bitrate, converts with equal bitrates in all frames. The bitrate is fixed, which makes predicting the result's size easy, but the quality is low compared to ABR or CRF. CRF: has good compression efficiency, but the bitrate and file size can't be specified before encoding. ABR: converts variably according to bitrate needed while maintaining an average bitrate with available bitrates. |
video.pass | Yes | String | 1-Pass, 2-Pass | - Encoding method to be used when converting video 2-pass uses given bitrates more efficiently than 1-pass, but the encoding time is longer. |
Responses
Field name | Type | Description | Remarks |
---|---|---|---|
error | Object | Responds when a request fails Error response code and message | |
error.code | Integer | Error response code | |
error.message | String | Error response message | |
content | Object | VOD Station OPEN API response object | |
content.disabled | Boolean | Filed provided to sub accounts Resource activation status for the Sub Account | |
content.id | String | Encoding option ID | |
content.name | String | Encoding option name | |
content.format | String | Converted media file's container format | |
content.encodingOptionType | String | Encoding option type | |
content.audio | Object | Object for setting transcoding audio option | |
content.audio.codec | String | Audio codec settings | |
content.audio.channel | Integer | Output audio's channel settings | |
content.audio.bitrate | Integer | Bit transfer rate settings of the video stream subject for transcoding (unit: Kbps) | |
content.audio.samplingRate | Integer | Output audio sampling rate (unit: Hz) | |
content.video | Object | Object for setting transcoding video option | |
content.video.codec | String | Video codec settings | |
content.video.codecOptions | Object | Object for setting video codec detailed options | |
content.video.codecOptions.profile | String | Configured video codec profile | |
content.video.codecOptions.level | String | Configured video codec level | |
content.video.bitrate | Integer | Video stream's bit transfer rate (unit: Kbps) | |
content.video.width | Integer | Output video’s width | |
content.video.height | Integer | Output video’s height | |
content.video.framerate | Double | Number of frames per second | |
content.video.keyframeInterval | Integer | Interval at which key frames are created in the video (unit: seconds) | |
content.video.rateControl | String | Bitrate distribution method | |
content.defaultSet | Boolean | Whether there's a preset provided by system |
Examples
Request examples
POST https://vodstation.apigw.ntruss.com/api/v2/encoding-option
POST /api/v2/encoding-option
HOST: vodstation.apigw.ntruss.com
Content-Type: application/json
x-ncp-region_code:KR
x-ncp-apigw-timestamp:1521787414578
x-ncp-iam-access-key:6uxz1nKkcYwUjWRG5Q1V7NsW0i5jErlu2NjBXXgy
x-ncp-apigw-signature-v2:iJFK773KH0WwQ79PasqJ+ZGixtpDQ/abS57WGQdld2M=
Reqeust body
{
"audio": {
"bitrate": 192,
"channel": 2,
"codec": "AAC",
"samplingRate": 44100
},
"encodingOptionType": "NORMAL",
"format": "MP4",
"name": "basic-enc-option",
"video": {
"bitrate": 5000,
"codec": "AVC",
"codecOptions": {
"level": "3.1",
"profile": "MAIN"
},
"framerate": 30.0,
"height": 1080,
"keyframeInterval": 2,
"pass": "1-Pass",
"rateControl": "ABR",
"maxFramerate": 30,
"width": 1920
}
}
Response examples
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 12 Sep 2018 09:53:32 GMT
Content-Type: application/json;charset=utf-8
Connection: keep-alive
Access-Control-Allow-Origin: *
x-ncp-trace-id: 36c9k60om4p3238cpmc9gm4cj4
{
"content": {
"disabled": false,
"id": 10058,
"encodingOptionType": "NORMAL",
"name": "basic-enc-option",
"format": "MP4",
"video": {
"codec": "AVC",
"codecOptions": {
"profile": "MAIN",
"level": "3.1"
},
"bitrate": 5000,
"width": 1920,
"height": 1080,
"framerate": 30,
"maxFramerate": 30,
"keyframeInterval": 2,
"rateControl": "ABR",
"pass": "1-Pass"
},
"audio": {
"codec": "AAC",
"bitrate": 192,
"channel": 2,
"samplingRate": 44100
}
}
}
Was this article helpful?