x265

From wiki.selur.net
Revision as of 07:09, 23 November 2026 by Selur (talk | contribs) (New page (via create-page on MediaWiki MCP Server))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

x265 is the open-source encoder for H.265/HEVC. HEVC needs clearly less bit rate than H.264 for the same quality, supports 10 and 12 bit and carries HDR metadata; x265 is the most widely used software encoder for it. Hybrid drives the command line encoder and exposes nearly all of its options.

Base → Video: x265, then the x265 tab

What it does

x265 splits each frame into coding tree units of up to 64×64 pixels, divides them further into coding, prediction and transform units, predicts each block from other frames (motion estimation) or from its neighbours, and quantizes what is left. How coarse the quantization is decides size and quality; the rate control picks it per frame and per block from the chosen mode:

  • constant rate factor (CRF): constant perceived quality, the size results from the content. The usual choice when no size has to be hit.
  • 2-pass: a first pass analyses the video, the second distributes a given bit rate or file size over it.
  • average bitrate: one pass towards a bit rate; less precise than 2-pass.
  • constant quantizer: the same quantizer for all frames of a type; for tests and for lossless encoding.

Most other options trade encoding time against compression, restrict the stream so that a certain player can decode it, or describe the video (color, HDR) to the player.

Requirements

x265 is part of Hybrid on every system. The build Hybrid ships encodes 8, 10 and 12 bit. 4:2:2, 4:4:4 and 12 bit need the matching range extension profile, which hardware players usually do not support; Main and Main 10 play practically everywhere HEVC does. The hierarchical B-pyramid needs a recent x265 4.3 build; with an older one the entry is not offered.

Settings

The option column shows the x265 option a control ends up as. Many controls are locked depending on the encoding mode, the profile and other controls; the tables name the conditions. Where x265's own default differs from Hybrid's, the tables say so.

Base

x265 Base tab
x265 Base tab

General Settings

The controls below Encoding mode change with the mode.

Control x265 option Range / values Hybrid default Meaning
Encoding mode --crf, --qp, --bitrate, --pass average bitrate (1-pass), constant quantizer (1-pass), constant rate factor (1-pass), specific filesize/bitrate (2-pass), 2pass - 1st pass, 2pass - 2nd pass constant rate factor (1-pass) Rate control mode, see above. The two single-pass entries of 2-pass run only that pass, e.g. to repeat a second pass with an existing statistics file.
Constant rate factor --crf 0 – 51, step 0.01 18 Quality target of the CRF mode; lower is better and bigger. x265's own default is 28; the scale is not the one of x264, the same number gives a different quality.
Quantization strength --qp 0 – 51 32 Quantizer of the constant quantizer mode (for P-frames; I- and B-frames follow through the quant factors).
Lossless --lossless on/off off Lossless encoding in constant quantizer mode: transform, quantization and loop filters are bypassed. Locks the quantizer, the loop filter and the noise reduction. The files get very large.
Bitrate (kbit/s) --bitrate 16 – 8000000 selected, 1500 Target bit rate of the bit rate based modes. The level and tier limit the maximum. In the 2-pass modes the radio button chooses between bit rate and target size.
Target size (MiB), Target mode --bitrate 0.2 MiB and up; custom, 1/4 CD … 1 BD 50 not selected, 700, custom 2-pass only: aim at a file size instead; Hybrid computes the video bit rate from the size, the length and the size of audio and other streams. Target mode offers common media sizes.
Min/Max rate factor --crf-min, --crf-max 0 – 51 each, step 0.01 0 / 0 Only in average bitrate mode. With VBV active they limit the rate factor the encoder may go to; the maximum protects quality at the price of possibly breaking the buffer limits. 0 means no limit.
CBR --strict-cbr on/off off Only in average bitrate mode with a level and a profile set. Keeps the bit rate much closer to the target, at the cost of quality; for streams with a hard bit rate limit. While it is on, Hybrid sets the VBV maximum rate to the bit rate and locks the VBV controls.

2pass Analysis

Only available in the 2-pass modes.

Control x265 option Range / values Hybrid default Meaning
Fast 1st pass --no-slow-firstpass / --slow-firstpass on/off on Runs the first pass with reduced settings, which is much faster and costs hardly any quality. Hybrid also leaves the reference count, motion search method, RDO level, rectangular/asymmetric partitions and early skip out of the first pass call, so that x265's fast values apply.
QP refinement --multi-pass-opt-distortion on/off on Stores the distortion of every CTU in the first pass and gives badly coded CTUs a lower quantizer in the second. Not available with CU-tree; switches Save RPS off.
Analysis refinement --multi-pass-opt-analysis on/off on Stores motion vectors, depths and modes of the first pass and refines them in the second instead of searching again. Not available with CU-tree; switches Save RPS off.
Save RPS --multi-pass-opt-rps on/off off Stores the most common reference picture sets in the sequence header so that slice headers only need an index; saves a few bits in the second pass. Switches the two refinements off.

