1 >x264 --fullhelp 2 x264 core:142 3 Syntax: x264 [options] -o outfile infile 4 5 Infile can be raw (in which case resolution is required), 6 or YUV4MPEG (*.y4m), 7 or Avisynth if compiled with support (yes). 8 or libav* formats if compiled with lavf support (no) or ffms support (no). 9 Outfile type is selected by filename: 10 .264 -> Raw bytestream 11 .mkv -> Matroska 12 .flv -> Flash Video 13 .mp4 -> MP4 if compiled with GPAC or L-SMASH support (no) 14 Output bit depth: 8 (configured at compile time) 15 16 Options: 17 18 -h, --help List basic options 19 --longhelp List more options 20 --fullhelp List all options 21 22 Example usage: 23 24 Constant quality mode: 25 x264 --crf 24 -o <output> <input> 26 27 Two-pass with a bitrate of 1000kbps: 28 x264 --pass 1 --bitrate 1000 -o <output> <input> 29 x264 --pass 2 --bitrate 1000 -o <output> <input> 30 31 Lossless: 32 x264 --qp 0 -o <output> <input> 33 34 Maximum PSNR at the cost of speed and visual quality: 35 x264 --preset placebo --tune psnr -o <output> <input> 36 37 Constant bitrate at 1000kbps with a 2 second-buffer: 38 x264 --vbv-bufsize 2000 --bitrate 1000 -o <output> <input> 39 40 Presets: 41 42 --profile <string> Force the limits of an H.264 profile 43 Overrides all settings. 44 - baseline: 45 --no-8x8dct --bframes 0 --no-cabac 46 --cqm flat --weightp 0 47 No interlaced. 48 No lossless. 49 - main: 50 --no-8x8dct --cqm flat 51 No lossless. 52 - high: 53 No lossless. 54 - high10: 55 No lossless. 56 Support for bit depth 8-10. 57 - high422: 58 No lossless. 59 Support for bit depth 8-10. 60 Support for 4:2:0/4:2:2 chroma subsampling. 61 - high444: 62 Support for bit depth 8-10. 63 Support for 4:2:0/4:2:2/4:4:4 chroma subsamp 64 ling. 65 --preset <string> Use a preset to select encoding settings [medium] 66 Overridden by user settings. 67 - ultrafast: 68 --no-8x8dct --aq-mode 0 --b-adapt 0 69 --bframes 0 --no-cabac --no-deblock 70 --no-mbtree --me dia --no-mixed-refs 71 --partitions none --rc-lookahead 0 --ref 1 72 --scenecut 0 --subme 0 --trellis 0 73 --no-weightb --weightp 0 74 - superfast: 75 --no-mbtree --me dia --no-mixed-refs 76 --partitions i8x8,i4x4 --rc-lookahead 0 77 --ref 1 --subme 1 --trellis 0 --weightp 1 78 - veryfast: 79 --no-mixed-refs --rc-lookahead 10 80 --ref 1 --subme 2 --trellis 0 --weightp 1 81 - faster: 82 --no-mixed-refs --rc-lookahead 20 83 --ref 2 --subme 4 --weightp 1 84 - fast: 85 --rc-lookahead 30 --ref 2 --subme 6 86 --weightp 1 87 - medium: 88 Default settings apply. 89 - slow: 90 --b-adapt 2 --direct auto --me umh 91 --rc-lookahead 50 --ref 5 --subme 8 92 - slower: 93 --b-adapt 2 --direct auto --me umh 94 --partitions all --rc-lookahead 60 95 --ref 8 --subme 9 --trellis 2 96 - veryslow: 97 --b-adapt 2 --bframes 8 --direct auto 98 --me umh --merange 24 --partitions all 99 --ref 16 --subme 10 --trellis 2 100 --rc-lookahead 60 101 - placebo: 102 --bframes 16 --b-adapt 2 --direct auto 103 --slow-firstpass --no-fast-pskip 104 --me tesa --merange 24 --partitions all 105 --rc-lookahead 60 --ref 16 --subme 11 106 --trellis 2 107 --tune <string> Tune the settings for a particular type of source 108 or situation 109 Overridden by user settings. 110 Multiple tunings are separated by commas. 111 Only one psy tuning can be used at a time. 112 - film (psy tuning): 113 --deblock -1:-1 --psy-rd <unset>:0.15 114 - animation (psy tuning): 115 --bframes {+2} --deblock 1:1 116 --psy-rd 0.4:<unset> --aq-strength 0.6 117 --ref {Double if >1 else 1} 118 - grain (psy tuning): 119 --aq-strength 0.5 --no-dct-decimate 120 --deadzone-inter 6 --deadzone-intra 6 121 --deblock -2:-2 --ipratio 1.1 122 --pbratio 1.1 --psy-rd <unset>:0.25 123 --qcomp 0.8 124 - stillimage (psy tuning): 125 --aq-strength 1.2 --deblock -3:-3 126 --psy-rd 2.0:0.7 127 - psnr (psy tuning): 128 --aq-mode 0 --no-psy 129 - ssim (psy tuning): 130 --aq-mode 2 --no-psy 131 - fastdecode: 132 --no-cabac --no-deblock --no-weightb 133 --weightp 0 134 - zerolatency: 135 --bframes 0 --force-cfr --no-mbtree 136 --sync-lookahead 0 --sliced-threads 137 --rc-lookahead 0 138 --slow-firstpass Don't force these faster settings with --pass 1: 139 --no-8x8dct --me dia --partitions none 140 --ref 1 --subme {2 if >2 else unchanged} 141 --trellis 0 --fast-pskip 142 143 Frame-type options: 144 145 -I, --keyint <integer or "infinite"> Maximum GOP size [250] 146 -i, --min-keyint <integer> Minimum GOP size [auto] 147 --no-scenecut Disable adaptive I-frame decision 148 --scenecut <integer> How aggressively to insert extra I-frames [40] 149 --intra-refresh Use Periodic Intra Refresh instead of IDR frames 150 -b, --bframes <integer> Number of B-frames between I and P [3] 151 --b-adapt <integer> Adaptive B-frame decision method [1] 152 Higher values may lower threading efficiency. 153 - 0: Disabled 154 - 1: Fast 155 - 2: Optimal (slow with high --bframes) 156 --b-bias <integer> Influences how often B-frames are used [0] 157 --b-pyramid <string> Keep some B-frames as references [normal] 158 - none: Disabled 159 - strict: Strictly hierarchical pyramid 160 - normal: Non-strict (not Blu-ray compatible) 161 --open-gop Use recovery points to close GOPs 162 Only available with b-frames 163 --no-cabac Disable CABAC 164 -r, --ref <integer> Number of reference frames [3] 165 --no-deblock Disable loop filter 166 -f, --deblock <alpha:beta> Loop filter parameters [0:0] 167 --slices <integer> Number of slices per frame; forces rectangular 168 slices and is overridden by other slicing options 169 --slices-max <integer> Absolute maximum slices per frame; overrides 170 slice-max-size/slice-max-mbs when necessary 171 --slice-max-size <integer> Limit the size of each slice in bytes 172 --slice-max-mbs <integer> Limit the size of each slice in macroblocks (max 173 ) 174 --slice-min-mbs <integer> Limit the size of each slice in macroblocks (min 175 ) 176 --tff Enable interlaced mode (top field first) 177 --bff Enable interlaced mode (bottom field first) 178 --constrained-intra Enable constrained intra prediction. 179 --pulldown <string> Use soft pulldown to change frame rate 180 - none, 22, 32, 64, double, triple, euro (requ 181 ires cfr input) 182 --fake-interlaced Flag stream as interlaced but encode progressive. 183 Makes it possible to encode 25p and 30p Blu-Ray 184 streams. Ignored in interlaced mode. 185 --frame-packing <integer> For stereoscopic videos define frame arrangement 186 187 - 0: checkerboard - pixels are alternatively f 188 rom L and R 189 - 1: column alternation - L and R are interlac 190 ed by column 191 - 2: row alternation - L and R are interlaced 192 by row 193 - 3: side by side - L is on the left, R on the 194 right 195 - 4: top bottom - L is on top, R on bottom 196 - 5: frame alternation - one view per frame 197 198 Ratecontrol: 199 200 -q, --qp <integer> Force constant QP (0-69, 0=lossless) 201 -B, --bitrate <integer> Set bitrate (kbit/s) 202 --crf <float> Quality-based VBR (0-51) [23.0] 203 --rc-lookahead <integer> Number of frames for frametype lookahead [40] 204 --vbv-maxrate <integer> Max local bitrate (kbit/s) [0] 205 --vbv-bufsize <integer> Set size of the VBV buffer (kbit) [0] 206 --vbv-init <float> Initial VBV buffer occupancy [0.9] 207 --crf-max <float> With CRF+VBV, limit RF to this value 208 May cause VBV underflows! 209 --qpmin <integer> Set min QP [0] 210 --qpmax <integer> Set max QP [69] 211 --qpstep <integer> Set max QP step [4] 212 --ratetol <float> Tolerance of ABR ratecontrol and VBV [1.0] 213 --ipratio <float> QP factor between I and P [1.40] 214 --pbratio <float> QP factor between P and B [1.30] 215 --chroma-qp-offset <integer> QP difference between chroma and luma [0] 216 --aq-mode <integer> AQ method [1] 217 - 0: Disabled 218 - 1: Variance AQ (complexity mask) 219 - 2: Auto-variance AQ (experimental) 220 --aq-strength <float> Reduces blocking and blurring in flat and 221 textured areas. [1.0] 222 223 -p, --pass <integer> Enable multipass ratecontrol 224 - 1: First pass, creates stats file 225 - 2: Last pass, does not overwrite stats file 226 - 3: Nth pass, overwrites stats file 227 --stats <string> Filename for 2 pass stats ["x264_2pass.log"] 228 --no-mbtree Disable mb-tree ratecontrol. 229 --qcomp <float> QP curve compression [0.60] 230 --cplxblur <float> Reduce fluctuations in QP (before curve compressio 231 n) [20.0] 232 --qblur <float> Reduce fluctuations in QP (after curve compression 233 ) [0.5] 234 --zones <zone0>/<zone1>/... Tweak the bitrate of regions of the video 235 Each zone is of the form 236 <start frame>,<end frame>,<option> 237 where <option> is either 238 q=<integer> (force QP) 239 or b=<float> (bitrate multiplier) 240 --qpfile <string> Force frametypes and QPs for some or all frames 241 Format of each line: framenumber frametype QP 242 QP is optional (none lets x264 choose). Frametypes 243 : I,i,K,P,B,b. 244 K=<I or i> depending on open-gop setting 245 QPs are restricted by qpmin/qpmax. 246 247 Analysis: 248 249 -A, --partitions <string> Partitions to consider ["p8x8,b8x8,i8x8,i4x4"] 250 - p8x8, p4x4, b8x8, i8x8, i4x4 251 - none, all 252 (p4x4 requires p8x8. i8x8 requires --8x8dct.) 253 --direct <string> Direct MV prediction mode ["spatial"] 254 - none, spatial, temporal, auto 255 --no-weightb Disable weighted prediction for B-frames 256 --weightp <integer> Weighted prediction for P-frames [2] 257 - 0: Disabled 258 - 1: Weighted refs 259 - 2: Weighted refs + Duplicates 260 --me <string> Integer pixel motion estimation method ["hex"] 261 - dia: diamond search, radius 1 (fast) 262 - hex: hexagonal search, radius 2 263 - umh: uneven multi-hexagon search 264 - esa: exhaustive search 265 - tesa: hadamard exhaustive search (slow) 266 --merange <integer> Maximum motion vector search range [16] 267 --mvrange <integer> Maximum motion vector length [-1 (auto)] 268 --mvrange-thread <int> Minimum buffer between threads [-1 (auto)] 269 -m, --subme <integer> Subpixel motion estimation and mode decision [7] 270 - 0: fullpel only (not recommended) 271 - 1: SAD mode decision, one qpel iteration 272 - 2: SATD mode decision 273 - 3-5: Progressively more qpel 274 - 6: RD mode decision for I/P-frames 275 - 7: RD mode decision for all frames 276 - 8: RD refinement for I/P-frames 277 - 9: RD refinement for all frames 278 - 10: QP-RD - requires trellis=2, aq-mode>0 279 - 11: Full RD: disable all early terminations 280 --psy-rd <float:float> Strength of psychovisual optimization ["1.0:0.0"] 281 #1: RD (requires subme>=6) 282 #2: Trellis (requires trellis, experimental) 283 --no-psy Disable all visual optimizations that worsen 284 both PSNR and SSIM. 285 --no-mixed-refs Don't decide references on a per partition basis 286 --no-chroma-me Ignore chroma in motion estimation 287 --no-8x8dct Disable adaptive spatial transform size 288 -t, --trellis <integer> Trellis RD quantization. [1] 289 - 0: disabled 290 - 1: enabled only on the final encode of a MB 291 - 2: enabled on all mode decisions 292 --no-fast-pskip Disables early SKIP detection on P-frames 293 --no-dct-decimate Disables coefficient thresholding on P-frames 294 --nr <integer> Noise reduction [0] 295 296 --deadzone-inter <int> Set the size of the inter luma quantization deadzo 297 ne [21] 298 --deadzone-intra <int> Set the size of the intra luma quantization deadzo 299 ne [11] 300 Deadzones should be in the range 0 - 32. 301 --cqm <string> Preset quant matrices ["flat"] 302 - jvt, flat 303 --cqmfile <string> Read custom quant matrices from a JM-compatible fi 304 le 305 Overrides any other --cqm* options. 306 --cqm4 <list> Set all 4x4 quant matrices 307 Takes a comma-separated list of 16 integers. 308 --cqm8 <list> Set all 8x8 quant matrices 309 Takes a comma-separated list of 64 integers. 310 --cqm4i, --cqm4p, --cqm8i, --cqm8p <list> 311 Set both luma and chroma quant matrices 312 --cqm4iy, --cqm4ic, --cqm4py, --cqm4pc <list> 313 Set individual quant matrices 314 315 Video Usability Info (Annex E): 316 The VUI settings are not used by the encoder but are merely suggestions to 317 the playback equipment. See doc/vui.txt for details. Use at your own risk. 318 319 --overscan <string> Specify crop overscan setting ["undef"] 320 - undef, show, crop 321 --videoformat <string> Specify video format ["undef"] 322 - component, pal, ntsc, secam, mac, undef 323 --range <string> Specify color range ["auto"] 324 - auto, tv, pc 325 --colorprim <string> Specify color primaries ["undef"] 326 - undef, bt709, bt470m, bt470bg, smpte170m, 327 smpte240m, film, bt2020 328 --transfer <string> Specify transfer characteristics ["undef"] 329 - undef, bt709, bt470m, bt470bg, smpte170m, 330 smpte240m, linear, log100, log316, 331 iec61966-2-4, bt1361e, iec61966-2-1, 332 bt2020-10, bt2020-12 333 --colormatrix <string> Specify color matrix setting ["???"] 334 - undef, bt709, fcc, bt470bg, smpte170m, 335 smpte240m, GBR, YCgCo, bt2020nc, bt2020c 336 --chromaloc <integer> Specify chroma sample location (0 to 5) [0] 337 --nal-hrd <string> Signal HRD information (requires vbv-bufsize) 338 - none, vbr, cbr (cbr not allowed in .mp4) 339 --filler Force hard-CBR and generate filler (implied by 340 --nal-hrd cbr) 341 --pic-struct Force pic_struct in Picture Timing SEI 342 --crop-rect <string> Add 'left,top,right,bottom' to the bitstream-level 343 344 cropping rectangle 345 346 Input/Output: 347 348 -o, --output <string> Specify output file 349 --muxer <string> Specify output container format ["auto"] 350 - auto, raw, mkv, flv 351 --demuxer <string> Specify input container format ["auto"] 352 - auto, raw, y4m, avs 353 --input-fmt <string> Specify input file format (requires lavf support) 354 --input-csp <string> Specify input colorspace format for raw input 355 - valid csps for `raw' demuxer: 356 i420, yv12, nv12, i422, yv16, nv16, i444, yv24, 357 bgr, bgra, rgb 358 --output-csp <string> Specify output colorspace ["i420"] 359 - i420, i422, i444, rgb 360 --input-depth <integer> Specify input bit depth for raw input 361 --input-range <string> Specify input color range ["auto"] 362 - auto, tv, pc 363 --input-res <intxint> Specify input resolution (width x height) 364 --index <string> Filename for input index file 365 --sar width:height Specify Sample Aspect Ratio 366 --fps <float|rational> Specify framerate 367 --seek <integer> First frame to encode 368 --frames <integer> Maximum number of frames to encode 369 --level <string> Specify level (as defined by Annex A) 370 --bluray-compat Enable compatibility hacks for Blu-ray support 371 --avcintra-class <integer> Use compatibility hacks for AVC-Intra class 372 - 50, 100, 200 373 --stitchable Don't optimize headers based on video content 374 Ensures ability to recombine a segmented encode 375 376 -v, --verbose Print stats for each frame 377 --no-progress Don't show the progress indicator while encoding 378 --quiet Quiet Mode 379 --log-level <string> Specify the maximum level of logging ["info"] 380 - none, error, warning, info, debug 381 --psnr Enable PSNR computation 382 --ssim Enable SSIM computation 383 --threads <integer> Force a specific number of threads 384 --lookahead-threads <integer> Force a specific number of lookahead threads 385 386 --sliced-threads Low-latency but lower-efficiency threading 387 --thread-input Run Avisynth in its own thread 388 --sync-lookahead <integer> Number of buffer frames for threaded lookahead 389 --non-deterministic Slightly improve quality of SMP, at the cost of re 390 peatability 391 --cpu-independent Ensure exact reproducibility across different cpus 392 , 393 as opposed to letting them select different al 394 gorithms 395 --asm <integer> Override CPU detection 396 --no-asm Disable all CPU optimizations 397 --opencl Enable use of OpenCL 398 --opencl-clbin <string> Specify path of compiled OpenCL kernel cache 399 --opencl-device <integer> Specify OpenCL device ordinal 400 --dump-yuv <string> Save reconstructed frames 401 --sps-id <integer> Set SPS and PPS id numbers [0] 402 --aud Use access unit delimiters 403 --force-cfr Force constant framerate timestamp generation 404 --tcfile-in <string> Force timestamp generation with timecode file 405 --tcfile-out <string> Output timecode v2 file from input timestamps 406 --timebase <int/int> Specify timebase numerator and denominator 407 <integer> Specify timebase numerator for input timecode file 408 409 or specify timebase denominator for other input 410 --dts-compress Eliminate initial delay with container DTS hack 411 412 Filtering: 413 414 --vf, --video-filter <filter0>/<filter1>/... Apply video filtering to the 415 input file 416 417 Filter options may be specified in <filter>:<option>=<value> format. 418 419 Available filters: 420 crop:left,top,right,bottom 421 removes pixels from the edges of the frame 422 select_every:step,offset1[,...] 423 apply a selection pattern to input frames 424 step: the number of frames in the pattern 425 offsets: the offset into the step to select a frame 426 see: http://avisynth.org/mediawiki/Select#SelectEvery