Per-Title Configuration Options
Overview
While the Per Title Algorithm can determine all it needs on its own, you can also customize and adjust the way it works in order to be able to make consider your specific encoding requirements as well. Therefore you have several options available for each codec that is supported by our Per-Title encoding algorithm to tune its results to your requirements.
Stream Modes
Stream modes are defining the nature of the encoding: Fixed bitrate ladder, also referred as STANDARD vs. Per-Title.
STANDARD - Standard encoding. This is used to configure renditions that must show up in the output, i.e. will get encoded exactly as configured (no Per-Title encoding).
PER_TITLE_TEMPLATE - This stream will be used as a template for the Per-Title encoding. The Codec Configuration, Muxings, DRMs and Filters applied to the generated Per-Title profile will be based on the same, or closest matching resolutions defined in the template. Please note, that template streams are not necessarily used for the encoding - they are just used as template. Every output (e.g. Muxing or DRM) must define either {uuid} or {bitrate} in the output path. These placeholders will be replaced during the generation of the Per-Title profile.
PER_TITLE_TEMPLATE_FIXED_RESOLUTION It works the same way as the PER_TITLE_TEMPLATE
mode, but it will use the resolution defined in your codec configuration as stated. By contrast, PER_TITLE_TEMPLATE
would consider the defined resolution only as a recommendation, which it would abandon if it was able to obtain a better quality at a different resolution.
PER_TITLE_RESULT - (read only) This mode is available to the Per-Title algorithm only, and is used for streams that got generated and added to the encoding automatically. Later on, they can be used to e.g., generate the appropriate manifests. Codec configurations, muxings, DRM configurations are based on the corresponding PER_TITLE_TEMPLATE stream.
General Codec Configuration Options
These options are available for H264, H265, VP9 and AV1 Per-Title configurations. Where applicable, we provide the default value
for each setting.
minBitrate: 240000
(number, optional) - The minimum bitrate that will be used when generating the per-title profile.
maxBitrate: 1500000
(number, optional) - The maximum bitrate that will be used when generating the per-title profile. It will not generate any rendition with a higher target bitrate.
minBitrateStepSize: 1.5
(number, optional) - This defines the minimum jump from one bitrate to the next higher bitrate, e.g., if the first bitrate is 240,000 and the min step size is 1.5 the next bitrate will be at least 360,000.
maxBitrateStepSize: 1.9
(number, optional) - This defines the maximum jump from one bitrate to the next higher bitrate, e.g., if the first bitrate is 240,000 and the max step size is 1.9 the next bitrate will be at most 456,000.
targetQualityCrf: (number, optional) - This defines the desired target quality of the highest rendition generated by the Per-Title algorithm expressed as CRF value. This allows you to define a trade-off between bitrate and quality of the highest rendition.
- If choosing a lower value the highest rendition will have higher quality but also higher bitrate. The Per-Title algorithm might generate more renditions to hit the target quality.
- If choosing a higher value the highest rendition will have lower quality but also lower bitrate and the Per-Title algorithm might generate fewer renditions.
The default value is codec-dependent:
- 22 for H264/AVC
- 26 for H265/HEVC and VP9
- 34 for AV1
autoRepresentations: (PerTitleAutoRepresentation, optional) - If set, stream configurations will be automatically added to the per-title profile. In that case make sure that you set at least one PER_TITLE_TEMPLATE
stream configuration. All other configurations will be automatically chosen by the per-title algorithm. All relevant settings for streams and muxings will be taken from the closest PER_TITLE_TEMPLATE
stream defined. The closest stream will be chosen based on the resolution specified in the codec configuration.
The parameter adoptConfigurationThreshold
allows you to define if the algorithm should prefer the settings from the higher or the lower resolution. E.g., given you have two Per-Title template streams and an adoptConfigurationThreshold
of 0.5, one for a resolution where only the width is set to 382x and one for 1920x. A generated Per-Title result stream with a resolution of 640x would take settings from the Per-Title template stream with the resolution 382x as it is closer to the resolution of 1920x. Conversely a generated Per-Title result stream with a resolution of 1280x would take the settings from the Per-Title template stream with the resolution of 1920x. Note that adoptConfigurationThreshold
can take a value between 0 and 1, where values closer to 0 will favour the higher resolution, and the lower one for values closer to 1 (*1).
If autoRepresentations
is not set, define one PER_TITLE_TEMPLATE
stream for each resolution that you would like the per-title algorithm to consider when generating the per-title profile.
complexityFactor: 1.0
(number, optional) - Will modify the assumed complexity for the Per-Title algorithm (> 0.0). Values higher than 1, will increase complexity and thus select smaller resolutions for given bitrates. This will also result in a higher bitrate for the top rendition. Values lower than 1, will decrease assumed complexity and thus select higher resolutions for given bitrates and also decrease the bitrate of the top rendition.
All available options can be found in our API reference as well.
Configuration Options for H264, H265
While all of the options described above are available to every codec, the following are specific to H264, and H265 only.
codecMinBitrateFactor: (optional) This factor is used to calculate the minBitrate of the codec configuration for the generated representations as a multiple of the targetBitrate.
codecMaxBitrateFactor: (optional) This factor is used to calculate the maxBitrate of the codec configuration for the generated representations as a multiple of the targetBitrate
codecBufsizeFactor: (optional) This factor is used to calculate the bufsize of the codec configuration for the generated representations as a multiple of the targetBitrate
All available options can be found in our API reference.
Footnotes
(1) - The adoptConfigurationThreshold
setting is used when generating per-title result streams, to decide from which of the 2 nearest per-title templates codec settings should be copied. Using the resolution from 2 templates, an actual resolution threshold is calculated in the following way:
thresholdRes = ((higherRes - lowerRes) * adoptConfigurationThreshold) + lowerRes
For any generated resolution lower than or equal to this threshold resolution, the lower template is used.
So, if the two templates have widths of 1920 and 640, and the adoptConfigurationThreshold
is 0.7, any result stream with a width below or equal to 1536 will use the 640x template. It follows that if you want to make sure that the nearest higher template is always selected for any given result stream, set adoptConfigurationThreshold
to 0
Finally, note that this calculation works whether you set the height or the width on the per-title template streams, since the aspect ratio of the source is retained when only setting either of them on the codec configuration
Updated about 9 hours ago