Color Sampling/Space

Control x265 option Range / values Hybrid default Meaning
Sampling, auto – i420, i422, i444 (as far as the profile allows) i420, auto on Chroma format of the output. x265 takes it from the video it is fed, so Hybrid converts in the filter script. With auto Hybrid uses the highest sampling the profile allows; auto is not available with profile None.
Bit depth, auto --output-depth 8-bit, 10-bit, 12-bit (as far as the profile allows) 8-bit, auto on Bit depth of the stream. With auto the highest depth of the profile, i.e. 10 bit with the default profile Main 10.

Loop Filter

Control x265 option Range / values Hybrid default Meaning
Loop Filter, strength / threshold --deblock=<tC>:<beta> / --no-deblock on/off; -6 – 6 each on, -1 / -1 The deblocking filter of HEVC with its two offsets. Negative values keep more detail, positive values smooth more; x265's default is 0:0. Switching the filter off also switches SAO off.
Selective SAO --selective-sao disabled, only I-slices, only I-&P-slices, all reference slices, all slices all slices On which slice types sample adaptive offset is used (0 – 4). Fewer slice types are faster to encode and decode.
Sample Adaptive Offset --sao / --no-sao on/off on SAO corrects the sample values after deblocking and reduces banding and ringing; it can also soften fine detail. The box is fixed to on while Selective SAO names any slice type; set that to disabled to switch SAO off.
limit --limit-sao on/off on Ends the SAO search early based on prediction mode and neighbouring CTUs; faster and a little milder. x265's default is off.
non-deblock --sao-non-deblock on/off off Uses the not yet deblocked pixels for the SAO analysis instead of skipping the right and bottom border of each CTU.

Preset and Tune

Control x265 option Range / values Hybrid default Meaning
Preset --preset none, ultrafast … placebo none x265's speed presets. The arrow button applies the preset to the controls; nothing changes before that. medium equals x265's defaults.
Tune --tune none, animation, grain, psnr, ssim, fastdecode, zerolatency none Adjustment for a kind of content or a goal; also applied with its arrow button.
Reset to preset – on/off on Apply the selected preset first whenever a tune is applied.

Compatibility Restrictions

Control x265 option Range / values Hybrid default Meaning
Level --level-idc 1.0 – 6.2, unrestricted unrestricted Upper limit for frame size × frame rate, bit rate and buffer. With a level set x265 keeps the stream inside it and Hybrid fills the VBV values from it.
Profile --profile Main 10, Main, Main Still, Main 4:2:2 - 10bit, Main 4:4:4 - 8bit, Main 4:4:4 - 10bit, Main 12, Main 4:2:2 - 12bit, Main 4:4:4 - 12bit, None Main 10 HEVC profile; it decides which bit depths and samplings are offered. None writes no profile and leaves the choice to x265.
Tier --high-tier / --no-high-tier High, Main High The High tier allows higher bit rates at the same level. Only available with a level set, and High only from level 4.0 on.
UHD-Bluray --uhd-bd on/off off Restricts the encode to what Ultra HD Blu-ray accepts: Main 10, level 5.1, High tier, 10 bit 4:2:0, progressive, repeated headers, AUD and HRD on, closed GOP with a key frame every second, square pixels, at most 6 references, primaries limited to bt709/bt2020. The affected controls are set and locked.

Frames

x265 Frames tab
x265 Frames tab

General Slice Decision

