Encoding ProfilesCreate Encoding Profile

Create Encoding Profile

Create a new transcoding profile.

curl -X POST "https://api.5centscdn.com/v2/transcoding/profiles/new" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
  "_METHOD": "PUT",
  "name": "HD 720p H.264",
  "cv": "libx264",
  "ca": "aac",
  "f": "mp4",
  "filemode": "single",
  "fps": "30",
  "gop": "6",
  "preset": "veryfast",
  "vlevel": "4.1",
  "vprofile": "high",
  "vpass": "1",
  "bv": "1",
  "bvvalue": "4000",
  "ba": "1",
  "bavalue": "128",
  "sv": "720p",
  "svvalue": "1920x800",
  "crfv": "24",
  "ara": "48000",
  "aca": "2",
  "bframe": "0",
  "tm": "interval",
  "tv": "0:01:30",
  "upscale": "N",
  "sourcevideo": "Y",
  "sourceaudio": "Y",
  "outdir": "output/hd",
  "filters": [
    "1",
    "2"
  ],
  "profiles": []
}'
{
  "result": "success",
  "message": "Transcoding Settings, New Profile Created",
  "profileid": 129017
}
POST
/transcoding/profiles/new
POST
Base URLstring

Target server for requests. Edit to use your own host.

API Key (header: X-API-Key)
X-API-Keystring
Required

API key (sent in header)

Content-Typestring
Required

The media type of the request body

Options: application/json
_METHODstring
Required

HTTP method override for this request. Always set to PUT to create a new profile.

namestring
Required

Profile display name. Required; must not be empty.

cvstring

Video codec used for encoding. libx264 = H.264/AVC. libx265 = H.265/HEVC. libvpx-vp9 = VP9. mp4, hls, and hlsaes containers support libx264 and libx265; the webm container supports libvpx-vp9 only. AV1 encoding can be added to the profile afterwards via the update endpoint. Defaults to libx264.

Options: libx264, libx265, libvpx-vp9
castring

Audio codec used for encoding. aac and mp3 are available for mp4, hls, and hlsaes containers; opus is used with the webm container. Defaults to aac.

Options: aac, mp3, opus
fstring

Output container format. Determines which video and audio codecs are available (see cv and ca). Defaults to mp4.

Options: mp4, webm, hls, hlsaes
filemodestring

Output file organization. single produces one encoded output using the video and audio settings on this profile. combined bundles several existing single-mode profiles (see profiles) into a multi-bitrate output. No default is set - one of the two must be selected.

Options: single, combined
fpsstring

Target output frame rate. 0 copies the source frame rate. Defaults to 0.

Options: 0, 24, 25, 30, 48, 50
gopstring

Group of Pictures size in seconds (interval between keyframes). Not applicable while fps is 0. No default is set.

Options: 2, 4, 6, 8, 10, 12
presetstring

Encoding speed preset. Slower presets produce smaller files at the cost of encoding time. Defaults to faster.

Options: superfast, veryfast, faster, fast
vlevelstring

Codec encoding level, constraining the maximum resolution, video bitrate, and frame rate for the profile. Which levels are valid depends on vprofile: baseline allows 3.0 and 3.1; main allows 3.1, 4.1, and 4.2; high allows 4.0, 4.1, and 4.2. Selecting a vprofile automatically sets vlevel to a corresponding default: baseline -> 3.0, high -> 4.0, main -> 3.1. Defaults to 3.1.

Options: 3.0, 3.1, 4.0, 4.1, 4.2
vprofilestring

Encoding profile. Defaults to main. This set of profile options applies to the libx264 codec; H.265 and VP9-specific profiles can be set afterwards via the update endpoint.

Options: baseline, main, high
vpassstring

Number of encoding passes. 1 = single pass (faster). 2 = two-pass (more accurate bitrate targeting). Defaults to 1.

Options: 1, 2
bvstring

Video bitrate mode. 0 = As Source (copies source bitrate). 1 = As Defined (use bvvalue to set target kbps). Defaults to 1.

Options: 0, 1
bvvaluestring

