.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2. .TH X264 "1" "June 2022" "Videolan project" "User Commands" .SH NAME x264 \- fast h264 encoder .SH DESCRIPTION x264 core:164 r3095 baee400 Syntax: x264 [options] \fB\-o\fR outfile infile .PP Infile can be raw (in which case resolution is required), .IP or YUV4MPEG (*.y4m), or Avisynth if compiled with support (yes). or libav* formats if compiled with lavf support (yes) or ffms support (yes). .SS "Outfile type is selected by filename:" .IP \&.264 \-> Raw bytestream \&.mkv \-> Matroska \&.flv \-> Flash Video \&.mp4 \-> MP4 if compiled with GPAC or L\-SMASH support (gpac) .PP Output bit depth: 8/10 .SH OPTIONS .TP \fB\-h\fR, \fB\-\-help\fR List basic options .TP \fB\-\-longhelp\fR List more options .TP \fB\-\-fullhelp\fR List all options .PP Example usage: .IP Constant quality mode: .IP x264 \fB\-\-crf\fR 24 \fB\-o\fR .IP Two\-pass with a bitrate of 1000kbps: .IP x264 \fB\-\-pass\fR 1 \fB\-\-bitrate\fR 1000 \fB\-o\fR x264 \fB\-\-pass\fR 2 \fB\-\-bitrate\fR 1000 \fB\-o\fR .IP Lossless: .IP x264 \fB\-\-qp\fR 0 \fB\-o\fR .IP Maximum PSNR at the cost of speed and visual quality: .IP x264 \fB\-\-preset\fR placebo \fB\-\-tune\fR psnr \fB\-o\fR .IP Constant bitrate at 1000kbps with a 2 second\-buffer: .IP x264 \fB\-\-vbv\-bufsize\fR 2000 \fB\-\-bitrate\fR 1000 \fB\-o\fR .PP Presets: .TP \fB\-\-profile\fR Force the limits of an H.264 profile Overrides all settings. \- baseline: .TP \fB\-\-no\-8x8dct\fR \fB\-\-bframes\fR 0 \fB\-\-no\-cabac\fR \fB\-\-cqm\fR flat \fB\-\-weightp\fR 0 No interlaced. No lossless. .TP \- main: \fB\-\-no\-8x8dct\fR \fB\-\-cqm\fR flat No lossless. .TP \- high: No lossless. .TP \- high10: No lossless. Support for bit depth 8\-10. .TP \- high422: No lossless. Support for bit depth 8\-10. Support for 4:2:0/4:2:2 chroma subsampling. .TP \- high444: Support for bit depth 8\-10. Support for 4:2:0/4:2:2/4:4:4 chroma subsampling. .TP \fB\-\-preset\fR Use a preset to select encoding settings [medium] Overridden by user settings. \- ultrafast: .TP \fB\-\-no\-8x8dct\fR \fB\-\-aq\-mode\fR 0 \fB\-\-b\-adapt\fR 0 \fB\-\-bframes\fR 0 \fB\-\-no\-cabac\fR \fB\-\-no\-deblock\fR \fB\-\-no\-mbtree\fR \fB\-\-me\fR dia \fB\-\-no\-mixed\-refs\fR \fB\-\-partitions\fR none \fB\-\-rc\-lookahead\fR 0 \fB\-\-ref\fR 1 \fB\-\-scenecut\fR 0 \fB\-\-subme\fR 0 \fB\-\-trellis\fR 0 \fB\-\-no\-weightb\fR \fB\-\-weightp\fR 0 .TP \- superfast: \fB\-\-no\-mbtree\fR \fB\-\-me\fR dia \fB\-\-no\-mixed\-refs\fR \fB\-\-partitions\fR i8x8,i4x4 \fB\-\-rc\-lookahead\fR 0 \fB\-\-ref\fR 1 \fB\-\-subme\fR 1 \fB\-\-trellis\fR 0 \fB\-\-weightp\fR 1 .TP \- veryfast: \fB\-\-no\-mixed\-refs\fR \fB\-\-rc\-lookahead\fR 10 \fB\-\-ref\fR 1 \fB\-\-subme\fR 2 \fB\-\-trellis\fR 0 \fB\-\-weightp\fR 1 .TP \- faster: \fB\-\-no\-mixed\-refs\fR \fB\-\-rc\-lookahead\fR 20 \fB\-\-ref\fR 2 \fB\-\-subme\fR 4 \fB\-\-weightp\fR 1 .TP \- fast: \fB\-\-rc\-lookahead\fR 30 \fB\-\-ref\fR 2 \fB\-\-subme\fR 6 \fB\-\-weightp\fR 1 .TP \- medium: Default settings apply. .TP \- slow: \fB\-\-direct\fR auto \fB\-\-rc\-lookahead\fR 50 \fB\-\-ref\fR 5 \fB\-\-subme\fR 8 \fB\-\-trellis\fR 2 .TP \- slower: \fB\-\-b\-adapt\fR 2 \fB\-\-direct\fR auto \fB\-\-me\fR umh \fB\-\-partitions\fR all \fB\-\-rc\-lookahead\fR 60 \fB\-\-ref\fR 8 \fB\-\-subme\fR 9 \fB\-\-trellis\fR 2 .TP \- veryslow: \fB\-\-b\-adapt\fR 2 \fB\-\-bframes\fR 8 \fB\-\-direct\fR auto \fB\-\-me\fR umh \fB\-\-merange\fR 24 \fB\-\-partitions\fR all \fB\-\-ref\fR 16 \fB\-\-subme\fR 10 \fB\-\-trellis\fR 2 \fB\-\-rc\-lookahead\fR 60 .TP \- placebo: \fB\-\-bframes\fR 16 \fB\-\-b\-adapt\fR 2 \fB\-\-direct\fR auto \fB\-\-slow\-firstpass\fR \fB\-\-no\-fast\-pskip\fR \fB\-\-me\fR tesa \fB\-\-merange\fR 24 \fB\-\-partitions\fR all \fB\-\-rc\-lookahead\fR 60 \fB\-\-ref\fR 16 \fB\-\-subme\fR 11 \fB\-\-trellis\fR 2 .TP \fB\-\-tune\fR Tune the settings for a particular type of source or situation .TP Overridden by user settings. Multiple tunings are separated by commas. Only one psy tuning can be used at a time. \- film (psy tuning): .TP \fB\-\-deblock\fR \fB\-1\fR:\-1 \fB\-\-psy\-rd\fR :0.15 \- animation (psy tuning): .TP \fB\-\-bframes\fR {+2} \fB\-\-deblock\fR 1:1 \fB\-\-psy\-rd\fR 0.4: \fB\-\-aq\-strength\fR 0.6 \fB\-\-ref\fR {Double if >1 else 1} .TP \- grain (psy tuning): \fB\-\-aq\-strength\fR 0.5 \fB\-\-no\-dct\-decimate\fR \fB\-\-deadzone\-inter\fR 6 \fB\-\-deadzone\-intra\fR 6 \fB\-\-deblock\fR \fB\-2\fR:\-2 \fB\-\-ipratio\fR 1.1 \fB\-\-pbratio\fR 1.1 \fB\-\-psy\-rd\fR :0.25 \fB\-\-qcomp\fR 0.8 .TP \- stillimage (psy tuning): \fB\-\-aq\-strength\fR 1.2 \fB\-\-deblock\fR \fB\-3\fR:\-3 \fB\-\-psy\-rd\fR 2.0:0.7 .TP \- psnr (psy tuning): \fB\-\-aq\-mode\fR 0 \fB\-\-no\-psy\fR .TP \- ssim (psy tuning): \fB\-\-aq\-mode\fR 2 \fB\-\-no\-psy\fR .TP \- fastdecode: \fB\-\-no\-cabac\fR \fB\-\-no\-deblock\fR \fB\-\-no\-weightb\fR \fB\-\-weightp\fR 0 .TP \- zerolatency: \fB\-\-bframes\fR 0 \fB\-\-force\-cfr\fR \fB\-\-no\-mbtree\fR \fB\-\-sync\-lookahead\fR 0 \fB\-\-sliced\-threads\fR \fB\-\-rc\-lookahead\fR 0 .TP \fB\-\-slow\-firstpass\fR Don't force these faster settings with \fB\-\-pass\fR 1: \fB\-\-no\-8x8dct\fR \fB\-\-me\fR dia \fB\-\-partitions\fR none \fB\-\-ref\fR 1 \fB\-\-subme\fR {2 if >2 else unchanged} \fB\-\-trellis\fR 0 \fB\-\-fast\-pskip\fR .PP Frame\-type options: .HP \fB\-I\fR, \fB\-\-keyint\fR Maximum GOP size [250] .TP \fB\-i\fR, \fB\-\-min\-keyint\fR Minimum GOP size [auto] .TP \fB\-\-no\-scenecut\fR Disable adaptive I\-frame decision .TP \fB\-\-scenecut\fR How aggressively to insert extra I\-frames [40] .TP \fB\-\-intra\-refresh\fR Use Periodic Intra Refresh instead of IDR frames .TP \fB\-b\fR, \fB\-\-bframes\fR Number of B\-frames between I and P [3] .TP \fB\-\-b\-adapt\fR Adaptive B\-frame decision method [1] Higher values may lower threading efficiency. \- 0: Disabled \- 1: Fast \- 2: Optimal (slow with high \fB\-\-bframes\fR) .TP \fB\-\-b\-bias\fR Influences how often B\-frames are used [0] .TP \fB\-\-b\-pyramid\fR Keep some B\-frames as references [normal] \- none: Disabled \- strict: Strictly hierarchical pyramid \- normal: Non\-strict (not Blu\-ray compatible) .TP \fB\-\-open\-gop\fR Use recovery points to close GOPs Only available with b\-frames .TP \fB\-\-no\-cabac\fR Disable CABAC .TP \fB\-r\fR, \fB\-\-ref\fR Number of reference frames [3] .TP \fB\-\-no\-deblock\fR Disable loop filter .TP \fB\-f\fR, \fB\-\-deblock\fR Loop filter parameters [0:0] .TP \fB\-\-slices\fR Number of slices per frame; forces rectangular slices and is overridden by other slicing options .TP \fB\-\-slices\-max\fR Absolute maximum slices per frame; overrides slice\-max\-size/slice\-max\-mbs when necessary .HP \fB\-\-slice\-max\-size\fR Limit the size of each slice in bytes .HP \fB\-\-slice\-max\-mbs\fR Limit the size of each slice in macroblocks (max) .HP \fB\-\-slice\-min\-mbs\fR Limit the size of each slice in macroblocks (min) .TP \fB\-\-tff\fR Enable interlaced mode (top field first) .TP \fB\-\-bff\fR Enable interlaced mode (bottom field first) .TP \fB\-\-constrained\-intra\fR Enable constrained intra prediction. .TP \fB\-\-pulldown\fR Use soft pulldown to change frame rate \- none, 22, 32, 64, double, triple, euro (requires cfr input) .TP \fB\-\-fake\-interlaced\fR Flag stream as interlaced but encode progressive. Makes it possible to encode 25p and 30p Blu\-Ray streams. Ignored in interlaced mode. .TP \fB\-\-frame\-packing\fR For stereoscopic videos define frame arrangement \- 0: checkerboard \- pixels are alternatively from L and R \- 1: column alternation \- L and R are interlaced by column \- 2: row alternation \- L and R are interlaced by row \- 3: side by side \- L is on the left, R on the right \- 4: top bottom \- L is on top, R on bottom \- 5: frame alternation \- one view per frame \- 6: mono \- 2D frame without any frame packing \- 7: tile format \- L is on top\-left, R split across .PP Ratecontrol: .TP \fB\-q\fR, \fB\-\-qp\fR Force constant QP (0\-81, 0=lossless) .TP \fB\-B\fR, \fB\-\-bitrate\fR Set bitrate (kbit/s) .TP \fB\-\-crf\fR Quality\-based VBR (\fB\-12\-51\fR) [23.0] .HP \fB\-\-rc\-lookahead\fR Number of frames for frametype lookahead [40] .HP \fB\-\-vbv\-maxrate\fR Max local bitrate (kbit/s) [0] .HP \fB\-\-vbv\-bufsize\fR Set size of the VBV buffer (kbit) [0] .TP \fB\-\-vbv\-init\fR Initial VBV buffer occupancy [0.9] .TP \fB\-\-crf\-max\fR With CRF+VBV, limit RF to this value May cause VBV underflows! .TP \fB\-\-qpmin\fR Set min QP [0] .TP \fB\-\-qpmax\fR Set max QP [81] .TP \fB\-\-qpstep\fR Set max QP step [4] .TP \fB\-\-ratetol\fR Tolerance of ABR ratecontrol and VBV [1.0] .TP \fB\-\-ipratio\fR QP factor between I and P [1.40] .TP \fB\-\-pbratio\fR QP factor between P and B [1.30] .TP \fB\-\-chroma\-qp\-offset\fR QP difference between chroma and luma [0] .TP \fB\-\-aq\-mode\fR AQ method [1] \- 0: Disabled \- 1: Variance AQ (complexity mask) \- 2: Auto\-variance AQ \- 3: Auto\-variance AQ with bias to dark scenes .TP \fB\-\-aq\-strength\fR Reduces blocking and blurring in flat and textured areas. [1.0] .TP \fB\-p\fR, \fB\-\-pass\fR Enable multipass ratecontrol \- 1: First pass, creates stats file \- 2: Last pass, does not overwrite stats file \- 3: Nth pass, overwrites stats file .TP \fB\-\-stats\fR Filename for 2 pass stats ["x264_2pass.log"] .TP \fB\-\-no\-mbtree\fR Disable mb\-tree ratecontrol. .TP \fB\-\-qcomp\fR QP curve compression [0.60] .TP \fB\-\-cplxblur\fR Reduce fluctuations in QP (before curve compression) [20.0] .TP \fB\-\-qblur\fR Reduce fluctuations in QP (after curve compression) [0.5] .TP \fB\-\-zones\fR //... Tweak the bitrate of regions of the video Each zone is of the form .TP ,,