Control x265 option Range / values Hybrid default Meaning
Maximum number of reference frames --ref 1 – 8 (7 with B-frames, 6 with B-pyramid or UHD-Bluray) 3 How many earlier frames a frame may refer to. More helps mostly with animation and costs speed and decoder memory.
Optimize reference list --opt-ref-list-length-pps on/off on Writes the reference list lengths seen in the last GOP into the picture header instead of fixed values, which saves a few bits per slice. x265's default is off.
Weighted P-frame prediction --weightp / --no-weightp on/off on Weighted prediction for P-frames; helps most in fades.
Extend GOP --gop-lookahead 0 – 20, at most lookahead − minimum GOP size 0 Lets a GOP run this many frames longer when a scene change follows shortly after the maximum GOP size, so the key frame lands on the cut. Not with open GOP.
Open GOP --open-gop / --no-open-gop on/off off Allows frames to refer across a key frame, which then is not an IDR frame; saves bits with short GOPs, but some players and cutting tools have problems with it. x265's default is on. With open GOP the scene change controls are locked.
Intra refresh --intra-refresh on/off off Replaces IDR frames by a column of intra blocks that moves across the picture; for low-latency streaming.
Fades --fades on/off off Detects fade-ins and adjusts the rate control for them.
CRA --cra-nal on/off off Marks all frames but the first as CRA pictures. Only for intra-only encodes (maximum GOP size 1).
Adjust max gop to output fps – on/off off Sets the maximum GOP size to ten times the output frame rate whenever it changes, and locks the field.
Min/Max GOP size --min-keyint, --keyint 0 – 10000 each 0 / 250 Shortest and longest distance between key frames. Minimum 0 lets x265 choose; maximum 0 is written as --keyint -1 (infinite); maximum 1 gives an intra-only stream and locks the B-frames.
Scene change (thresh/bias) --scenecut, --scenecut-bias / --no-scenecut on/off; 0 – 100 each on, 40 / 5 Scene change detection for placing I-frames: how readily a cut is assumed, and how much more readily near the end of a GOP. Off or threshold 0 disables it.
Histogram scene change --hist-scenecut, --hist-threshold on/off; 0 – 2, step 0.01 off, 0.01 Detects scene changes from edge and color histograms instead; excludes Scene change. The threshold field only exists for x265 builds older than 3.6.

B-Frame Settings

Control x265 option Range / values Hybrid default Meaning
Maximum number of consecutive b-frames --bframes 0 – 16 4 Upper limit of B-frames in a row. 0 locks the other B-frame controls.
Boost b-frame frequency --bframe-bias 0 – 1000 0 Makes the adaptive decision prefer B-frames.
Adaptive b-frame decision --b-adapt none, fast, trellis trellis How x265 decides between P- and B-frames (0, 1, 2). none always uses the maximum, fast is a simple lookahead, trellis searches the best sequence and is slower.
B-Pyramid --b-pyramid none, normal, hierarchical normal Lets B-frames be references for other B-frames (0, 1, 2). normal uses the middle B-frame of a group, hierarchical keeps splitting each half. Available with more than 3 B-frames or with the trellis decision.
B-pyramid QP scale --b-pyramid-qp-scale 0 – 2, step 0.05 1 Only with hierarchical: scales the quantizer offsets of the pyramid layers. 0 codes all B-frames like their anchors, above 1 the deeper layers get coarser.
Temporal layers --temporal-layers on/off off Puts the B-frames nobody refers to into a separate layer that a decoder may drop to play at a lower frame rate.
RADL count --radl 0 – 4, at most the B-frame count 2 Number of leading pictures in front of an IDR frame that are decodable without the previous GOP. Only with a closed GOP of fixed length (minimum = maximum GOP size); otherwise Hybrid writes 0.
Weighted b-frames --weightb / --no-weightb on/off off Weighted prediction for B-frames.

Intra / Inter

Control x265 option Range / values Hybrid default Meaning
Tree unit non-I slice penalty --rdpenalty disabled, RD-penalty, maximum disabled Makes 32×32 intra transform units in P- and B-frames less likely (0, 1, 2); they tend to show as blocks at low bit rates.
Transform skip, fast --tskip, --tskip-fast on/off each off Allows 4×4 blocks to be coded without transform, which helps with sharp edges such as screen content and text. fast shortens the decision; only with transform skip on.
Constrained intra --constrained-intra on/off off Intra blocks do not use inter-coded neighbours; for error resilience.
Intra smoothing --strong-intra-smoothing / --no-strong-intra-smoothing on/off on Strong smoothing of the reference pixels for 32×32 intra blocks; avoids banding in flat areas.
Interlace, field order --interlace tff/bff / --no-interlace on/off; same, tff, bff off, same Encodes fields instead of frames. same takes the field order from the video. x265's interlaced support is basic, deinterlacing first usually gives the better result.
Noise reduction (Intra/Inter) --nr-intra, --nr-inter 0 – 2000 each 0 / 0 Built-in noise reduction in the transform domain for intra and inter blocks. A denoising filter gives better results. Locked with lossless.
Frame (lookahead/slices/threads) --rc-lookahead, --lookahead-slices, --lookahead-threads B-frames + 1 – 250 (at most the maximum GOP size); 0 – 16; -1 – half the logical cores 20 / 0 / 0 Frames the frame type decision and CU-tree look ahead; number of slices a frame is cut into for the lookahead cost estimate (only used from 720 lines on; more is faster and less exact); threads reserved for the lookahead (0 shares the normal pool, -1 uses half the cores).
Analysis file --analysis-reuse-file file empty File for the data of Analysis refinement and QP refinement; empty uses a temporary file. Only in 2-pass with one of the two on.
Statistic file --stats file empty Statistics file of the 2-pass modes; empty uses a temporary file. Editable in the two single-pass entries of 2-pass.

