Syntax: x265 [options] infile [-o] outfile
infile can be YUV or Y4M
outfile is raw HEVC bitstream
Executable Options:
-h/--help Show this help text and exit
--fullhelp Show all options and exit
-V/--version Show version info and exit
Output Options:
-o/--output
-D/--output-depth 8|10|12 Output bit depth (also internal bit depth). Default 8
--log-level
--no-progress Disable CLI progress reports
--csv
--csv-log-level
Input Options:
--input
--y4m Force parsing of input stream as YUV4MPEG2 regardless of file extension
--fps
--input-res WxH Source picture size [w x h], auto-detected if Y4M
--input-depth
--input-csp
0 - i400 (4:0:0 monochrome)
1 - i420 (4:2:0 default)
2 - i422 (4:2:2)
3 - i444 (4:4:4)
-f/--frames
--seek
--[no-]interlace
--dither Enable dither if downscaling to 8 bit pixels. Default disabled
--[no-]copy-pic Copy buffers of input picture in frame. Default enabled
Quality reporting metrics:
--[no-]ssim Enable reporting SSIM metric scores. Default disabled
--[no-]psnr Enable reporting PSNR metric scores. Default disabled
Profile, Level, Tier:
-P/--profile
--level-idc
--[no-]high-tier If a decoder level is specified, this modifier selects High tier of that level
--uhd-bd Enable UHD Bluray compatibility support
--[no-]allow-non-conformance Allow the encoder to generate profile NONE bitstreams. Default disabled
Threading, performance:
--pools
'-' implies no threads on node, '+' implies one thread per core on node
-F/--frame-threads
--[no-]wpp Enable Wavefront Parallel Processing. Default enabled
--[no-]slices
--[no-]pmode Parallel mode analysis. Default disabled
--[no-]pme Parallel motion estimation. Default disabled
--[no-]asm
Presets:
-p/--preset
ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, or placebo
-t/--tune
psnr, ssim, grain, zerolatency, fastdecode
Quad-Tree size and depth:
-s/--ctu <64|32|16> Maximum CU size (WxH). Default 64
--min-cu-size <64|32|16|8> Minimum CU size (WxH). Default 8
--max-tu-size <32|16|8|4> Maximum TU size (WxH). Default 32
--tu-intra-depth
--tu-inter-depth
--limit-tu <0..4> Enable early exit from TU recursion for inter coded blocks. Default 0
Analysis:
--rd <1..6> Level of RDO in mode decision 1:least....6:full RDO. Default 3
--[no-]psy-rd <0..5.0> Strength of psycho-visual rate distortion optimization, 0 to disable. Default 2.0
--[no-]rdoq-level <0|1|2> Level of RDO in quantization 0:none, 1:levels, 2:levels & coding groups. Default 0
--[no-]psy-rdoq <0..50.0> Strength of psycho-visual optimization in RDO quantization, 0 to disable. Default 0.0
--dynamic-rd <0..4.0> Strength of dynamic RD, 0 to disable. Default 0.00
--[no-]ssim-rd Enable ssim rate distortion optimization, 0 to disable. Default disabled
--[no-]rd-refine Enable QP based RD refinement for rd levels 5 and 6. Default disabled
--[no-]early-skip Enable early SKIP detection. Default disabled
--[no-]rskip Enable early exit from recursion. Default enabled
--[no-]tskip-fast Enable fast intra transform skipping. Default disabled
--[no-]splitrd-skip Enable skipping split RD analysis when sum of split CU rdCost larger than none split CU rdCost for Intra CU. Default disabled
--nr-intra
--nr-inter
--ctu-info
- 1: force the partitions if CTU information is present
- 2: functionality of (1) and reduce qp if CTU information has changed
- 4: functionality of (1) and force Inter modes when CTU Information has changed, merge/skip otherwise
Enable this option only when planning to invoke the API function x265_encoder_ctu_info to copy ctu-info asynchronously
Coding tools:
-w/--[no-]weightp Enable weighted prediction in P slices. Default enabled
--[no-]weightb Enable weighted prediction in B slices. Default disabled
--[no-]cu-lossless Consider lossless mode in CU RDO decisions. Default disabled
--[no-]signhide Hide sign bit of one coeff per TU (rdo). Default enabled
--[no-]tskip Enable intra 4x4 transform skipping. Default disabled
Temporal / motion search options:
--max-merge <1..5> Maximum number of merge candidates. Default 2
--ref
--limit-refs <0|1|2|3> Limit references per depth (1) or CU (2) or both (3). Default 3
--me
-m/--subme
--merange
--[no-]rect Enable rectangular motion partitions Nx2N and 2NxN. Default disabled
--[no-]amp Enable asymmetric motion partitions, requires --rect. Default disabled
--[no-]limit-modes Limit rectangular and asymmetric motion predictions. Default 0
--[no-]temporal-mvp Enable temporal MV predictors. Default enabled
Spatial / intra options:
--[no-]strong-intra-smoothing Enable strong intra smoothing for 32x32 blocks. Default enabled
--[no-]constrained-intra Constrained intra prediction (use only intra coded reference pixels) Default disabled
--[no-]b-intra Enable intra in B frames in veryslow presets. Default disabled
--[no-]fast-intra Enable faster search method for angular intra predictions. Default disabled
--rdpenalty <0..2> penalty for 32x32 intra TU in non-I slices. 0:disabled 1:RD-penalty 2:maximum. Default 0
Slice decision options:
--[no-]open-gop Enable open-GOP, allows I slices to be non-IDR. Default enabled
-I/--keyint
-i/--min-keyint
--gop-lookahead
--no-scenecut Disable adaptive I-frame decision
--scenecut
--scenecut-bias <0..100.0> Bias for scenecut detection. Default 5.00
--radl
--intra-refresh Use Periodic Intra Refresh instead of IDR frames
--rc-lookahead
--lookahead-slices <0..16> Number of slices to use per lookahead cost estimate. Default 8
--lookahead-threads
-b/--bframes <0..16> Maximum number of consecutive b-frames. Default 4
--bframe-bias
--b-adapt <0..2> 0 - none, 1 - fast, 2 - full (trellis) adaptive B frame scheduling. Default 2
--[no-]b-pyramid Use B-frames as references. Default enabled
--qpfile
Format of each line: framenumber frametype QP
QP is optional (none lets x265 choose). Frametypes: I,i,K,P,B,b.
QPs are restricted by qpmin/qpmax.
--force-flush
0 - flush the encoder only when all the input pictures are over.
1 - flush all the frames even when the input is not over. Slicetype decision may change with this option.
2 - flush the slicetype decided frames only.
Rate control, Adaptive Quantization:
--bitrate
-q/--qp
--crf
--[no-]lossless Enable lossless: bypass transform, quant and loop filters globally. Default disabled
--crf-max
May cause VBV underflows!
--crf-min
this specifies a minimum rate factor value for encode!
--vbv-maxrate
--vbv-bufsize
--vbv-init
--vbv-end
--vbv-end-fr-adj
--pass Multi pass rate control.
- 1 : First pass, creates stats file
- 2 : Last pass, does not overwrite stats file
- 3 : Nth pass, overwrites stats file
--[no-]multi-pass-opt-analysis Refine analysis in 2 pass based on analysis information from pass 1
--[no-]multi-pass-opt-distortion Use distortion of CTU from pass 1 to refine qp in 2 pass
--stats Filename for stats file in multipass pass rate control. Default x265_2pass.log
--[no-]analyze-src-pics Motion estimation uses source frame planes. Default disable
--[no-]slow-firstpass Enable a slow first pass in a multipass rate control mode. Default enabled
--[no-]strict-cbr Enable stricter conditions and tolerance for bitrate deviations in CBR mode. Default disabled
--analysis-save
--analysis-load
--analysis-reuse-file
--analysis-reuse-level <1..10> Level of analysis reuse indicates amount of info stored/reused in save/load mode, 1:least..10:most. Default 5
--refine-mv-type
--scale-factor
--refine-intra <0..4> Enable intra refinement for encode that uses analysis-load.
- 0 : Forces both mode and depth from the save encode.
- 1 : Functionality of (0) + evaluate all intra modes at min-cu-size's depth when current depth is one smaller than min-cu-size's depth.
- 2 : Functionality of (1) + irrespective of size evaluate all angular modes when the save encode decides the best mode as angular.
- 3 : Functionality of (1) + irrespective of size evaluate all intra modes.
- 4 : Re-evaluate all intra blocks, does not reuse data from save encode.
Default:0
--refine-inter <0..3> Enable inter refinement for encode that uses analysis-load.
- 0 : Forces both mode and depth from the save encode.
- 1 : Functionality of (0) + evaluate all inter modes at min-cu-size's depth when current depth is one smaller than
min-cu-size's depth. When save encode decides the current block as skip(for all sizes) evaluate skip/merge.
- 2 : Functionality of (1) + irrespective of size restrict the modes evaluated when specific modes are decided as the best mode by the save encode.
- 3 : Functionality of (1) + irrespective of size evaluate all inter modes.
Default:0
--[no-]dynamic-refine Dynamically changes refine-inter level for each CU. Default disabled
--[no-]refine-mv Enable mv refinement for load mode. Default disabled
--aq-mode
--aq-strength
--[no-]aq-motion Adaptive Quantization based on the relative motion of each CU w.r.t., frame. Default disabled
--qg-size
--[no-]cutree Enable cutree for Adaptive Quantization. Default enabled
--[no-]rc-grain Enable ratecontrol mode to handle grains specifically. turned on with tune grain. Default disabled
--ipratio
--pbratio
--qcomp
--qpstep
--qpmin
--qpmax
--[no-]const-vbv Enable consistent vbv. turned on with tune grain. Default disabled
--cbqpoffs
--crqpoffs
--scaling-list
--zones
Each zone is of the form
Loop filters (deblock and SAO):
--[no-]deblock Enable Deblocking Loop Filter, optionally specify tC:Beta offsets Default enabled
--[no-]sao Enable Sample Adaptive Offset. Default enabled
--[no-]sao-non-deblock Use non-deblocked pixels, else right/bottom boundary areas skipped. Default disabled
--[no-]limit-sao Limit Sample Adaptive Offset types. Default disabled
VUI options:
--sar
Choose from 0=undef, 1=1:1("square"), 2=12:11, 3=10:11, 4=16:11,
5=40:33, 6=24:11, 7=20:11, 8=32:11, 9=80:33, 10=18:11, 11=15:11,
12=64:33, 13=160:99, 14=4:3, 15=3:2, 16=2:1 or custom ratio of
--display-window
--overscan
--videoformat
--range
--colorprim
smpte240m, film, bt2020, smpte428, smpte431, smpte432. Default undef
--transfer
smpte240m, linear, log100, log316, iec61966-2-4, bt1361e, iec61966-2-1,
bt2020-10, bt2020-12, smpte2084, smpte428, arib-std-b67. Default undef
--colormatrix
smpte240m, GBR, YCgCo, bt2020nc, bt2020c, smpte2085, chroma-derived-nc, chroma-derived-c, ictcp. Default undef
--chromaloc
--master-display
format: G(x,y)B(x,y)R(x,y)WP(x,y)L(max,min)
--max-cll
--[no-]hdr Control dumping of HDR SEI packet. If max-cll or master-display has non-zero values, this is enabled. Default disabled
--[no-]hdr-opt Add luma and chroma offsets for HDR/WCG content. Default disabled
--min-luma
--max-luma
Bitstream options:
--[no-]repeat-headers Emit SPS and PPS headers at each keyframe. Default disabled
--[no-]info Emit SEI identifying encoder and parameters. Default enabled
--[no-]hrd Enable HRD parameters signaling. Default disabled
--[no-]idr-recovery-sei Emit recovery point infor SEI at each IDR frame
--[no-]temporal-layers Enable a temporal sublayer for unreferenced B frames. Default disabled
--[no-]aud Emit access unit delimiters at the start of each access unit. Default disabled
--hash
--atc-sei
--pic-struct
--log2-max-poc-lsb
--[no-]vui-timing-info Emit VUI timing information in the bistream. Default enabled
--[no-]vui-hrd-info Emit VUI HRD information in the bistream. Default enabled
--[no-]opt-qp-pps Dynamically optimize QP in PPS (instead of default 26) based on QPs in previous GOP. Default disabled
--[no-]opt-ref-list-length-pps Dynamically set L0 and L1 ref list length in PPS (instead of default 0) based on values in last GOP. Default disabled
--[no-]multi-pass-opt-rps Enable storing commonly used RPS in SPS in multi pass mode. Default disabled
--[no-]opt-cu-delta-qp Optimize to signal consistent CU level delta QPs in frame. Default disabled
Reconstructed video options (debugging):
-r/--recon
--recon-depth
--recon-y4m-exec
--lowpass-dct Use low-pass subband dct approximation. Default disabled
Executable return codes:
0 - encode successful
1 - unable to parse command line
2 - unable to open encoder
3 - unable to generate stream headers
4 - encoder abort
Complete documentation may be found at http://x265.readthedocs.org/en/default/cli.html