SVT-HEVC¶
x265 has support for open source HEVC encoder SVT-HEVC
and can generate SVT-HEVC compliant bitstreams. SVT-HEVC encoder can be enabled at run time
using --svt
. Since SVT-HEVC params/CLI are not exposed outside, it has to be
configured only via x265 CLI options. The API’s of SVT-HEVC are accessed through x265’s API
so even library users of x265 can avail this feature, under the condition that x265_param_parse()
API should be used for all param assignment. Params assigned outside of x265_param_parse() API
wont’t be mapped to SVT-HEVC. This document describes the steps needed to compile x265
with SVT-HEVC and CLI options mapping between x265 and SVT-HEVC.
Supported Version¶
Version - 1.4.1
Build Steps¶
This section describes the build steps to be followed to link SVT-HEVC with x265.
SVT-HEVC
Clone SVT-HEVC (say at path “/home/app/”) and build it (follow the build steps in its README file)
Once build is successful, binaries can be found inside the Bin folder at its root directory (“/home/app/SVT-HEVC/Bin/Release/”)
x265
- Set environmental variables SVT_HEVC_INCLUDE_DIR and SVT_HEVC_LIBRARY_DIR to help x265 locate SVT-HEVC. For example:
export SVT_HEVC_INCLUDE_DIR = /home/app/SVT-HEVC/Source/API/
export SVT_HEVC_LIBRARY_DIR = /home/app/SVT-HEVC/Bin/Release/
Enable the cmake option ENABLE_SVT_HEVC and continue the normal build process
CLI options Mapping¶
Once x265 is compiled with SVT-HEVC, SVT-HEVC encoder can be invoked at run time using
--svt
. --svt
can be added anywhere in the command line, x265 application will automatically
parse it first and maps all other x265 CLI’s present in the command line to SVT-HEVC encoder options
internally and configures the same. Below table shows the actual mapping of x265 CLI options to
SVT-HEVC encoder options (Name as shown in SVT-HEVC’s sample configuration file)
x265 CLI option |
SVT-HEVC Encoder Option |
Range |
---|---|---|
InputFile |
Any String |
|
StreamFile |
Any String |
|
EncoderBitDepth |
[8, 10] |
|
SourceWidth |
[64 - 8192] |
|
SourceHeight |
[64 - 8192] |
|
FrameToBeEncoded |
Any Positive Integer |
|
FrameRateNumerator |
Any Positive Integer |
|
FrameRateDenominator |
Any Positive Integer |
|
Profile |
[main, main10] |
|
Level |
|
|
Tier |
||
MinQpAllowed |
[0 - 50] |
|
MaxQpAllowed |
[0 - 51] |
|
LookAheadDistance |
[0 - 250] |
|
SceneChangeDetection |
Any Positive Integer |
|
IntraRefreshType |
||
LoopFilterDisable |
Any Integer |
|
SAO |
||
IntraPeriod |
[(-2) - 255] |
|
ConstrainedIntra |
||
VideoUsabilityInfo |
||
|
HighDynamicRangeInput |
|
AccessUnitDelimeter |
||
RateControlMode |
RateControlMode = 0 |
|
QP |
[0 - 51] |
|
RateControlMode |
RateControlMode = 1 |
|
TargetBitrate |
Any Positive Integer |
|
InterlacedVideo |
[0 - 2] |
|
TargetSocket, LogicalProcessors |
Maximum NUMA Nodes = 2 |
|
MasteringDisplayColorVolume |
Any String |
|
maxCLL, maxFALL |
Any Positve Integer |
|
DolbyVisionProfile |
[8.1] |
|
DolbyVisionRpuFile |
Any String |
|
NaluFile |
Any String |
|
hrdFlag |
[0, 1] |
|
vbvMaxrate |
Any Positive Integer |
|
vbvBufsize |
Any Positive Integer |
|
VbvBufInit |
[0 - 100] |
|
ThreadCount |
Any Number |
|
SearchAreaWidth |
[1 - 256] |
|
SearchAreaHeight |
[1 - 256] |
|
HierarchicalLevels |
[0 - 3] |
|
BaseLayerSwitchMode |
[0, 1] |
|
PredStructure |
[0 - 2] |
|
HME, UseDefaultMeHme |
||
CompressedTenBitFormat |
||
SpeedControlFlag |
||
FpsInVps |
x265 CLI options which are not present in the above table will have no effect if SVT-HEVC is enabled and would be ignored silently with a warning. If SVT-HEVC is enabled, accepted input range of x265 CLI options will change, because it follows SVT-HEVC encoder’s specs, which are mentioned in the Range section in the above table. Options starting with prefix “–svt-” are newly added to fecilitate access to the features of SVT-HEVC which couldn’t be mapped to the existing x265 CLI’s. So these options will have effect only if SVT-HEVC is enabled and would be ignored with default x265 encode.
Preset Option Mapping¶
x265 has 10 presets from ultrafast to placebo whereas SVT-HEVC has 12 presets. Use --svt-preset-tuner
with Placebo preset to access the additional 2 presets of SVT-HEVC. Note that --svt-preset-tuner
should be
used only if SVT-HEVC is enabled and only with Placebo preset, would be ignored otherwise.
Below table shows the actual mapping of presets,
x265 Preset |
SVT-HEVC Preset |
---|---|
Ultrafast |
11 |
Superfast |
10 |
Veryfast |
9 |
Faster |
8 |
Fast |
7 |
Medium |
6 |
Slow |
5 |
Slower |
4 |
Veryslow |
3 |
Placebo |
2 |
Placebo |
0 |
Placebo |
1 |