Create

Create a new transcode profile

Tokens

This action requires the following tokens:

  • profile-write

Arguments

Required arguments are marked in bold, and optional arguments are marked in italics.

Argument Type Default Description
itemtype Label   Type of item this profile is for. See allitemtypes
itemfileformat Label   Item file format for this profile. See allitemfileformats
name String   Name of this profile
defaultpriority String medium

Default priority for this profile

This argument can only contain one of the following values:

  • idle
  • low
  • medium
  • high
  • realtime
width Integer   Width of the resulting video in pixels. If this is -1 it will be calculated based on the dimensions of the video to transcode and the height of this profile
height Integer   Height of the resulting video in pixels. If this is -1 it will be calculated based on the dimensions of the video to transcode and the width of this profile. Note that if this value is not -1, it is required to be a multiple of 4 if this profile might output interlaced video
allowupscaling Boolean true Whether to allow upscaling of video
audiocodec Label   Audio codec for this profile. See Allaudiocodecs. Required when item-type contains audio
audiobitrate Integer   Audio bit rate in bits per seconds. Required when item-type contains audio
audiochannels Integer 2 The number of audio channels. Required when item-type contains audio
audiobitdepth Integer   Audio bit depth in bits per sample. Required when item-type contains audio
audiosamplerate Integer   false sample rate in Hz. Required when item-type contains audio
videocodec Label   Video codec for this profile. See Allvideocodecs
videocodecprofile Label   Video codec profile or this profile. See Allvideocodecprofiles
videobitrate Integer   Video bit rate in bits per second
videogoprate Integer   The video GoP / keyframe rate in frames per second
videogopratefactor Float   The video GoP rate factor in seconds per GoP; if both this and videogoprate are set, videogoprate is used
videoframerate Integer   Video frame rate in frames per second
videoframeratemax Integer   Maximum video frame rate in frames per second
usevbr Boolean true Whether to use a variable bit rate
numpasses Integer 1

Number of passes to perform

This argument can only contain one of the following values:

  • 1
  • 2
sharpen Boolean false Whether to sharpen the video
deinterlace Label auto

Whether to deinterlace the input video. See transcodeprofile for more information about the possible values

This argument can only contain one of the following values:

  • auto
  • keep
  • deinterlace
  • -1
  • 0
  • 1
outputscantype Label auto

The output scan type of videos created with this profile. See transcodeprofile for more information about the possible values

This argument can only contain one of the following values:

  • auto
  • interlaced
  • progressive
bframemax Integer 0 The maximum number of consecutive B-frames to allow; 0 means no limit
bframestrategy Label default

The strategy to use for determining B-frames

This argument can only contain one of the following values:

  • default
  • simple
deletesource Boolean false Whether to delete the source item file after successfully transcoding. The item-file-delete token is needed to enable this
croptop Integer   Number of pixels to crop off the top of the source video
cropbottom Integer   Number of pixels to crop off the bottom of the source video
cropleft Integer   Number of pixels to crop off the left of the source video
cropright Integer   Number of pixels to crop off the right of the source video
overlayitemfile Hash   Overlay item file for this profile
overlayheight Integer   Overlay height for the overlay item in whole percent (0-100)
overlayoffset Integer   Offset for the overlay item in whole percent (0-100)
overlayposition String  

Base position to use for the overlay image

This argument can only contain one of the following values:

  • tl
  • tr
  • bl
  • br
  • center
qualitypreset String medium

Quality preset to use for the profile

This argument can only contain one of the following values:

  • superfast
  • veryfast
  • faster
  • fast
  • medium
qualitytuning String none

Quality tuning to use for the profile

This argument can only contain one of the following values:

  • none
  • film
  • animation
  • grain
  • stillimage
  • fastdecode
archive Boolean false Whether to archive item files created by this profile
rotation String auto

Rotation to apply to videos created by this profile

This argument can only contain one of the following values:

  • auto
  • keepmetadata
  • rotate0
  • rotate90
  • rotate180
  • rotate270
scaletype String stretch

Scale type to use for the profile. See transcodeprofile for more information

This argument can only contain one of the following values:

  • stretch
  • aspectfit
  • aspectfill

Output

This action produces the following output on success:

An object containing the following fields:

Name Type Description
id Hash ID of this transcode profile
name String Name of this transcode profile
defaultpriority String The default priority of transcode jobs created using this profile; one of idle, low, normal, high or realtime
account

If set, the account to which this profile is limited; if not set, this profile is available system-wide

The value of this field is an object containing the following fields:

Name Type Description
id Hash Account ID
name String Account name
itemtype Label Item type of the resulting file
width Integer Width of the resulting video in pixels. If this is -1 it will be calculated based on the dimensions of the video to transcode and the height of this profile
height Integer Height of the resulting video in pixels. If this is -1 it will be calculated based on the dimensions of the video to transcode and the width of this profile. Note that if this value is not -1, it will always be a multiple of 4 if this profile might output interlaced video
allowupscaling Boolean Whether to allow upscaling of video
audiocodec Label The audio codec used
audiochannels Integer The number of audio channels
audiobitrate Integer Audio bit rate in bits per second
audiobitdepth Integer Audio bit depth in bits per sample
audiosamplerate Integer Audio sample rate in Hz
videocodec Label The video codec used
videobitrate Integer Video bit rate in bits per second
videoframerate Float Video frame rate in frames per second
videoframeratemax Integer If set, maximum video frame rate in frames per second
itemfileformat Label If set, the item file format of this profile
videocodecprofile Label If set, the video codec profile to use
videogoprate Integer The video GoP / keyframe rate in frames per second
videogopratefactor Float The video GoP rate factor in seconds per GoP
usevbr Boolean Whether to use a variable bit rate
numpasses Integer Number of passes to perform; 1 or 2
sharpen Boolean Whether to sharpen the video
deinterlace Integer Whether to deinterlace the video. This field is here for backwards compatibility. Recommended is to use the ‘inputdeinterlacing’ field: possible values: 1 = deinterlace, 0 = keep, -1 = auto. See transcodeprofile for more information
inputdeinterlacing Label Whether to deinterlace the video; possible values are auto, deinterlace and keep. See transcodeprofile for more information
outputscantype Label The output scan type for videos created with this profile; possible values are auto, interlaced and progressive. See transcodeprofile for more information
bframemax Integer The maximum number of consecutive B-frames; 0 means no limit
bframestrategy Label Strategy to use for determining B-frames; either default or simple
scaletype String Scale type to use for this profile if both width and height are given. See transcodeprofile for more information
croptop Integer If set, number of pixels to crop off the top of the source video
cropbottom Integer If set, number of pixels to crop off the bottom of the source video
cropleft Integer If set, number of pixels to crop off the left of the source video
cropright Integer If set, number of pixels to crop off the right of the source video
deletesource Boolean Whether to delete the source item file after transcoding has completed successfully
overlayitemfile

The ItemFile we use as an overlay image

The value of this field is an object containing the following fields:

Name Type Description
id Hash ID of this item file
type String Type of this item file
originalfilename String Original, human-readable name of this file
extension String Extension of this file
size Integer File size in bytes
datecreated DateTime When this file was created
datemodified DateTime When this file was last modified
origin String Origin of this file
archived Boolean True if this item has been archived
deleted Boolean True if the item has been deleted
profile

The profile used to encode this file

The value of this field is an object containing the following fields:

Name Type Description
id Hash Unique identifier for the profile
name String Name of the profile
width Integer Width of the file in pixels (for video files)
height Integer Height of the file in pixels (for video files)
format String File format/container
audiocodec String Audio codec used in this file (for audio files)
audiocodecname String Name of the audio codec used in this file (for audio files)
audiocodecdescription String Description of the audio codec used in this file (for audio files)
audiochannels Integer Number of audio channels (for audio files)
audiobitrate Integer Audio bitrate in bits per second (for audio files)
audiosamplerate Integer Audio sampel rate in Hz (for audio files)
audiobitdepth Integer Number of bits per audio sample (for audio files)
videocodec String Video codec used in this file (for video files)
videocodecname String Name of the video codec used in this file (for video files)
videocodecdescription String Description of the video codec used in this file (for video files)
videocodecprofile Label Video codec profile used in this file (for video files)
videocodecprofilename String Name of the video codec profile used in this file (for video files)
videocodecprofilelevel Float Video codec profile used in this file (for video files)
videobitrate Integer Video bitrate in bits per second (for video files)
videoaspect Float Video aspect ratio (for video files)
videoframerate Float Video frame rate in frames per second (for video files)
videogoprate Integer Video group-of-frame rate: the number of frames between 2 consecutive keyframes (for video files)
videoisvbr Boolean True if the video has a variable bit rate, false if it has a constant bit rate (for video files)
videoisinterlaced Boolean True if the video is interlaced, false if it is progressive (for video files)
corrupted Boolean True if and only if this file is corrupted
rotation Integer Rotation of this video file (for video files)
medialink

The URLs at which this item file is available for streaming

The value of this field is an object containing the following fields:

Name Type Description
progressive String The URL at which this item file can be streamed using progressive streaming
hls String The URL at which this item file can be streamed using HTTP Live Streaming
dash String The URL at which this item file can be streamed using MPEG-DASH
smooth String The URL at which this item file can be streamed using Smooth Streaming
hds String The URL at which this item file can be streamed using HTTP Dynamic Streaming
overlayposition String Base position to use for the overlay image (tl/tr/bl/br/center)
overlayoffset Integer Overlay offset in whole percent (0-100)
overlayheight Integer Overlay height in whole percent (0-100)
qualitypreset String Quality preset of this profile as one of the QUALITY_PRESET_* constants
qualitytuning String Quality tuning of this profile as one of the QUALITY_TUNING_* constants
archive Boolean Whether to archive item files created with this profile
rotation String Rotation setting for this profile. auto = automatically detect and fix rotation from metadata. keepmetadata = do not rotate but keep metadata in output, rotate0/90/180/270 = force rotation by this amount of degrees

Errors

This action can return one of the default status codes, or one of the following status codes on error:

STATUS_ITEM_FILE_FORMAT_NOT_FOUND (371)
The requested item file format was not found
STATUS_ITEM_TYPE_NOT_FOUND (372)
The requested item type was not found
STATUS_ITEM_FILE_NOT_FOUND (122)
The requested item file was not found
STATUS_AUDIO_CODEC_NOT_FOUND (373)
The requested audio codec was not found
STATUS_VIDEO_CODEC_NOT_FOUND (374)
The requested video codec was not found
STATUS_VIDEO_CODEC_PROFILE_NOT_FOUND (375)
The requested video codec profile was not found
STATUS_PROFILE_INVALID_HEIGHT_FOR_INTERLACED (379)
This profile can output interlaced video but the height is not a multiple of four
STATUS_ACCESS_DENIED (4)