Transcode profiles are used to transcode items
Transcode profiles support the notion of a scale type. This is only used when both the width and height of a transcode profile are provided (i.e. they are not -1). In this case the platform needs to decide how to scale the input video. There are three possible values:
- stretch: stretch the input video so it fits exactly in the output format. Note that this can change the aspect ratio of the input video, i.e. the video can appear stretched.
- aspectfit: keep the aspect ratio of the input video and enlarge / shrink the video so that it fits exactly. This will create black bars at the top and bottom or left and right side of the video if the aspect ratio of the input video is different from the transcode profile.
- aspectfill: keep the aspect ratio of the input video and enlarge / shrink the video so that the output video is exactly filled with the input video. This will remove the outer parts (either top/bottom or left/right) of the input video if the aspect ratio of the input video is different from the transcode profile.
For example, if the input video has a width of 200 and a height of 100 and the transcode profile defines both a width and height of 100, the following will happen for each option:
- stretch: the input video will be shrunk to a width and height of 100, thus fitting two input pixels in each output pixel for the width, which will result in the aspect ratio of the video to change from 2:1 to 1:1.
- aspectfit: the input video will be fit in 100x100 and thus black bars will be added to the top and bottom of the video, each being 25 pixels high, so that the original video will be in a 50x100 frame inside the output video.
- aspectfill: the leftmost 50 pixels and the rightmost 50 pixels of the input video will be chopped of and the other 100x100 pixels of the input video will be used as output.
When transcoding video the platform supports deinterlacing input video and producing both progressive and interlaced output videos.
For input deinterlacing three values are supported (the numeric values are here for backwards compatibility. It is recommended to use the string variants):
- deinterlace (1): always deinterlace the video before doing anything else, even if it is already in a progressive format
- keep (0): never deinterlace the video, even if it is interlaced
- auto (-1): auto-detect required deinterlacing. This will apply deinterlacing if the input video is interlaced, and the final output scantype is progressive
For output the system again accepts three values:
- interlaced: always produce an interlaced output video
- progressive: always produce a progressive output video
- auto: produce an interlaced video only if the input is an interlaced video and it is not being deinterlaced; this will thus only output an interlaced video if auto (-1) is given for input deinterlacing or if input deinterlacing is set to keep (0) and the input video is interlaced
Note that there are two combinations that will probably not be what is intended:
- If input deinterlacing is set to deinterlace (1) and output is set to interlaced the system will first deinterlace the video and afterwards output it as interlaced again, thus doing a useless step. This will result in a loss of quality
- If input deinterlacing is set to keep (0) and output is set to progressive then an input video that is interlaced will be output as progressive without deinterlacing it, thus resulting in stripes through the video
The following actions are defined for this command: