当前位置:   article > 正文

x264参数介绍

x264参数介绍

1,http://mewiki.project357.com/wiki/X264_Settings

     http://blog.sina.com.cn/s/blog_51396f890100ojhx.html(翻译版)

2,UltraEdit的小技巧:把DOS命令输出地内容写入到txt中

UltraEdit中,【高级】-【运行DOS命令】

【命令】-【浏览】选择D:\cudaEncode\data\x264.exe,之后再在后面添加上“ --fullhelp”(--前加个空格)

点击【确定】,即可输出,默认为【命令行输出】,右击它,另存为txt文本即可。

下面是x264的fullhelp,很详细

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

3,详细参数解释

  1. This page explains the purpose and use of all x264 parameters. Parameters are ordered the same as their appearance in x264 --fullhelp.
  2. See also x264 Stats Output, x264 Stats File and x264 Encoding Suggestions.
  3. x264 Settings
  4. Help
  5. x264 comes with some inbuilt documentation. To access this help, run x264 with --help, --longhelp or --fullhelp. Each successive option will give more detailed information.
  6. Input
  7. Specify the input video with a single positional argument. For example:
  8. x264.exe --output NUL C:\input.avs
  9. x264 --output /dev/null ~/input.y4m
  10. When your input is raw YUV you must also tell x264 the input resolution. You probably want to specify the framerate with --fps as well:
  11. x264.exe --output NUL --fps 25 --input-res 1280x720 D:\input.yuv
  12. x264 --output /dev/null --fps 30000/1001 --input-res 640x480 ~/input.yuv
  13. Presets
  14. A system designed to reduce the work needed to generate sane, efficient commandlines that do what you want. For information on what options these settings toggle, check the output of x264.exe --fullhelp.
  15. profile
  16. Default: not set
  17. Limit the profile of the output stream. If you specify a profile, it overrides all other settings, so if you use it, you will be guaranteed a compatible stream. If you set this option, you cannot use lossless encoding (--qp 0 or --crf 0).
  18. You should set this if you know your playback device only supports a certain profile. Most decoders support High profile, so there's no need to set this.
  19. Values available: baseline, main, high.
  20. preset
  21. Default: medium
  22. Change options to trade off compression efficiency against encoding speed. If you specify a preset, the changes it makes will be applied before all other parameters are applied.
  23. You should generally set this option to the slowest you can bear.
  24. Values available: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo.
  25. tune
  26. Default: Not Set
  27. Tune options to further optimize them for your input content. If you specify a tuning, the changes will be applied after --preset but before all other parameters.
  28. If your source content matches one of the available tunings you can use this, otherwise leave unset.
  29. Values available: film, animation, grain, stillimage, psnr, ssim, fastdecode, zerolatency.
  30. slow-firstpass
  31. Default: Not Set
  32. Using --pass 1 applies the following settings at the end of parsing the command line:
  33. --ref 1
  34. --no-8x8dct
  35. --partitions i4x4 (if originally enabled, else none)
  36. --me dia
  37. --subme MIN( 2, subme )
  38. --trellis 0
  39. You can set --slow-firstpass to disable the feature, set this option. Note that using --preset placebo enables slow-firstpass too.
  40. See --pass.
  41. Frame-type options
  42. keyint
  43. Default: 250
  44. Sets the maximum interval between IDR-frames (aka keyframes) in x264's output. You can specify "infinite" to never insert non-scenecut IDR-frames.
  45. IDR-frames are 'delimiters' in the stream - no frame can reference data from the other side of the IDR-frame. As well as this, IDR-frames are also I-frames, so they don't reference data from any other frame. This means they can be used as seek points in a video.
  46. Note that I-frames are generally significantly larger than P/B-frames (often 10x or more in low motion scenes), so they can play havoc with ratecontrol when combined with aggressively low VBV settings (eg, sub-second buffer sizes). In these cases, investigate --intra-refresh.
  47. The default setting is fine for most videos. When encoding for Blu-ray, broadcast, live streaming or certain other specialist scenarios you may require a significantly smaller GOP length (often ~1x fps).
  48. See also: --min-keyint, --scenecut, --intra-refresh
  49. min-keyint
  50. Default: auto (MIN(--keyint / 10,--fps))
  51. Sets the minimum length between IDR-frames.
  52. See --keyint for an explanation of IDR-frames. Very small keyint ranges can cause "incorrect" IDR-frame placement (for example, a strobing scene). This option limits the minimum length in frames after each IDR-frame before another can be placed.
  53. The maximum allowed value for min-keyint is --keyint/2+1
  54. Recommendation: Default, or 1x your framerate.
  55. See also: --keyint, --scenecut
  56. no-scenecut
  57. Default: Not Set
  58. Completely disables adaptive I-frame decision.
  59. See also: --scenecut
  60. scenecut
  61. Default: 40
  62. Sets the threshold for I/IDR frame placement (read: scene change detection).
  63. x264 calculates a metric for every frame to estimate how different it is from the previous frame. If the value is lower than scenecut, a 'scenecut' is detected. An I-frame is placed if it has been less than --min-keyint frames since the last IDR-frame, otherwise an IDR-frame is placed. Higher values of scenecut increase the number of scenecuts detected. For more information on how the scenecut comparison works, see this doom9 thread.
  64. Setting scenecut to 0 is equivalent to setting --no-scenecut.
  65. Recommendation: Default
  66. See also: --keyint, --min-keyint, --no-scenecut
  67. intra-refresh
  68. Default: Off
  69. Disables IDR-frames, instead x264 uses intra coding for each macroblock in the frame every --keyint frames. Blocks are refreshed in a horizontally scrolling column - the 'refresh wave'. This benefits low-latency streaming by making it possible to achieve more constant frame sizes than is possible with standard IDR-frames. It also increases the resilience of the video stream to packet loss. This option does reduce compression efficiency, hence only use it when needed.
  70. Fun facts:
  71. The first frame is still an IDR frame.
  72. Intra-blocks are placed only in P-frames - the refresh wave is wider in the first P-frame after one or more B-frames.
  73. The loss in compression efficiency comes primarily from the fact macroblocks on the 'new' (left) side of the refresh wave can't refer to data on the 'old' (right) side.
  74. bframes
  75. Default: 3
  76. Sets the maximum number of concurrent B-frames that x264 can use.
  77. Without B-frames, a typical x264 stream has frame types like so: IPPPPP...PI. With --bframes 2, up to two consecutive P-frames can be replaced with B-frames, like: IBPBBPBPPPB...PI.
  78. B-frames are similar to P-frames, except they can use motion prediction from future frames as well. This can lead to significantly better efficiency in terms of compression ratio. Their average quality is controlled by --pbratio.
  79. Fun facts:
  80. x264 also occasionally distinguishes between two different sorts of B-frames. A 'B' can refer to a B-frame that is used as a reference by other frames (see --b-pyramid, while 'b' can refer to a B-frame that is not. If you see a mix of 'B' and 'b', it's usually related to the above. When the difference is not important, just 'B' is generally used to refer to all B-frames.
  81. For more information about the choices x264 makes between P or B frames for each candidate frame, see this ffmpeg-devel mail. In this case, frame types will look like this (in display order) (assuming --bframes 3): IBBBPBBBPBPI.
  82. See also: --no-b-adapt, --b-bias, --b-pyramid, --ref, --pbratio, --partitions, --weightb
  83. b-adapt
  84. Default: 1
  85. Set the adaptive B-frame placement decision algorithm. This setting controls how x264 decides between placing a P- or B-frame.
  86. 0. Disabled. Pick B-frames always. This is the same as what the older no-b-adapt setting did.
  87. 1. 'Fast' algorithm, faster, speed slightly increases with higher --b-frames setting. When using this mode, you basically always want to use --bframes 16.
  88. 2. 'Optimal' algorithm, slower, speed significantly decreases with higher --b-frames setting.
  89. Note: For a multi-pass encode, this option is only needed for the first pass where frame types are decided.
  90. b-bias
  91. Default: 0
  92. Controls the likelihood of B-frames being used instead of P-frames. Values greater than 0 increase the weighting towards B-frames, while values less than 0 do the opposite. This number is an arbitrary metric. The range is from -100 to 100. A value of 100/-100 does not guarantee every/no P-frame will be converted (use --b-adapt 0 for that).
  93. Only use this if you think you make better ratecontrol decisions than x264.
  94. See also: --b-frames, --ipratio
  95. b-pyramid
  96. Default: normal
  97. Allow the use of B-frames as references for other frames. Without this setting, frames can only reference I- or P-frames. Although I/P-frames are more valued as references because of their higher quality, B-frames can also be useful. B-frames designated as references will get a quantizer halfway between P-frames and normal B-frames. You need to use at least two B-frames before B-pyramid will work.
  98. If you're encoding for Blu-ray, use 'none' or 'strict'.
  99. none: do not allow B-frames to be used as references.
  100. strict: allow one B-frame per minigop to be used as reference; enforces restrictions imposed by the Blu-ray standard.
  101. normal: allow numerous B-frames per minigop to be used as references.
  102. See also: --bframes, --refs, --no-mixed-refs
  103. open-gop
  104. Default: none
  105. Open-GOP is an encoding technique which increases efficiency. Some decoders don't fully support open-GOP streams, which is why it hasn't been enabled by default. You should test with all decoders your streams will be played on, or (if that's impossible) wait until support is generally available.
  106. There's an explanation of Open-GOP here.
  107. no-cabac
  108. Default: Not set
  109. Disables CABAC (Context Adaptive Binary Arithmetic Coder) stream compression and falls back to the less efficient CAVLC (Context Adaptive Variable Length Coder) system. Significantly reduces both the compression efficiency (10-20% typically) and the decoding requirements.
  110. ref
  111. Default: 3
  112. Controls the size of the DPB (Decoded Picture Buffer). The range is from 0-16. In short, this value is the number of previous frames each P-frame can use as references. (B-frames can use one or two fewer, depending on if they are used as references or not.) The minimum number of refs that can be referenced is 1.
  113. Also note that the H.264 spec limits DPB size for each level. If adhering to Level 4.1 specs, the maximum refs for 720p and 1080p video are 9 and 4 respectively. You can read more about levels and 4.1 in particular under --level.
  114. See also: --b-pyramid, --no-mixed-refs, --level
  115. no-deblock
  116. Default: Not Set
  117. Completely disables the loop filter. Not Recommended.
  118. See Also: --deblock
  119. deblock
  120. Default: 0:0
  121. Controls the loop filter (aka inloop deblocker), which is part of the H.264 standard. It is very efficient in terms of encoding time vs. quality gained.
  122. You can find a good description of how the loop filter parameters work in this doom9 thread (see the initial post and akupenguin's replies).
  123. See Also: --no-deblock
  124. slices
  125. Default: 0
  126. Sets the number of slices per frame, and forces rectangular slices. (Overridden by either --slice-max-size or --slice-max-mbs if they are set.)
  127. If you are encoding for Blu-ray, set this to four. Otherwise, don't use this unless you know you need to.
  128. See Also: --slice-max-size, --slice-max-mbs.
  129. slice-max-size
  130. Default: 0
  131. Sets the maximum slice size in bytes, including estimated NAL overhead. (Currently is not compatible with --interlaced.)
  132. See Also: --slices
  133. slice-max-mbs
  134. Default: 0
  135. Sets the maximum slice size in macroblocks. (Currently is not compatible with --interlaced.)
  136. See Also: --slices
  137. tff
  138. Enable interlaced encoding and specify the top field is first. x264's interlaced encoding uses MBAFF, and is inherently less efficient than progressive encoding. For that reason, you should only encode interlaced if you intend to display the video on an interlaced display (or can't deinterlace the video before sending it to x264). Implies --pic-struct.
  139. bff
  140. Enable interlaced encoding and specify the bottom field is first. See --tff for more info.
  141. no-interlaced
  142. Forces x264 to output in progressive mode.
  143. constrained-intra
  144. Default: Not Set
  145. Enable constrained intra prediction, which is required for the base layer of SVC encodes. Since EveryoneTM ignores SVC you can likewise ignore this switch.
  146. pulldown
  147. Default: none
  148. Signal soft telecine for your (progressive, constant framerate) input stream using one of a few preset modes. Soft telecine is explained in more detail on the HandBrake wiki. The available presets are: none, 22, 32, 64, double, triple and euro.
  149. Specifying any mode but none implies --pic-struct.
  150. fake-interlaced
  151. Default: Not Set
  152. Mark a stream as interlaced even when not encoding as interlaced. Allows encoding of 25p and 30p Blu-ray compliant videos.
  153. frame-packing
  154. Default: Not Set
  155. If you're encoding 3d video, this parameter sets a bitstream flag that tells your decoder how the 3d video was packed. The values and what they mean can be found in x264 --fullhelp.
  156. Ratecontrol
  157. qp
  158. Default: Not Set
  159. The first of three possible ratecontrol methods. Set x264 to encode the movie in Constant Quantizer mode. The number you give here specifies the P-frame quantizer. The quantizer used for I- and B-frames is derived from --ipratio and --pbratio. CQ mode targets a certain quantizer, which means final filesize is not known (although it can be reasonably accurately estimated with some methods). A setting of 0 will produce lossless output. qp produces larger files than --crf for the same visual quality. qp mode also disables adaptive quantization, since by definition 'constant quantizer' implies no adaptive quantization.
  160. This option is mutually exclusive with --bitrate and --crf. See this writeup for more information on the various ratecontrol systems.
  161. You should generally use --crf instead, although qp doesn't require lookahead to run and thus can be faster.
  162. See also: --bitrate, --crf, --ipratio, --pbratio
  163. bitrate
  164. Default: Not Set
  165. The second of three ratecontrol methods. Encode the video in target bitrate mode. Target bitrate mode means the final filesize is known, but the final quality is not. x264 will attempt to encode the video to target the given bitrate as the overall average. The parameter given is the bitrate in kilobits/sec. (8bits = 1byte and so on). Note that 1 kilobit is 1000, not 1024 bits.
  166. This setting is often used in conjunction with --pass for two-pass encoding.
  167. This option is mutually exclusive with --qp and --crf. See this writeup for more information on the various ratecontrol systems.
  168. See also: --qp, --crf, --ratetol, --pass, --stats
  169. crf
  170. Default: 23.0
  171. The final ratecontrol method: Constant Ratefactor. While qp targets a certain quantizer, and bitrate targets a certain filesize, crf targets a certain 'quality'. The idea is for crf n to give the same perceptual quality as qp n, just in a smaller space. The arbitrary unit of measure for crf values is the "ratefactor".
  172. CRF achieves this by reducing the quality of 'less important' frames. In this context, 'less important' means frames in complex or high-motion scenes, where quality is either more expensive (in terms of bits) or less visible, will have their quantizer increased. The bits saved in frames like these are redistributed to frames where they will be more effective.
  173. CRF will take less time than a 2pass bitrate encode, because the 'first pass' from a 2pass encode was skipped. On the other hand, it's impossible to predict the bitrate a CRF encode will come out to. It's up to you to decide which rate-control mode is better for your circumstances.
  174. This option is mutually exclusive with qp and bitrate. See this writeup for more information on the various ratecontrol systems.
  175. See also: --qp, --bitrate
  176. rc-lookahead
  177. Default: 40
  178. Sets the number of frames to use for mb-tree ratecontrol and vbv-lookahead. The maximum allowed value is 250.
  179. For the mb-tree portion of this, increasing the frame count generates better results but is also slower. The maximum buffer value used by mb-tree is the MIN( rc-lookahead, --keyint )
  180. For the vbv-lookahead portion of this, increasing the frame count generates better stability and accuracy when using vbv. The maximum value used by vbv-lookahead is:
  181. MIN(rc-lookahead, MAX(--keyint, MAX(--vbv-maxrate, --bitrate) / --vbv-bufsize * --fps))
  182. See Also: --no-mbtree, --vbv-bufsize, --vbv-maxrate
  183. vbv-maxrate
  184. Default: 0
  185. Sets the maximum rate the VBV buffer should be assumed to refill at.
  186. VBV reduces quality, so you should only use this if you're encoding for a playback scenario that requires it.
  187. See also: --vbv-bufsize, --vbv-init, VBV Encoding Suggestions
  188. vbv-bufsize
  189. Default: 0
  190. Sets the size of the VBV buffer in kilobits.
  191. VBV reduces quality, so you should only use this if you're encoding for a playback scenario that requires it.
  192. See also: --vbv-maxsize, --vbv-init, VBV Encoding Suggestions
  193. vbv-init
  194. Default: 0.9
  195. Sets how full the VBV Buffer must be before playback starts.
  196. If it is less than 1, the the initial fill is: vbv-init * vbv-bufsize. Otherwise it is interpreted as the initial fill in kbits.
  197. See also: --vbv-maxsize, --vbv-bufsize, VBV Encoding Suggestions
  198. crf-max
  199. Default: Not set
  200. A similar setting to --qpmax except instead of specifying a maximum quantizer you're specifying a maximum ratefactor. This option only works when you are using CRF and have VBV enabled. It prevents x264 from reducing the ratefactor (aka "quality") below the given value even when doing so would violate VBV constraints. This setting is mostly applicable to custom streaming servers. More information can be found in the initial commit message.
  201. See Also: --crf, --vbv-maxrate, --vbv-bufsize
  202. qpmin
  203. Default: 0
  204. Defines the minimum quantizer that x264 will ever use. The lower the quantizer, the closer the output is to the input. At some point, the output of x264 will look the same as the input, even though it is not exactly the same. Usually there is no reason to allow x264 to spend more bits than this on any particular macroblock.
  205. With adaptive quantization enabled (the default), raising qpmin is discouraged because this could reduce the quality of flat background areas of the frame.
  206. See also: --qpmax, --ipratio
  207. qpmax
  208. Default: 51
  209. The opposite of qpmin, above. Defines the maximum quantizer that x264 can use. The default of 51 is the highest quantizer available for use in the H.264 spec, and is extremely low quality. This default effectively disables qpmax. You may want to set this lower (values in the 30-40 range are generally as low as you'd go) if you want to cap the minimum quality x264 can output, but adjusting it is generally not recommended.
  210. See also: --qpmin, --pbratio, --crf-max
  211. qpstep
  212. Default: 4
  213. Sets the maximum change in quantizer between two frames.
  214. ratetol
  215. Default: 1.0
  216. This is a dual purpose parameter:
  217. In 1-pass bitrate encodes, this settings controls the percentage that x264 can miss the target average bitrate by. You can set this to 'inf' to disable this overflow detection completely. The lowest you can set this is to 0.01. The higher you set this to the better x264 can react to complex scenes near the end of the movie. The unit of measure for this purpose is percent (eg, 1.0 = 1% bitrate deviation allowed).
  218. Many movies (any action movie, for instance) are most complex at the climatic finale. As a 1pass encode doesn't know this, the number of bits required for the end is usually underestimated. A ratetol of inf can mitigate this by allowing the encode to function more like a --crf encode, but the filesize will blow out.
  219. When VBV is activated (ie, you're specified --vbv-* options), this setting also affects VBV aggressiveness. Setting this higher allows VBV to fluctuate more at the risk of possibly violating the VBV settings. For this purpose, the unit of measure is arbitrary.
  220. ipratio
  221. Default: 1.40
  222. Modifies the target average increase in quantizer for I-frames as compared to P-frames. Higher values increase the quality of I-frames generated.
  223. See also: --pbratio
  224. pbratio
  225. Default: 1.30
  226. Modifies the target average decrease in quantizer for B-frames as compared to P-frames. Higher values decrease the quality of B-frames generated. Not used with mbtree (enabled by default), which calculates the optimum value automatically.
  227. See also: --ipratio
  228. chroma-qp-offset
  229. Default: 0
  230. Add an offset to the quantizer of chroma planes when encoding. The offset can be negative.
  231. x264 automatically lowers this when using psy-rd and/or psy-trellis to compensate for it increasing the quality of luma, and subsequently decreasing the quality of chroma. The default values for these settings cause 2 to be subtracted from the chroma-qp-offset.
  232. Note: x264 only encodes the luma and chroma planes at the same quantizer up to quantizer 29. After this, chroma is progressively quantized by a lower amount than luma until you end with luma at q51 and chroma at q39. This behavior is required by the H.264 standard.
  233. aq-mode
  234. Adaptive Quantization Mode
  235. Default: 1
  236. Without AQ, x264 tends to underallocate bits to less-detailed sections. AQ is used to better distribute the available bits between all macroblocks in the video. This setting changes what scope AQ re-arranges bits in:
  237. 0: Do not use AQ at all.
  238. 1: Allow AQ to redistribute bits across the whole video and within frames.
  239. 2: Auto-variance AQ (experimental) which attempts to adapt strength per-frame.
  240. See also: --aq-strength
  241. aq-strength
  242. Adaptive Quantization Strength
  243. Default: 1.0
  244. Sets the strength of AQ bias towards low detail ('flat') macroblocks. Negative values are not allowed. Values more than +/-100% from 1.0 are probably a bad idea.
  245. See also: --aq-mode
  246. pass
  247. Default: Not Set
  248. This is an important setting for 2pass encoding. It controls what x264 will do with the --stats file. It has three settings:
  249. 1: Create a new stats file. Use this on the first pass.
  250. 2: Read the stats file. Use this on the final pass.
  251. 3: Read the stats file, and update it as well.
  252. The stats file contains information about every input frame, which can be input to x264 in order to improve the output. The idea is you run a first pass to generate the stats file, and the second pass will create an optimized encode of the video. The improvement is mostly gained from better ratecontrol.
  253. See also: --stats, --bitrate, --slow-firstpass X264_statsfile
  254. stats
  255. Default: 'x264_2pass.log'
  256. Set the location that x264 will read/write the --pass X264_statsfile to/from.
  257. See also: --pass
  258. no-mbtree
  259. Default: Not Set
  260. Disable macroblock tree ratecontrol. Using macroblock tree ratecontrol overall improves the compression by keeping track of temporal propagation across frames and weighting accordingly. Requires a new large statsfile in addition to the already existing for multipass encodes.
  261. Recommendation: Default
  262. See Also: --rc-lookahead
  263. qcomp
  264. Default: 0.60
  265. Quantizer curve compression factor. 0.0 => Constant Bitrate, 1.0 => Constant Quantizer.
  266. When used with mbtree, it affects the strength of mbtree. (Higher qcomp = weaker mbtree).
  267. Recommendation: Default
  268. See Also: --cplxblur, --qblur
  269. cplxblur
  270. Default: 20
  271. Apply a gaussian blur with the given radius to the quantizer curve. This means that the quantizer assigned to each frame is blurred temporally with its neighbours to limit quantizer fluctuations.
  272. See also: --qcomp, --qblur
  273. qblur
  274. Default: 0.5
  275. Apply a gaussian blur with the given radius to the quantizer curve, after curve compression. Not a very important setting.
  276. See also: --qcomp, --cplxblur
  277. zones
  278. Default: Not Set
  279. Tweak settings for specific sections of the video. You can modify most x264 options per-zone.
  280. A single zone takes the form of <start frame>,<end frame>,<options>
  281. Multiple zones are separated from each other with a '/'
  282. Options:
  283. These two options are special. You can only set one per zone, and if you set one, it must be the first option listed for the zone:
  284. b=<float> applies a bitrate multiplier on the zone. Useful for extra tweaking of high- and low-action scenes.
  285. q=<int> applies a constant quantizer on the zone. Useful for applying to a range of frames.
  286. The other available options are as follows:
  287. ref=<integer>
  288. b-bias=<integer>
  289. scenecut=<integer>
  290. no-deblock
  291. deblock=<integer>:<integer>
  292. deadzone-intra=<integer>
  293. deadzone-inter=<integer>
  294. direct=<string>
  295. merange=<integer>
  296. nr=<integer>
  297. subme=<integer>
  298. trellis=<integer>
  299. (no-)chroma-me
  300. (no-)dct-decimate
  301. (no-)fast-pskip
  302. (no-)mixed-refs
  303. psy-rd=<float>:<float>
  304. me=<string>
  305. no-8x8dct
  306. b-pyramid=<string>
  307. crf=<float>
  308. Limitations:
  309. The number of reference frames for a zone can never exceed what was specified with --ref
  310. Scenecut can not be turned on and off; only varied if originally active (>0)
  311. Merange can not exceed what was originally specified if --me esa/tesa
  312. Subme can't be changed if the original commandline specified it as 0.
  313. You can't set me to esa or tesa if --me was originally specified as dia, hex, or umh
  314. Example: 0,1000,b=2/1001,2000,q=20,me=3,b-bias=-1000
  315. Recommendation: Default
  316. qpfile
  317. Manual override to standard ratecontrol. Specify a file that gives the quantizer and frametype for specified frames. The format is 'framenum frametype quantizer'. For example:
  318. 0 I 18 < IDR (key) I-frame
  319. 1 P 18 < P-frame
  320. 2 B 18 < Referenced B-frame
  321. 3 i 18 < Non-IDR (non-key) I-frame
  322. 4 b 18 < Non-referenced B-frame
  323. 5 K 18 < Keyframe*
  324. You don't need to specify every frame
  325. Using -1 as the desired quantizer allows x264 to choose the optimal quantizer value, useful when only needing to set the frametype
  326. Having a large number of specified frame types and quantizers while still letting x264 choose intermittently decreases x264's performance
  327. 'Keyframe' is a generic keyframe/seekpoint type that equates to a IDR I-Frame if --open-gop is none, otherwise it equates to a Non-IDR I-Frame flagged with the Recovery Point SEI
  328. Analysis
  329. partitions
  330. Default: 'p8x8,b8x8,i8x8,i4x4'
  331. H.264 video is split up into 16x16 macroblocks during compression. These blocks can be further split up into smaller partitions, which is what this option controls.
  332. With this option, you enable individual partitions. Partitions are enabled per-frametype (i.e., I, P, B). The available partitions are p8x8, p4x4, b8x8, i8x8, and i4x4.
  333. I: i8x8, i4x4
  334. P: p8x8 (also enables p16x8/p8x16), p4x4 (also enables p8x4/p4x8)
  335. B: b8x8 (also enables b16x8/b8x16)
  336. You can also set 'none' or 'all'.
  337. p4x4 is generally not very useful and has an extremely high ratio of speed cost to resulting quality gain.
  338. See also: --no-8x8dct
  339. direct
  340. Default: 'spatial'
  341. Set prediction mode for 'direct' motion vectors. There are two modes available: spatial and temporal. You can also select none to disable direct MVs, and auto to allow x264 to swap between them as it sees fit. If you set auto, x264 outputs information on the usage at the end of the encode. 'auto' works best in a 2pass encode, but will work in single-pass encodes too. In first-pass auto mode, x264 keeps a running average of how well each method has so far performed, and picks the next prediction mode from that. Note that you should only enable auto on the second pass if it was enabled on the first pass; if it wasn't, the second pass will default to temporal. Direct none wastes bits and is strongly discouraged.
  342. Recommendation: 'auto'
  343. no-weightb
  344. Default: Not Set
  345. H.264 allows you to 'weight' references in B-frames, which allows you to change how much each reference affects the predicted picture. This disables that feature.
  346. Recommendation: Default
  347. weightp
  348. Default: 2
  349. Enables use of explicit weighted prediction to improve compression in P-frames. Also improves quality in fades. Higher modes are slower.
  350. NOTE: When encoding for Adobe Flash set this to 1 - its decoder generates artifacts otherwise. Flash 10.1 fixes this bug.
  351. Modes:
  352. 0. Disabled.
  353. 1. Simple: fade analysis, but no reference duplication.
  354. 2. Smart: fade analysis and reference duplication.
  355. me
  356. Default: 'hex'
  357. Set the full-pixel motion estimation method. There are five choices:
  358. dia (diamond) is the simplest search, consisting of starting at the best predictor, checking the motion vectors at one pixel upwards, left, down, and to the right, picking the best, and repeating the process until it no longer finds any better motion vector.
  359. hex (hexagon) consists of a similar strategy, except it uses a range-2 search of 6 surrounding points, thus the name. It is considerably more efficient than dia and hardly any slower, and therefore makes a good choice for general-use encoding.
  360. umh (uneven multi-hex) is considerably slower than hex, but searches a complex multi-hexagon pattern in order to avoid missing harder-to-find motion vectors. Unlike hex and dia, the merange parameter directly controls umh's search radius, allowing one to increase or decrease the size of the wide search.
  361. esa (exhaustive) is a highly optimized intelligent search of the entire motion search space within merange of the best predictor. It is mathematically equivalent to the bruteforce method of searching every single motion vector in that area, though faster. However, it is still considerably slower than UMH, with not too much benefit, so is not particularly useful for everyday encoding.
  362. tesa (transformed exhaustive) is an algorithm which attempts to approximate the effect of running a Hadamard transform comparison at each motion vector; like exhaustive, but a little bit better and a little bit slower.
  363. See also: --merange
  364. merange
  365. Default: 16
  366. merange controls the max range of the motion search in pixels. For hex and dia, the range is clamped to 4-16, with a default of 16. For umh and esa, it can be increased beyond the default 16 to allow for a wider-range motion search, which is useful on HD footage and for high-motion footage. Note that for umh, esa, and tesa, increasing merange will significantly slow down encoding.
  367. See also: --me
  368. mvrange
  369. Default: -1 (auto)
  370. Set the maximum (vertical) range of any one motion vector in pixels. The default value is level-dependent:
  371. Level 1/1b: 64
  372. Level 1.1-2.0: 128
  373. Level 2.1-3.0: 256
  374. Level 3.1+: 512
  375. Note: if you want to manually override the mvrange, subtract 0.25 from the above values when setting (eg --mvrange 127.75).
  376. Recommendation: Default
  377. mvrange-thread
  378. Default: -1 (auto)
  379. Set the minimum motion vector buffer between threads. Don't touch it.
  380. Recommendation: Default
  381. subme
  382. Default: 7
  383. Set the subpixel estimation complexity. Higher numbers are better. Levels 1-5 simply control the subpixel refinement strength. Level 6 enables RDO for mode decision, and level 8 enables RDO for motion vectors and intra prediction modes. RDO levels are significantly slower than the previous levels.
  384. Using a value less than 2 will enable a faster, and lower quality lookahead mode, as well as cause poorer --scenecut decisions to be made, and thus it is not recommended.
  385. Possible Values:
  386. 0. fullpel only
  387. 1. QPel SAD 1 iteration
  388. 2. QPel SATD 2 iterations
  389. 3. HPel on MB then QPel
  390. 4. Always QPel
  391. 5. Multi QPel + bi-directional motion estimation
  392. 6. RD on I/P frames
  393. 7. RD on all frames
  394. 8. RD refinement on I/P frames
  395. 9. RD refinement on all frames
  396. 10. QP-RD (requires --trellis=2, --aq-mode > 0)
  397. 11. Full RD [1][2]
  398. Recommendation: Default, or higher, unless speed is very important.
  399. subq
  400. Alias of --subme
  401. psy-rd
  402. Default: 1.0:0.0
  403. The first number is the strength of Psy-RDO to use (requires subme>=6 to activate). The second number is the strength of Psy-Trellis (requires trellis>=1 to activate). Note that Trellis is still considered 'experimental', and almost certainly is a Bad Thing for at least cartoons.
  404. See this thread on doom9 for an explanation of psy-rd.
  405. no-psy
  406. Default: Not Set
  407. Disables all visual optimizations that reduce PSNR or SSIM. This also disables some internal psy optimizations that aren't settable via x264's command line arguments.
  408. Recommendation: Default
  409. no-mixed-refs
  410. Default: Not Set
  411. Mixed refs will select refs on a per-8x8 partition, rather than per-macroblock basis. This improves quality when using multiple reference frames, albeit at some speed cost. Setting this option will disable it.
  412. Recommendation: Default
  413. See also: --ref
  414. no-chroma-me
  415. Default: Not Set
  416. Normally, motion estimation works off both the luma and chroma planes. This disables chroma motion estimation for a small speed boost.
  417. Recommendation: Default
  418. no-8x8dct
  419. Default: Not Set
  420. Adaptive 8x8 DCT enables the intelligent adaptive use of 8x8 transforms in I-frames. This disables the feature.
  421. Recommendation: Default
  422. trellis
  423. Default: 1
  424. Performs Trellis quantization to increase efficiency.
  425. 0. Disabled
  426. 1. Enabled only on the final encode of a macroblock
  427. 2. Enabled on all mode decisions
  428. On Macroblock provides a good compromise between speed and efficiency. On all decisions reduces speed further.
  429. See: Trellis Quantization
  430. Recommendation: Default
  431. Note: Requires --cabac
  432. no-fast-pskip
  433. Default: Not Set
  434. Disables early skip detection on P-frames. At low bitrates, provides a moderate quality increase for a large speed cost. At high bitrates, has negligible effect on both speed and quality.
  435. Recommendation: Default
  436. no-dct-decimate
  437. Default: Not Set
  438. DCT Decimation will drop DCT blocks it deems "unnecessary". This will improve coding efficiency, with a usually negligible loss in quality. Setting this option will disable it.
  439. Recommendation: Default
  440. nr
  441. Default: Not Set
  442. Performs fast noise reduction. Estimates film noise based on this value and attempts to remove it by dropping small details before quantization. This may not match the quality of a good external noise reduction filter, but it performs very fast.
  443. Recommendation: Default or (100 to 1000 for denoising)
  444. deadzone-inter/intra
  445. Default: Not Set
  446. Set the size of the inter/intra luma quantization deadzone. Deadzones should be in the range of 0 to 32. The deadzone value sets the level of fine detail that x264 will arbitrarily drop without attempting to preserve. Very fine detail is both hard to see and expensive to encode, dropping this detail without attempting to preserve it stops wasting bits on such a low-return section of the video. Deadzone is incompatible with Trellis.
  447. Recommendation: Default
  448. cqm
  449. Default: Flat (Not Set)
  450. Sets all custom quantization matrices to those of a built-in preset. The built-in presets are flat or JVT.
  451. Recommendation: Default
  452. See also: --cqmfile
  453. cqmfile
  454. Default: Not Set
  455. Sets custom quantization matrices from a specified JM-compatible file. Overrides any other --cqm* options.
  456. Recommendation: Default
  457. See also: --cqm
  458. cqm4* / cqm8*
  459. Default: Not Set
  460. --cqm4: Set all 4x4 quant matrices. Takes a comma-separated list of 16 integers.
  461. --cqm8: Set all 8x8 quant matrices. Takes a comma-separated list of 64 integers.
  462. --cqm4i, --cqm4p, --cqm8i, --cqm8p: Set both luma and chroma quant matrices
  463. --cqm4iy, --cqm4ic, --cqm4py, --cqm4pc: Set individual quant matrices. Same switches exist for cqm8.
  464. Recommendation: Default
  465. Video Usability Info
  466. These options set a flag in the output stream that can be read by the decoding application and possibly acted on. It's worth noting that most of these options in most scenarios are pointless, and are usually ignored by software decoders.
  467. overscan
  468. Default: undef
  469. How to handle overscan. Overscan is used here in the sense of a device only displaying part of an image.
  470. Possible Values:
  471. undef - Undefined.
  472. show - Indicate to show the entire image. Theoretically must be respected if set.
  473. crop - Indicate that the image is suitable for playback on devices with overscan. Not necessarily respected.
  474. Recommendation: Crop before encoding and use show if your device supports it, otherwise ignore.
  475. videoformat
  476. Default: undef
  477. Indicates what the video was before encoding/digitizing.
  478. Possible Values:
  479. component
  480. pal
  481. ntsc
  482. secam
  483. mac
  484. undef
  485. Recommendation: Whatever your source video was, or undefined.
  486. fullrange
  487. Default: off
  488. Indicates whether to use the full range of luma and chroma levels. If set to off, the limited ranges will be used.
  489. See this page for a simple description.
  490. Recommendation: If your source is digitized from analog video, then set this to off. Otherwise, set it to on.
  491. colorprim
  492. Default: undef
  493. Set what color primaries for converting to RGB.
  494. Possible Values:
  495. undef
  496. bt709
  497. bt470m
  498. bt470bg
  499. smpte170m
  500. smpte240m
  501. film
  502. See: RGB and YCrCb
  503. Recommendation: Default, unless you know what your source uses.
  504. transfer
  505. Default: undef
  506. Set the opto-electronic transfer characteristics to use. (Sets the gamma curve to use for correction.)
  507. Possible Values
  508. undef
  509. bt709
  510. bt470m
  511. bt470bg
  512. linear
  513. log100
  514. log316
  515. smpte170m
  516. smpte240m
  517. See: Gamma Correction
  518. Recommendation: Default, unless you know what your source uses.
  519. colormatrix
  520. Default: undef
  521. Set the matrix coefficients used in deriving the luma and chroma from the RGB primaries.
  522. Possible Values
  523. undef
  524. bt709
  525. fcc
  526. bt470bg
  527. smpte170m
  528. smpte240m
  529. GBR
  530. YCgCo
  531. See: YCbCr
  532. Recommendation: Whatever your sources uses, or default.
  533. chromaloc
  534. Default: 0
  535. Sets the chroma sample location. (as defined in Annex E of the ITU-T Specification).
  536. Values range from 0 to 5.
  537. See x264's vui.txt
  538. Recommendation:
  539. If you transcode from MPEG1 with proper subsampled 4:2:0, and don't do any color space conversion, you should set this option to 1.
  540. If you transcode from MPEG2 with proper subsampled 4:2:0, and don't do any color space conversion, you should set this option to 0.
  541. If you transcode from MPEG4 with proper subsampled 4:2:0, and don't do any color space conversion, you should set this option to 0.
  542. Otherwise, default.
  543. nal-hrd
  544. Default: None
  545. Signal HRD information. Required for Blu-ray streams, television broadcast and a few other specialist areas. Acceptable values are:
  546. none Specify no HRD information
  547. vbr Specify HRD information
  548. cbr Specify HRD information and pack the bitstream to the bitrate specified by bitrate. Requires bitrate mode ratecontrol.
  549. Recommendation: none, unless you need to signal this information.
  550. See also: --vbv-bufsize, --vbv-maxrate, --aud
  551. pic-struct
  552. Default: Not Set
  553. Force sending pic_struct in Picture Timing SEI.
  554. Implied when you use --pulldown or --tff/--bff.
  555. Recommendation: Default
  556. crop-rect
  557. Default: Not Set
  558. Specify a bitstream-level cropping rectangle. You can use this if you want the decoder to crop on playback, but don't want to crop the video x264 encodes for some reason. Specify the value in pixels that should be cropped on playback.
  559. Input/Output
  560. output
  561. Default: Not Set.
  562. Specifies output filename. The extension you specify determines the output format of your video. If the extension is not recognised the default output format is the raw video stream (generally stored with the .264 extension).
  563. The special location NUL (Windows) or /dev/null (Unix) specifies the output should be discarded. This is particularly useful when using pass 1, as the only output you care about is that from stats.
  564. muxer
  565. Default: auto
  566. Specifies what format to write to.
  567. Possible Values
  568. auto
  569. raw
  570. mkv
  571. flv
  572. mp4
  573. The 'auto' option will pick a muxer based on the supplied output filename.
  574. See also: --output
  575. Recommendation: Default
  576. demuxer
  577. Default: Automatically detected.
  578. Sets what demuxer and decoder x264 uses for parsing the input video.
  579. Possible Values
  580. auto
  581. raw
  582. y4m
  583. avs
  584. lavf
  585. ffms
  586. If the input file has an extension of raw, y4m or avs, x264 will use the relevant demuxer to read the file. Standard input uses the raw demuxer. Otherwise, x264 will attempt to open the file with ffms, then lavf, and then fail.
  587. The 'lavf' and 'ffms' options require x264 to be compiled with the respective libraries. If either is used, x264 will carry over the timecodes from the input file, provided you don't output to raw. This effectively makes x264 VFR-aware. The other options can have a constant framerate specified with --fps or a variable framerate with --tcfile-in.
  588. See also: --input, --muxer
  589. Recommendation: Default.
  590. input-csp
  591. Default: i420
  592. Tell x264 what colourspace your raw video input is with this switch. Supported colourspaces are listed in x264 --fullhelp.
  593. Note that while RGB colourspaces are listed, the video is converted to YUV using the bt601 (ie, "SD") matrix before encoding.
  594. See Also: --input-res, --fps
  595. output-csp
  596. Default: i420
  597. Tell x264 what colourspace you want out. Supported colourspaces are listed in x264 --fullhelp.
  598. Possible Values
  599. i420
  600. i444
  601. rgb
  602. See Also: --input-csp
  603. input-res
  604. Specify the input resolution of raw video input. Use the syntax --input-res 720x576.
  605. See Also: --input-csp, --fps
  606. index
  607. Default: Not Set
  608. An optional setting that only takes effect when using the ffms --demuxer. Specifies a file for ffms to write out indexing data for the input file to, which can be referred to in a future encode to remove the need to reindex the video. Generally not needed -- indexing is not a slow process relative to video encoding.
  609. See also: --demuxer, FFMS2 API Documentation
  610. Recommendation: Default, unless you want to save a minute amount of time indexing.
  611. sar
  612. Default: Not Set
  613. Specifies the input video's Sample Aspect Ratio (SAR) to be used by the encoder in width:height. This in conjunction with frame dimensions can be used to encode an anamorphic output by determining the Display Aspect Ratio (DAR) via the formula: DAR = SAR x width/height
  614. See Main Article here Recommendation: You might need to set this if you're using the resize filter and encoding with anamorphic input.
  615. fps
  616. Default: autodetected
  617. Specifies video framerate as either a float (29.970) a rational (30000/1001), or an integer (2997/100) value. x264 detects and uses the framerate from the input stream header when available (y4m, avs, ffms and lavf demuxer), otherwise uses 25. Setting this implies force-cfr.
  618. If you are using raw YUV input and --bitrate-based ratecontrol, you need to specify the correct framerate using this parameter or --tcfile-in. x264 won't hit your target bitrate otherwise.
  619. seek
  620. Default: Not Set
  621. Specifies the first frame to encode, allowing the encode to begin at any point in the source.
  622. Recommendation: Default
  623. frames
  624. Default: Not Set
  625. Specifies the maximum number of frames to encode, allowing the encode to finish at any point before the end of the source.
  626. Recommendation: Default
  627. level
  628. Default: -1 (auto)
  629. Sets the level flag in the output bitstream (as defined by Annex A of the H.264 standard). Permissible levels are:
  630. 1 1b 1.1 1.2 1.3 2 2.1 2.2 3 3.1 3.2 4 4.1 4.2 5 5.1
  631. If you do not specify --level on the commandline, x264 will attempt to autodetect the level. This detection is not perfect and may underestimate the level if you are not using VBV. x264 will also automatically limit the DPB size (see --ref) to remain in compliance with the level you select (unless you also manually specify --ref). Note: specifying the level does not automatically set the --vbv-maxrate or --vbv-bufsize, however it will warn if the level specific properties are exceeded.
  632. What Level Do I Pick?
  633. Level 4.1 is often considered the highest level you can rely on desktop consumer hardware to support. Blu-ray Discs only support level 4.1, and many non-mobile devices like the Xbox 360 specify level 4.1 as the highest they officially support. Mobile devices like the iPhone/Android are a totally different story.
  634. Wikipedia has a nice chart detailing the restrictions for each level, if you want to read it.
  635. Recommendation: Default, unless you are aiming for a specific device.
  636. verbose
  637. Default: Not Set
  638. Displays statistics for each encoded frame.
  639. Recommendation: Default
  640. no-progress
  641. Default: Not Set
  642. Disables the progress indicator while encoding.
  643. Recommendation: Default
  644. quiet
  645. Default: Not Set
  646. Enables Quiet Mode, silencing status messages from x264.
  647. Recommendation: Default
  648. log-level
  649. Default: info
  650. Manually specify the logging level of both x264cli and libx264.
  651. Possible Values
  652. none
  653. error
  654. warning
  655. info
  656. debug
  657. Recommendation: Default
  658. psnr
  659. Default: Not Set
  660. Enables PSNR calculations that are reported on completion at the cost of a small decrease in speed.
  661. Recommendation: Default
  662. ssim
  663. Default: Not Set
  664. Enables SSIM calculations that are reported on completion at the cost of a small decrease in speed.
  665. Recommendation: Default
  666. threads
  667. Default: auto (frame based threads: 1.5 * logical processors, rounded down; slice based threads: 1 * logical processors)
  668. Enables parallel encoding by using more than 1 thread to increase speed on multi-core systems. The quality loss from multiple threads is mostly negligible unless using very high numbers of threads (say, above 16). The speed gain should be slightly less than linear until you start using more than 1 thread per 40px of vertical video, at which point the gain from additional threads sharply decreases.
  669. x264 currently has an internal limit on the number of threads set at 128, realistically you should never set it this high.
  670. Recommendation: Default
  671. See also: thread-input, sliced-threads
  672. sliced-threads
  673. Default: off
  674. Enables slice-based threading. This threading method produces lower quality results than the default method both compression and efficiency-wise, but adds no encoding latency.
  675. The maximum number of sliced threads is MIN( (height+15)/16 / 4, 128 )
  676. Recommendation: Default (off), unless you are doing some sort of realtime streaming or low latency is important.
  677. thread-input
  678. Default: Set if threads > 1.
  679. Decodes the input video in a separate thread to the encoding process.
  680. Recommendation: Default.
  681. sync-lookahead
  682. Default: auto (bframes+1)
  683. Sets the number of frames to be used as a buffer for threaded lookahead. Maximum Value is 250. Automatically disabled during the 2nd or greater pass or when using sliced threads.
  684. Setting this to 0 disables threaded lookahead, which allows lower latency at the cost of reduced performance.
  685. Recommendation: Default
  686. non-deterministic
  687. Default: Not Set
  688. Slightly improve quality when encoding with --threads > 1, at the cost of non-deterministic output encodes. This enables multi-threaded mv and uses the entire lookahead buffer in slicetype decisions when slicetype is threaded -- rather than just the minimum amount known to be available.
  689. Not for general use.
  690. Recommendation: Default
  691. See also: threads
  692. asm
  693. Default: auto
  694. Override automatic CPU detection. Useful for debugging or troubleshooting.
  695. Recommendation: Default
  696. no-asm
  697. Default: Not Set
  698. Disables all CPU optimisations. Useful for debugging or troubleshooting.
  699. Recommendation: Default
  700. visualize
  701. Default: Not Set
  702. Enables Macroblock Type visualizations over the encoded video. Useful for frame by frame debugging or analysis.
  703. Requires compile time support, and an X11 windowing system.
  704. Recommendation: Default
  705. dump-yuv
  706. Default: Not Set
  707. Dumps the reconstructed YUV frames to the specified file. Useful mostly for debugging. Not for general use.
  708. Recommendation: Default
  709. sps-id
  710. Default: Not Set
  711. Set SPS (sequence parameter set) and PPS (picture parameter set) id numbers. Not for general use.
  712. Recommendation: Default
  713. aud
  714. Default: Not Set
  715. Use access unit delimiters.
  716. Recommendation: Default, unless encoding for Blu-ray, in which case set this option.
  717. force-cfr
  718. Default: Not Set
  719. If using ffms2 or lavf demuxers, timecodes are copied from the input file, provided the output file is not raw. This option disables this, and forces x264 to generate its own. When using this you probably also want to set --fps.
  720. Recommendation: Default
  721. tcfile-in
  722. Specify a timecodes file which should be used to interpret the framerate of the input video. The timecode file can be in either v1 or v2 format which are described in the mkvmerge documentation.
  723. See Also: tcfile-out, force-cfr, fps
  724. tcfile-out
  725. Output a timecode file (v2 format) based on the input timestamps. For use when you're encoding a VFR input video and want to dump the timecodes. For details on the file format, see tcfile-in.
  726. timebase
  727. Default: Not Set
  728. Allows you to set a custom timebase.
  729. The numerator is 'seconds', and the denominator is 'ticks'. Means how many seconds one tick takes.
  730. If passed a rational, it will set the numerator and denominator accordingly.
  731. If passed an integer, and an input timecodes file is set via tcfile-in, it will use the value passed as the numerator, and generate the denominator accordingly.
  732. If passed an integer, and no input timecodes file is set, it will use the value passed as the denominator and generate the 'ticks per frame' from the input video.
  733. Not compatible with --force-cfr mode.
  734. Recommendation: Default
  735. dts-compress
  736. Default: Not Set
  737. A hack, implemented for FLV and MP4 containers only, that can work around buggy decoders that expect all DTSs to be positive. As per the commit message for this change, use at your own risk.
  738. Note: DTS refers to Decode TimeStamp. Each frame is allocated a DTS that reflects its position in the 'coded order' of the stream, as opposed to the 'display order' of the stream, which is specified by the Presentation TimeStamp. The order frames are stored in the stream is different to the order they are displayed due to compression techniques such as B-frames, which result in frames requiring data from frames that will be displayed after.
  739. Filtering
  740. video-filter
  741. The x264 filtering system is used to process the input video before encoding. Multiple filters can also be applied sequentially to the input video.
  742. The basic syntax to apply a filter is this:
  743. --video-filter <filter>
  744. You can apply multiple filters sequentially by delimiting them with a /:
  745. --video-filter <filter1>/<filter2>
  746. You can 'chain' as many filter operations as you like together.
  747. The available filters are:
  748. crop
  749. Syntax: crop:left,top,right,bottom
  750. Remove pixels from the edges of the frame.
  751. You must crop in multiples of 2 when using yv12, i420, or nv12 format video input.
  752. You must crop width in multiples of 2 when using i422 format video input.
  753. resize
  754. Syntax: resize:[width,height][,sar][,fittobox][,csp][,method]
  755. Resizes frames and/or converts frames between different colorspaces. Requires x264 to be compiled with libswscale.
  756. There are a few possible modes on how to resize frames:
  757. Resolution only: Resizes frames to the specified resolution and changes the SAR to avoid stretching.
  758. SAR only: Sets the SAR and resizes frames to a new resolution to avoid stretching.
  759. Resolution + SAR: Resizes frames to the specified resolution and sets SAR to the specified value, potentially allowing stretching.
  760. Fittobox: Resizes frames based on the specified constraint mode, adapting the resolution to have a resultant SAR of 1:1
  761. width: Resize frames to fit within the specified width constraint
  762. height: Resize frames to fit within the specified height constraint
  763. both: Resize frames to fit within the specified box constraint
  764. Fittobox + SAR: Same as regular Fittobox mode except the resultant frames have the specified SAR, shrinking the video to where the anamorphic video fits within the specified constraint.
  765. Options that are independent of the resizing mode are
  766. csp: simultaneously converting frames to the specified colorspace. The valid list of colorspaces are displayed in x264 --fullhelp
  767. method (Default bicubic): when resizing frames, use the specified resizer method
  768. fastbilinear, bilinear, bicubic, experimental, point, area, bicublin, gauss, sinc, lanczos, spline
  769. Example:
  770. resize:width=1280,height=720,method=spline
  771. select_every
  772. Syntax: select_every:step,offset1[,offset2,...]
  773. "Select" only a subset of input frames to encode, dropping the rest. Every step frames, take only the frames specified with an offset. For example: To encode every second frame:
  774. select_every:2,1
  775. To drop every third frame:
  776. select_every:3,0,1
  777. You can see more examples at the Avisynth wiki (which has an identical filter).



声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号