Target video bitrate in kilobits per second, sent as a string. Required when bv=1. Defaults to 800.

bastring

Audio bitrate mode. 0 = As Source (copies source bitrate). 1 = As Defined (use bavalue to set target kbps). Defaults to 1.

Options: 0, 1
bavaluestring

Target audio bitrate in kilobits per second, sent as a string. Required when ba=1. Defaults to 128.

svstring

Output resolution. Use as_defined to specify custom dimensions via svvalue. Defaults to 720p.

Options: 2160p, 1440p, 1080p, 720p, 576p, 480p, 360p, 240p, 144p, as_defined
svvaluestring

Custom output dimensions as a single WIDTHxHEIGHT string. Only used when sv=as_defined. Both dimensions must be divisible by 2.

crfvstring

Constant Rate Factor for quality-based encoding. 18 = High quality, 24 = Medium quality, 28 = Low quality. Defaults to 24.

Options: 18, 24, 28
arastring

Audio sample rate in Hz. Defaults to 44100.

Options: 44100, 48000
acastring

Audio output channel count. 0 = As Source. 1 = Stereo. 2 = Mono. Defaults to 1 (Stereo).

Options: 0, 1, 2
bframestring

Number of consecutive B-frames. Not currently configurable at creation time; always submitted as 0.

tmstring

Thumbnail generation mode. disabled = no thumbnails. fixed = capture a single thumbnail at time tv. interval = capture thumbnails repeatedly at the tv interval. sprite = generate a sprite sheet of thumbnails. Defaults to disabled.

Options: disabled, fixed, interval, sprite
tvstring

Time value for thumbnail capture, in HH:MM:SS format. Applicable when tm is fixed or interval. Defaults to 00:00:00.

upscalestring

Whether to allow upscaling when the target resolution exceeds the source resolution. Y = allow upscaling. N = skip if source is lower resolution. Defaults to Y.

Options: Y, N
sourcevideostring

Applicable when filemode is combined. Whether to copy the source video stream into the combined output. Defaults to Y.

Options: Y, N
sourceaudiostring

Applicable when filemode is combined. Y copies the original audio track as-is into the combined output. N includes only the single highest-bitrate transcoded audio track from the selected sub-profiles. Defaults to N.

Options: Y, N
outdirstring
Required

Output directory path relative to the storage root, required. Empty string stores in root. The characters < > : " | ? * are not allowed. Defaults to mp4/.

filtersarray

IDs of transcoding filters to apply, selected from the service's existing filters.

profilesarray

IDs of existing single-mode profiles to include as sub-profiles. Applicable when filemode is combined.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-API-Keystring
Required

API Key for authentication. Provide your API key in the header.

Body

application/json
_METHODstring
Required

HTTP method override for this request. Always set to PUT to create a new profile.

Example:
PUT
namestring
Required

Profile display name. Required; must not be empty.

Example:
HD 720p H.264
cvstring

Video codec used for encoding. libx264 = H.264/AVC. libx265 = H.265/HEVC. libvpx-vp9 = VP9. mp4, hls, and hlsaes containers support libx264 and libx265; the webm container supports libvpx-vp9 only. AV1 encoding can be added to the profile afterwards via the update endpoint. Defaults to libx264.

Allowed values:libx264libx265libvpx-vp9
castring

Audio codec used for encoding. aac and mp3 are available for mp4, hls, and hlsaes containers; opus is used with the webm container. Defaults to aac.

Allowed values:aacmp3opus
fstring

Output container format. Determines which video and audio codecs are available (see cv and ca). Defaults to mp4.

Allowed values:mp4webmhlshlsaes
filemodestring

Output file organization. single produces one encoded output using the video and audio settings on this profile. combined bundles several existing single-mode profiles (see profiles) into a multi-bitrate output. No default is set - one of the two must be selected.

Allowed values:singlecombined
fpsstring

Target output frame rate. 0 copies the source frame rate. Defaults to 0.

Allowed values:02425304850
gopstring

Group of Pictures size in seconds (interval between keyframes). Not applicable while fps is 0. No default is set.