Motion

x265 Motion tab
x265 Motion tab

Motion Estimation

Control x265 option Range / values Hybrid default Meaning
Motion estimation --me dia, hex, umh, star, sea, full hex Motion search method, from fastest to slowest. star is what the slow presets use. Locked with Hierarchical M.E..
Hierarchical M.E. --hme, --hme-search on/off; dia … full for each level off; hex / umh / umh Searches in three steps, on a 1/16 size, a 1/4 size and the full size picture, with one search method per step. Helps with large motion at high resolutions.
Hierarchical M.E. range --hme-range 0 – 32767 each 16 / 32 / 48 Search range of the three steps.
Sub-Pixel precision --subme 0 – 7 2 Effort of the half and quarter pixel refinement; higher is slower and a little more efficient.
Max pixel search range --merange 1 – 32768 57 Search range of the motion search in pixels.

Motion Partitioning

Control x265 option Range / values Hybrid default Meaning
Rectangular --rect / --no-rect on/off off Also tries the rectangular partitions 2N×N and N×2N. Slower, small gain.
Asymmetric --amp / --no-amp on/off off Also tries the asymmetric partitions; needs Rectangular.
Limit modes --limit-modes / --no-limit-modes on/off on Skips rectangular and asymmetric partitions that are unlikely to win, judged from the four sub-blocks; makes those two options much cheaper. x265's default is off.
Temporal motion prediction --temporal-mvp / --no-temporal-mvp on/off on Uses the motion vector of the block at the same position in a reference frame as a predictor.
Max merge candidates --max-merge 1 – 5 3 Number of neighbouring motion vectors tried for merge mode.
Analyse source pics --analyze-src-pics on/off off Runs the motion search on the source frames instead of the reconstructed ones, which lets it run independently of the encode; faster with many cores, slightly less efficient.
MCSTF, Range, selective --mcstf, --mcstf-ref-range, --selective-mcstf on/off; 1 – 4; on/off off, 2, off Motion compensated temporal filter that denoises I- and P-frames before encoding; improves compression of noisy sources. Range is the number of neighbouring frames used on each side; selective skips GOPs that are judged clean.

Quantization

x265 Quantization tab
x265 Quantization tab

General Quantization

Control x265 option Range / values Hybrid default Meaning
Quantfactor I->P/P->B --ipratio, --pbratio 1 – 10 each 1.4 / 1.3 Quantizer ratio between I- and P-frames and between P- and B-frames.
Quantizer step --qpstep 1 – 50 4 Largest quantizer change from one frame to the next.
Quantizer (min/max) --qpmin, --qpmax 0 – 69 each 0 / 69 Limits of the quantizer the rate control may use.
optimize --opt-qp-pps on/off on Writes the quantizer typical for the last GOP into the picture header instead of the fixed 26, so slices need fewer bits for theirs. x265's default is off.
Blur (quantizer/complexity) --qblur, --cplxblur 0 – 1000 each 0.5 / 20 Smooths the quantizer curve after and the complexity before curve compression.
Scene-cut aware qp --scenecut-aware-qp disabled, forward masking, backward masking, bi-directional masking disabled Raises the quantizer of the frames right after and/or before a scene change, where the eye does not notice it. Only in the 2-pass mode and its second pass, with scene change or histogram scene change detection on and a closed GOP.
Forward Masking: Window (ms), Reference delta, Non-Reference delta --masking-strength 0 – 1000; 0 – 10; 0 – 10 500 / 5 / 5 Length of the window after the scene change and the quantizer increase for referenced and unreferenced frames in it.
Backward Masking: Window (ms), Reference delta, Non-Reference delta --masking-strength 0 – 1000; 0 – 10; 0 – 10 100 / 5 / 5 The same for the frames before the scene change.
Custom qp file --qpfile file empty File that forces frame types and quantizers for single frames.

Adaptive quantization

Control x265 option Range / values Hybrid default Meaning
Delta-QP --qp-adaptation-range 1 – 6 1 Range within which the psycho-visual adaptation may move the quantizer of a block.
Adaptive quantization mode/strength --aq-mode, --aq-strength none, normal, auto, dark opt., auto + edge; 0 – 3 none, 1 Shifts bits between flat and detailed areas inside a frame (modes 0 – 4): fixed strength, automatic variance, the same with a bias towards dark scenes, the same with edge information. x265's default is mode 2. Locked in constant quantizer mode and with HEVC adaptive quantization.
HEVC adaptive quantization --hevc-aq on/off off The adaptive quantization of the HEVC reference encoder, based on the least active sub-block of each coding unit. Only with the mode above set to none; Hybrid then switches CU-tree off.
SBRC --sbrc on/off off Segment based rate control: picks the adaptive quantization mode per frame from brightness and edge density. Needs an adaptive quantization mode.
Motion based adaptive quantization --aq-motion on/off off Changes the quantizer of a block according to how its motion differs from the motion of the frame.
Coding unit tree for adaptive quantization --cutree / --no-cutree on/off off Gives blocks that many later frames refer to more bits (x265's counterpart of x264's macroblock tree; on by default in x265). Needs an adaptive quantization mode and no HEVC adaptive quantization; switches the 2-pass refinements off. The controls of the next three rows sit inside this group.
CU lossless --cu-lossless on/off off Also tries to code each coding unit lossless and takes it when that is cheaper. Needs RDO level 3 or more; very slow.
CU delta optimization --opt-cu-delta-qp on/off on Pulls low block quantizers towards the frame average to save signalling bits. Only effective, and only written, from RDO level 5 on.
Coding Unit size (min/max) --min-cu-size, --ctu 8x8, 16x16, 32x32; 16x16, 32x32, 64x64 8x8 / 64x64 Smallest and largest coding unit. A larger maximum compresses flat areas of large frames better but reduces parallelism; a larger minimum is faster and less efficient. The maximum cannot exceed the frame size, and 16x16 is not offered from level 5.0 on.

Misc

Control x265 option Range / values Hybrid default Meaning
Chroma offset (Cb/Cr) --cbqpoffs, --crqpoffs -12 – 12 each -2 / -2 Quantizer offset of the two chroma planes; negative values give chroma more bits. x265's default is 0.
Max au size factor --max-ausize-factor 0.5 – 1 1 Share of the largest access unit size the standard allows that a frame may use.
Lowpass DCT --lowpass-dct on/off off Approximates the transform of 16×16 and 32×32 blocks by a low-pass version; faster, with a small loss.
Wavefront Parallel Processing --wpp on/off on Encodes the CTU rows of a frame in parallel, for about 1 % of compression. With it off Hybrid writes --pools none, which removes the thread pool altogether. Locked with 0 pools or one pool of one thread.

QuadTree

Control x265 option Range / values Hybrid default Meaning
Max tree unit size --max-tu-size 4, 8, 16, 32 32 Largest transform block. Larger compresses better and is slower.
Max intra/inter tree unit depth --tu-intra-depth, --tu-inter-depth 1 – 4 each (less with a small maximum coding unit) 1 / 1 How many times the transform block may be split further than the coding unit, for intra and inter blocks.
Limit transform unit --limit-tu 0 – 4 0 Ends the transform split search of inter blocks early; higher levels are faster. Useful when the inter depth is above 1.
Early skip --early-skip / --no-early-skip on/off off Checks the skip candidate first and stops the analysis of the block if nothing is left to code. Faster, slightly less efficient.
Recursive skip, Threshold --rskip, --rskip-edge-threshold 0 – 2; 0 – 100 1, 5 Ends the split search of a coding unit early: 0 off, 1 from cost and uniformity of the block, 2 from its edge density. The threshold (percent of edge pixels) only applies to mode 2.
Quantization group size --qg-size on/off; 8, 16, 32, 64 (within the coding unit sizes) on, 32 Smallest block that can get its own quantizer. Smaller lets adaptive quantization work finer. Unchecked the option is not written.

Rate Control

x265 Rate Control tab
x265 Rate Control tab

Rate Distortion Optimization

Control x265 option Range / values Hybrid default Meaning
Rate Distortion Optimization --rd 1 – 6 3 How much of the mode decision is done by really encoding the candidates and comparing size and error. Higher is slower and more efficient; 4 adds RDO quantization, 5 and 6 (currently the same) RDO for the prediction decisions.
Hide sign bit --signhide / --no-signhide on/off on Saves the sign of one coefficient per transform block by implying it.
Refine --rd-refine on/off on Re-evaluates the best partition with several quantizers. Only from RDO level 5 on.
Limit references --limit-refs no limit, limit reference depth, limit reference cu, limit reference depth&cu no limit Restricts the reference frames searched to those the sub-blocks or the 2N×2N search chose (0 – 3). Speeds up encodes with several references; x265's default is 1.
Dynamic RD --dynamic-rd 0 – 4 2 Raises the RDO effort for frames in which VBV forces the quality down. Only with a VBV maximum rate, an adaptive quantization mode and an RDO level below 6.
RDO Quantization Level --rdoq-level / --no-rdoq-level 0 – 2 2 Rate-distortion optimized quantization: 0 off, 1 per coefficient, 2 also per coefficient group.
Psy-RDO quantization --psy-rdoq / --no-psy-rdoq 0 – 50 10 Makes RDO quantization keep more coefficients, which preserves grain and texture at the cost of bit rate. Needs an RDO quantization level above 0. x265's default is 0.
Psycho-visual RDO --psy-rd / --no-psy-rd 0 – 5 2.5 Biases the mode decision towards keeping the energy of the source (detail, grain) instead of the smallest error; 0 switches it off. x265's default is 2.0.
Curve compression --qcomp 0.5 – 1 0.6 How much bit rate follows the complexity: lower is closer to a constant bit rate, 1 to a constant quantizer.
B-frame intra --b-intra / --no-b-intra on/off on Allows intra blocks in B-frames. Only from RDO level 5 on; below that Hybrid writes --no-b-intra.
Fast intra --fast-intra / --no-fast-intra on/off off Searches the intra directions in steps instead of testing all 33. Only up to RDO level 3.
Split-RD skip --splitrd-skip on/off off Stops the split analysis of an intra block as soon as the parts cost more than the whole.
SSIM RD --ssim-rd / --no-ssim-rd on/off on Uses an SSIM based distortion measure in the mode decision. From RDO level 3 on. x265's default is off.
RC grain --rc-grain on/off off Rate control variant for grainy film that keeps the quantizer steady within and across frames; part of the grain tune.

Video Buffer Verifier (VBV)

Control x265 option Range / values Hybrid default Meaning
Buffer size (kbit) --vbv-bufsize 0 – limit of level and tier 0 Size of the decoder buffer.
Max fillrate (kbit/s) --vbv-maxrate 0 – limit of level and tier 0 Highest rate at which the buffer is filled, i.e. the peak bit rate.
Initial load --vbv-init 0.1 – 100 0.9 Buffer fill at the start of playback.
Medium limit – unrestricted, UHD-BD, BD 25/50 - x2, BD 25/50 - x1, DVD/BD (5/9), CD off Limits the VBV values to the read speed of the medium and locks the manual fields.
constant --const-vbv on/off off Makes the VBV decisions repeatable between runs; part of the grain tune.
Min fullness(%), Max fullness(%) --min-vbv-fullness, --max-vbv-fullness 0 – 100 each 50 / 80 Band of buffer fill the rate control tries to stay in.
Live multi-pass --vbv-live-multi-pass on/off off Lets the second pass correct the quantizer per frame from the real buffer fill, to avoid VBV violations. 2-pass only.

Hybrid fills buffer size and maximum rate from the chosen level and tier; with the level unrestricted they are 0, which means no VBV. The VBV options are not written in constant quantizer mode.

Zones

x265 Zones tab
x265 Zones tab

A zone gives a range of frames its own treatment, e.g. fewer bits for the credits. Enter start and end frame, the value and the type, then add the zone to the list with the plus button; the arrow loads the selected zone back into the fields for editing, minus removes it. Hybrid passes the list as --zones.

Type x265 zone option Meaning of Mod/Quant
fixed quantizer q= Quantizer for the zone.
bitrate modificator b= Factor on the bit rate of the zone; 1.0 changes nothing.

Signaling

x265 Signaling tab
x265 Signaling tab

These controls describe the stream and the video to the decoder. They do not change the picture, only headers and SEI messages.

General Signaling

Control x265 option Range / values Hybrid default Meaning
HDR --hdr10 / --no-hdr10 on/off off Writes the HDR10 SEI messages. Set and locked as soon as Master Display or Light Level is on. It also reduces the offered matrix values to bt709 and bt2020nc.
AUD --aud / --no-aud on/off off Writes access unit delimiters; some transport streams and players need them.
Max POC --log2-max-poc-lsb 1 – 16 8 Number of bits of the picture order counter in the slice headers.
SEI Info --info / --no-info on/off on Writes the x265 version and the settings used into the stream.
Recovery SEI --idr-recovery-sei on/off off Writes a recovery point SEI at every IDR frame.
HRD --hrd / --no-hrd on/off off Signals the buffer model in the stream; needed for Blu-ray and some broadcast uses. Only with VBV values set and not in constant quantizer mode.
HRD concat --hrd-concat on/off off Sets the concatenation flag in the first buffering period SEI; for chunks that are joined later (all but the first). Needs HRD.
Single SEI --single-sei / --no-single-sei on/off off Packs all SEI messages of a frame into one NAL unit.

Video Usability Information

Control x265 option Range / values Hybrid default Meaning
Range, to input --range limited, full on, to input Value range (tv/pc). With to input Hybrid takes the value of the video that reaches the encoder.
Primaries, to input --colorprim unknown, bt709, bt470m, bt470bg, smpte170m, smpte240m, film, bt2020, smpte428, smpte431, smpte432 off, to input Color primaries.
Matrix, to input --colormatrix unknown, bt709, fcc, bt470bg, smpte170m, smpte240m, gbr, ycgco, bt2020nc, bt2020c, smpte2085, chroma-derived-nc, chroma-derived-c, ictcp on, to input Matrix for the YUV ↔ RGB conversion.
Transfer, to input --transfer unknown, bt709, bt470m, bt470bg, linear, log100, log316, smpte170m, smpte240m, iec61966-2-4, bt1361e, iec61966-2-1, bt2020-10, bt2020-12, smpte2084, smpte428, arib-std-b67 off, to input Transfer function (gamma, PQ, HLG).
Video format --videoformat unknown, component, pal, ntsc, secam, mac off Original video system.
HRD --vui-hrd-info / --no-vui-hrd-info on/off on Also writes the HRD parameters into the VUI. Only with HRD of the general signaling on.
Overscan, Crop (l/t/r/b) --overscan, --crop-rect unknown, show, crop; 0 – 8192 each off, 0 Describes a display window inside the coded frame and whether a player should show or hide the area outside of it. Written only with show or crop and at least one crop value above 0.

The pixel aspect ratio is always written (--sar) and comes from Crop/Resize.

HLG

Control x265 option Range / values Hybrid default Meaning
HLG – on/off off Switches to the signaling used for Hybrid Log-Gamma. While it is on, the two options below are written and the HDR10, HDR10+ and Dolby Vision options are not.
Pic_struct --pic-struct 0 – 12: (progressive) Frame, Top field, Bottom field, … (progressive) Frame Picture structure written into the picture timing SEI of every frame.
Atc SEI --atc-sei 0 – 1024 18 Alternative transfer characteristics SEI: the transfer function the player should prefer. 18 stands for HLG (arib-std-b67), while the VUI transfer stays at a backwards compatible value.

HDR-10/HDR-10+

Control x265 option Range / values Hybrid default Meaning
Light Level, max cll, max fall, from Input --max-cll on/off; 0 – 65535 each off, 0 / 0, from Input on Content light level: brightest pixel and highest frame average in nits. With from Input Hybrid reads both from the source during analysis. Not written while both are 0.
Chroma sample location --chromaloc on/off; 0 – 5 off, 0 Position of the chroma samples; HDR10 with bt2020 normally uses 2 (top left).
HDR opt --hdr10-opt on/off off Adapts the block quantizers to HDR10 content (10 bit 4:2:0). Only with Master Display or Light Level on.
Master Display, from Input --master-display text G(x,y)B(x,y)R(x,y)WP(x,y)L(max,min) off, from Input on Color volume of the mastering display (SMPTE ST 2086). With from Input Hybrid reads it from the source.
Dynamic HDR-10+, optimize --dhdr10-info, --dhdr10-opt JSON file; on/off empty, off HDR10+ metadata file with the tone mapping data per scene or frame. optimize writes the SEI only at IDR frames and where the data changes.

Turning on Master Display or Light Level also sets HDR and Repeat headers and locks both.

Dolby Vision

Control x265 option Range / values Hybrid default Meaning
Dolby Vision Profile --dolby-vision-profile none, 5, 8.1, 8.2 none Single-layer Dolby Vision profile: 5 (Dolby Vision only), 8.1 (HDR10 compatible), 8.2 (SDR compatible).
RPU --dolby-vision-rpu file empty File with the Dolby Vision RPU metadata that is written into the stream. Profile and file are only written together.

Misc

x265 Misc tab
x265 Misc tab

Random Stuff

Control x265 option Hybrid default Meaning
Repeat headers --repeat-headers / --no-repeat-headers off Repeats the parameter sets at every key frame, for streams that are cut or played without a container.
allow non-conformance --allow-non-conformance off With profile None and level unrestricted: lets x265 write streams outside every profile, and raises the reference limit to 16. Such streams may not play anywhere.
No too small warning – off No warning when the computed file size is below 1 MB.
Create qp file for chapters --qpfile on Writes a qp file that puts a key frame at every chapter start. Not used when a custom qp file is set.
Minimize command line --preset, --tune on Shortens the call: Hybrid looks for the preset and tune whose values are all present and writes them instead of the single options, and drops options that equal x265's defaults.

Metrics

Control x265 option Hybrid default Meaning
PSNR, SSIM --psnr, --ssim off Lets x265 report the metrics in its log.

Threading&Co

Control x265 option Range / values Hybrid default Meaning
Pools/Threads --pools 0 – 32; 0 – 64 1 / 0 Number of thread pools and threads per pool. With 0 threads x265 decides and nothing is written; otherwise Hybrid writes the thread count once per pool. 0 pools is written as --pools none.
Frame threads --frame-threads 0 – 1000 0 Number of frames encoded at the same time; 0 lets x265 choose from the core count. More is faster and costs a little quality.
Slices --slices 0 – number of logical cores 1 Splits each frame into this many slices that are coded independently; helps parallel decoding and costs compression. 0 is written as half the core count.

Further controls

Control x265 option Hybrid default Meaning
Film grain, Select File --film-grain off, empty Writes the film grain characteristics from the given file as an SEI message; a player that supports it adds the grain during playback, so the encoder does not have to keep it.
Custom command line addition – empty Text that is added to the call unchanged, for options Hybrid does not offer. It is not shortened and not checked.

The Configuration row below the tabs saves, loads and deletes named sets of all x265 settings.

Example

CRF 18, profile Main 10, level unrestricted on a 10-bit YUV 4:2:0 source (640x352, 25 fps), with Minimize command line on:

vspipe "encodingTempSynthSkript.vpy" - --outputindex 0 -c y4m --progress | x265 --input - --fps 25/1 --output-depth 10 --y4m --profile main10 --limit-modes --no-early-skip --no-open-gop --opt-ref-list-length-pps --crf 18.00 --opt-qp-pps --cbqpoffs -2 --crqpoffs -2 --limit-refs 0 --ssim-rd --psy-rd 2.50 --rdoq-level 2 --psy-rdoq 10.00 --aq-mode 0 --deblock=-1:-1 --limit-sao --no-repeat-headers --range limited --colormatrix smpte170m --sar 1:1 --output "video.265"

Only the options that differ from x265's defaults are left; everything else Hybrid set on the tabs equals the default and was removed by the shortening.

How Hybrid calls it

  • The filter script (Vapoursynth or AviSynth) is piped into x265 as y4m; without a script ffmpeg decodes the source and pipes it.
  • The script delivers the bit depth and color format set on the Base tab; frame size, frame rate and sampling reach x265 through the y4m header.
  • x265 writes a raw HEVC stream; Hybrid muxes it into the chosen container in a separate job.
  • Preset and tune are not passed on as they are selected. Their buttons set the single controls, and Hybrid always builds the call from the controls; --preset and --tune only appear when Minimize command line finds that the values match one. The psnr tune is never written this way, its options stay spelled out.
  • Options that equal x265's default are left out with Minimize command line on.
  • In the 2-pass mode Hybrid creates one job per pass; the first pass writes no video. The qp file for chapters is only passed to the first pass.
  • In constant quantizer mode Hybrid writes the profile but neither level and tier nor VBV and HRD. It also leaves out the options x265 only uses with rate control: minimum/maximum quantizer, blur, adaptive quantization, CU-tree, curve compression, RC grain and the QP optimizations; chroma offsets, quant factors, noise reduction, the qp file and the RDO settings are written.
  • With open GOP the scene change options are not written.

Background

CRF or 2-pass

At the same file size CRF and 2-pass give practically the same quality; they differ in what is fixed, the quality or the size. 2-pass is only needed when the size matters.

Profiles, levels and tiers

Players state what they can decode as profile, level and tier, e.g. Main 10, level 5.1, High tier for Ultra HD Blu-ray. The profile is about bit depth and chroma format, the level about frame size and frame rate, and the tier about the bit rate allowed at that level. A stream above what a hardware player supports usually does not play at all, so set all three when encoding for a device.

HDR

HDR10 needs 10 bit, the bt2020 primaries and matrix, the smpte2084 transfer function and the static metadata (Master Display, Light Level). HDR10+ and Dolby Vision add dynamic metadata from a file on top; HLG needs no metadata, only its transfer function. None of these controls converts the picture: the video that reaches the encoder must already be in the matching color space.

Sources