Allowed values:24681012
presetstring

Encoding speed preset. Slower presets produce smaller files at the cost of encoding time. Defaults to faster.

Allowed values:superfastveryfastfasterfast
vlevelstring

Codec encoding level, constraining the maximum resolution, video bitrate, and frame rate for the profile. Which levels are valid depends on vprofile: baseline allows 3.0 and 3.1; main allows 3.1, 4.1, and 4.2; high allows 4.0, 4.1, and 4.2. Selecting a vprofile automatically sets vlevel to a corresponding default: baseline -\> 3.0, high -\> 4.0, main -\> 3.1. Defaults to 3.1.

Allowed values:3.03.14.04.14.2
vprofilestring

Encoding profile. Defaults to main. This set of profile options applies to the libx264 codec; H.265 and VP9-specific profiles can be set afterwards via the update endpoint.

Allowed values:baselinemainhigh
vpassstring

Number of encoding passes. 1 = single pass (faster). 2 = two-pass (more accurate bitrate targeting). Defaults to 1.

Allowed values:12
bvstring

Video bitrate mode. 0 = As Source (copies source bitrate). 1 = As Defined (use bvvalue to set target kbps). Defaults to 1.

Allowed values:01
bvvaluestring

Target video bitrate in kilobits per second, sent as a string. Required when bv=1. Defaults to 800.

Example:
4000
bastring

Audio bitrate mode. 0 = As Source (copies source bitrate). 1 = As Defined (use bavalue to set target kbps). Defaults to 1.

Allowed values:01
bavaluestring

Target audio bitrate in kilobits per second, sent as a string. Required when ba=1. Defaults to 128.

Example:
128
svstring

Output resolution. Use as_defined to specify custom dimensions via svvalue. Defaults to 720p.

Allowed values:2160p1440p1080p720p576p480p360p240p144pas_defined
svvaluestring

Custom output dimensions as a single WIDTHxHEIGHT string. Only used when sv=as_defined. Both dimensions must be divisible by 2.

Example:
1920x800
crfvstring

Constant Rate Factor for quality-based encoding. 18 = High quality, 24 = Medium quality, 28 = Low quality. Defaults to 24.

Allowed values:182428
arastring

Audio sample rate in Hz. Defaults to 44100.

Allowed values:4410048000
acastring

Audio output channel count. 0 = As Source. 1 = Stereo. 2 = Mono. Defaults to 1 (Stereo).

Allowed values:012
bframestring

Number of consecutive B-frames. Not currently configurable at creation time; always submitted as 0.

Example:
0
tmstring

Thumbnail generation mode. disabled = no thumbnails. fixed = capture a single thumbnail at time tv. interval = capture thumbnails repeatedly at the tv interval. sprite = generate a sprite sheet of thumbnails. Defaults to disabled.

Allowed values:disabledfixedintervalsprite
tvstring

Time value for thumbnail capture, in HH:MM:SS format. Applicable when tm is fixed or interval. Defaults to 00:00:00.

Example:
0:01:30
upscalestring

Whether to allow upscaling when the target resolution exceeds the source resolution. Y = allow upscaling. N = skip if source is lower resolution. Defaults to Y.

Allowed values:YN
sourcevideostring

Applicable when filemode is combined. Whether to copy the source video stream into the combined output. Defaults to Y.

Allowed values:YN
sourceaudiostring

Applicable when filemode is combined. Y copies the original audio track as-is into the combined output. N includes only the single highest-bitrate transcoded audio track from the selected sub-profiles. Defaults to N.

Allowed values:YN
outdirstring
Required

Output directory path relative to the storage root, required. Empty string stores in root. The characters \< \> : " | ? * are not allowed. Defaults to mp4/.

Example:
output/hd
filtersarray

IDs of transcoding filters to apply, selected from the service's existing filters.

Example:
["1","2"]
profilesarray

IDs of existing single-mode profiles to include as sub-profiles. Applicable when filemode is combined.

Example:
[]

Responses

resultstring

API response status.

messagestring

Human-readable result or error message.

profileidinteger

Transcoding profile identifier used for this job.