Advertisement
pintcat

x264 CLI options (used in VDub)

Jul 10th, 2024
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.43 KB | Help | 0 0
  1. For CRF18:
  2.  
  3. --ref 5 --keyint 240 --bframes 4 --sync-lookahead 5 --rc-lookahead 64 --qpmax 51 --no-fast-pskip --no-dct-decimate --merange 32 --mvrange 512 --psy-rd 1.00:0.15 --vbv-maxrate 40000 --vbv-bufsize 30000 --sar 1:1 --deblock -2:0 --colormatrix bt709
  4.  
  5.  
  6. For CRF19:
  7.  
  8. --ref 4 --keyint 240 --bframes 4 --sync-lookahead 5 --rc-lookahead 64 --qpmax 51 --no-fast-pskip --no-dct-decimate --merange 32 --mvrange 512 --psy-rd 1.00:0.15 --vbv-maxrate 40000 --vbv-bufsize 30000 --sar 1:1 --deblock 0:0 --colormatrix bt709
  9.  
  10.  
  11.  
  12.  
  13. Presets:
  14.  
  15. --profile <string> Force the limits of an H.264 profile
  16. Overrides all settings.
  17. - baseline:
  18. --no-8x8dct --bframes 0 --no-cabac
  19. --cqm flat --weightp 0
  20. No interlaced.
  21. No lossless.
  22. - main:
  23. --no-8x8dct --cqm flat
  24. No lossless.
  25. - high:
  26. No lossless.
  27. - high10:
  28. No lossless.
  29. Support for bit depth 8-10.
  30. - high422:
  31. No lossless.
  32. Support for bit depth 8-10.
  33. Support for 4:2:0/4:2:2 chroma subsampling.
  34. - high444:
  35. Support for bit depth 8-10.
  36. Support for 4:2:0/4:2:2/4:4:4 chroma subsampling.
  37. --preset <string> Use a preset to select encoding settings [medium]
  38. Overridden by user settings.
  39. - ultrafast:
  40. --no-8x8dct --aq-mode 0 --b-adapt 0
  41. --bframes 0 --no-cabac --no-deblock
  42. --no-mbtree --me dia --no-mixed-refs
  43. --partitions none --rc-lookahead 0 --ref 1
  44. --scenecut 0 --subme 0 --trellis 0
  45. --no-weightb --weightp 0
  46. - superfast:
  47. --no-mbtree --me dia --no-mixed-refs
  48. --partitions i8x8,i4x4 --rc-lookahead 0
  49. --ref 1 --subme 1 --trellis 0 --weightp 1
  50. - veryfast:
  51. --no-mixed-refs --rc-lookahead 10
  52. --ref 1 --subme 2 --trellis 0 --weightp 1
  53. - faster:
  54. --no-mixed-refs --rc-lookahead 20
  55. --ref 2 --subme 4 --weightp 1
  56. - fast:
  57. --rc-lookahead 30 --ref 2 --subme 6
  58. --weightp 1
  59. - medium:
  60. Default settings apply.
  61. - slow:
  62. --direct auto --rc-lookahead 50 --ref 5
  63. --subme 8 --trellis 2
  64. - slower:
  65. --b-adapt 2 --direct auto --me umh
  66. --partitions all --rc-lookahead 60
  67. --ref 8 --subme 9 --trellis 2
  68. - veryslow:
  69. --b-adapt 2 --bframes 8 --direct auto
  70. --me umh --merange 24 --partitions all
  71. --ref 16 --subme 10 --trellis 2
  72. --rc-lookahead 60
  73. - placebo:
  74. --bframes 16 --b-adapt 2 --direct auto
  75. --no-fast-pskip --me tesa --merange 24
  76. --partitions all --rc-lookahead 60
  77. --ref 16 --subme 11 --trellis 2
  78. --tune <string> Tune the settings for a particular type of source
  79. or situation
  80. Overridden by user settings.
  81. Multiple tunings are separated by commas.
  82. Only one psy tuning can be used at a time.
  83. - film (psy tuning):
  84. --deblock -1:-1 --psy-rd <unset>:0.15
  85. - animation (psy tuning):
  86. --bframes {+2} --deblock 1:1
  87. --psy-rd 0.4:<unset> --aq-strength 0.6
  88. --ref {Double if >1 else 1}
  89. - grain (psy tuning):
  90. --aq-strength 0.5 --no-dct-decimate
  91. --deadzone-inter 6 --deadzone-intra 6
  92. --deblock -2:-2 --ipratio 1.1
  93. --pbratio 1.1 --psy-rd <unset>:0.25
  94. --qcomp 0.8
  95. - stillimage (psy tuning):
  96. --aq-strength 1.2 --deblock -3:-3
  97. --psy-rd 2.0:0.7
  98. - psnr (psy tuning):
  99. --aq-mode 0 --no-psy
  100. - ssim (psy tuning):
  101. --aq-mode 2 --no-psy
  102. - fastdecode:
  103. --no-cabac --no-deblock --no-weightb
  104. --weightp 0
  105. - zerolatency:
  106. --bframes 0 --force-cfr --no-mbtree
  107. --sync-lookahead 0 --sliced-threads
  108. --rc-lookahead 0
  109. --fast-firstpass Force these faster settings with --pass 1:
  110. --no-8x8dct --me dia --partitions none
  111. --ref 1 --subme {2 if >2 else unchanged}
  112. --trellis 0 --fast-pskip
  113. --slow-firstpass Don't force faster settings with --pass 1
  114.  
  115. Frame-type options:
  116.  
  117. -I, --keyint <integer or "infinite"> Maximum GOP size [250]
  118. -i, --min-keyint <integer> Minimum GOP size [auto]
  119. --no-scenecut Disable adaptive I-frame decision
  120. --scenecut <integer> How aggressively to insert extra I-frames [40]
  121. --intra-refresh Use Periodic Intra Refresh instead of IDR frames
  122. -b, --bframes <integer> Number of B-frames between I and P [3]
  123. --b-adapt <integer> Adaptive B-frame decision method [1]
  124. Higher values may lower threading efficiency.
  125. - 0: Disabled
  126. - 1: Fast
  127. - 2: Optimal (slow with high --bframes)
  128. --b-bias <integer> Influences how often B-frames are used [0]
  129. --b-pyramid <string> Keep some B-frames as references [normal]
  130. - none: Disabled
  131. - strict: Strictly hierarchical pyramid
  132. - normal: Non-strict (not Blu-ray compatible)
  133. --open-gop Use recovery points to close GOPs
  134. Only available with b-frames
  135. --no-cabac Disable CABAC
  136. -r, --ref <integer> Number of reference frames [3]
  137. --no-deblock Disable loop filter
  138. -f, --deblock <alpha:beta> Loop filter parameters [0:0]
  139. --slices <integer> Number of slices per frame; forces rectangular
  140. slices and is overridden by other slicing options
  141. --slices-max <integer> Absolute maximum slices per frame; overrides
  142. slice-max-size/slice-max-mbs when necessary
  143. --slice-max-size <integer> Limit the size of each slice in bytes
  144. --slice-max-mbs <integer> Limit the size of each slice in macroblocks (max)
  145. --slice-min-mbs <integer> Limit the size of each slice in macroblocks (min)
  146. --tff Enable interlaced mode (top field first)
  147. --bff Enable interlaced mode (bottom field first)
  148. --constrained-intra Enable constrained intra prediction.
  149. --fake-interlaced Flag stream as interlaced but encode progressive.
  150. Makes it possible to encode 25p and 30p Blu-Ray
  151. streams. Ignored in interlaced mode.
  152. --frame-packing <integer> For stereoscopic videos define frame arrangement
  153. - 0: checkerboard - pixels are alternatively from L and R
  154. - 1: column alternation - L and R are interlaced by column
  155. - 2: row alternation - L and R are interlaced by row
  156. - 3: side by side - L is on the left, R on the right
  157. - 4: top bottom - L is on top, R on bottom
  158. - 5: frame alternation - one view per frame
  159. - 6: mono - 2D frame without any frame packing
  160. - 7: tile format - L is on top-left, R split across
  161.  
  162. Ratecontrol:
  163.  
  164. -q, --qp <integer> Force constant QP (0-51, 0=lossless)
  165. -B, --bitrate <integer> Set bitrate (kbit/s)
  166. --crf <float> Quality-based VBR (0-51) [23.0]
  167. --rc-lookahead <integer> Number of frames for frametype lookahead [40]
  168. --vbv-maxrate <integer> Max local bitrate (kbit/s) [0]
  169. --vbv-bufsize <integer> Set size of the VBV buffer (kbit) [0]
  170. --vbv-init <float> Initial VBV buffer occupancy [0.9]
  171. --crf-max <float> With CRF+VBV, limit RF to this value
  172. May cause VBV underflows!
  173. --qpmin <integer> Set min QP [0]
  174. --qpmax <integer> Set max QP [2147483647]
  175. --qpstep <integer> Set max QP step [4]
  176. --ratetol <float> Tolerance of ABR ratecontrol and VBV [1.0]
  177. --ipratio <float> QP factor between I and P [1.40]
  178. --pbratio <float> QP factor between P and B [1.30]
  179. --chroma-qp-offset <integer> QP difference between chroma and luma [0]
  180. --aq-mode <integer> AQ method [1]
  181. - 0: Disabled
  182. - 1: Variance AQ (complexity mask)
  183. - 2: Auto-variance AQ
  184. - 3: Auto-variance AQ with bias to dark scenes
  185. --aq-strength <float> Reduces blocking and blurring in flat and
  186. textured areas. [1.0]
  187.  
  188. -p, --pass <integer> Enable multipass ratecontrol
  189. - 1: First pass, creates stats file
  190. - 2: Last pass, does not overwrite stats file
  191. - 3: Nth pass, overwrites stats file
  192. --stats <string> Filename for 2 pass stats ["x264_2pass.log"]
  193. --no-mbtree Disable mb-tree ratecontrol.
  194. --qcomp <float> QP curve compression [0.60]
  195. --cplxblur <float> Reduce fluctuations in QP (before curve compression) [20.0]
  196. --qblur <float> Reduce fluctuations in QP (after curve compression) [0.5]
  197. --zones <zone0>/<zone1>/... Tweak the bitrate of regions of the video
  198. Each zone is of the form
  199. <start frame>,<end frame>,<option>
  200. where <option> is either
  201. q=<integer> (force QP)
  202. or b=<float> (bitrate multiplier)
  203.  
  204. Analysis:
  205.  
  206. -A, --partitions <string> Partitions to consider ["p8x8,b8x8,i8x8,i4x4"]
  207. - p8x8, p4x4, b8x8, i8x8, i4x4
  208. - none, all
  209. (p4x4 requires p8x8. i8x8 requires --8x8dct.)
  210. --direct <string> Direct MV prediction mode ["spatial"]
  211. - none, spatial, temporal, auto
  212. --no-weightb Disable weighted prediction for B-frames
  213. --weightp <integer> Weighted prediction for P-frames [2]
  214. - 0: Disabled
  215. - 1: Weighted refs
  216. - 2: Weighted refs + Duplicates
  217. --me <string> Integer pixel motion estimation method ["hex"]
  218. - dia: diamond search, radius 1 (fast)
  219. - hex: hexagonal search, radius 2
  220. - umh: uneven multi-hexagon search
  221. - esa: exhaustive search
  222. - tesa: hadamard exhaustive search (slow)
  223. --merange <integer> Maximum motion vector search range [16]
  224. --mvrange <integer> Maximum motion vector length [-1 (auto)]
  225. --mvrange-thread <int> Minimum buffer between threads [-1 (auto)]
  226. -m, --subme <integer> Subpixel motion estimation and mode decision [7]
  227. - 0: fullpel only (not recommended)
  228. - 1: SAD mode decision, one qpel iteration
  229. - 2: SATD mode decision
  230. - 3-5: Progressively more qpel
  231. - 6: RD mode decision for I/P-frames
  232. - 7: RD mode decision for all frames
  233. - 8: RD refinement for I/P-frames
  234. - 9: RD refinement for all frames
  235. - 10: QP-RD - requires trellis=2, aq-mode>0
  236. - 11: Full RD: disable all early terminations
  237. --psy-rd <float:float> Strength of psychovisual optimization ["1.0:0.0"]
  238. #1: RD (requires subme>=6)
  239. #2: Trellis (requires trellis, experimental)
  240. --no-psy Disable all visual optimizations that worsen
  241. both PSNR and SSIM.
  242. --no-mixed-refs Don't decide references on a per partition basis
  243. --no-chroma-me Ignore chroma in motion estimation
  244. --no-8x8dct Disable adaptive spatial transform size
  245. -t, --trellis <integer> Trellis RD quantization. [1]
  246. - 0: disabled
  247. - 1: enabled only on the final encode of a MB
  248. - 2: enabled on all mode decisions
  249. --no-fast-pskip Disables early SKIP detection on P-frames
  250. --no-dct-decimate Disables coefficient thresholding on P-frames
  251. --nr <integer> Noise reduction [0]
  252.  
  253. --deadzone-inter <int> Set the size of the inter luma quantization deadzone [21]
  254. --deadzone-intra <int> Set the size of the intra luma quantization deadzone [11]
  255. Deadzones should be in the range 0 - 32.
  256. --cqm <string> Preset quant matrices ["flat"]
  257. - jvt, flat
  258. --cqmfile <string> Read custom quant matrices from a JM-compatible file
  259. Overrides any other --cqm* options.
  260. --cqm4 <list> Set all 4x4 quant matrices
  261. Takes a comma-separated list of 16 integers.
  262. --cqm8 <list> Set all 8x8 quant matrices
  263. Takes a comma-separated list of 64 integers.
  264. --cqm4i, --cqm4p, --cqm8i, --cqm8p <list>
  265. Set both luma and chroma quant matrices
  266. --cqm4iy, --cqm4ic, --cqm4py, --cqm4pc <list>
  267. Set individual quant matrices
  268.  
  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.  
  273. --overscan <string> Specify crop overscan setting ["undef"]
  274. - undef, show, crop
  275. --videoformat <string> Specify video format ["undef"]
  276. - component, pal, ntsc, secam, mac, undef
  277. --range <string> Specify color range ["auto"]
  278. - auto, tv, pc
  279. --colorprim <string> Specify color primaries ["undef"]
  280. - undef, bt709, bt470m, bt470bg, smpte170m,
  281. smpte240m, film, bt2020, smpte428,
  282. smpte431, smpte432
  283. --transfer <string> Specify transfer characteristics ["undef"]
  284. - undef, bt709, bt470m, bt470bg, smpte170m,
  285. smpte240m, linear, log100, log316,
  286. iec61966-2-4, bt1361e, iec61966-2-1,
  287. bt2020-10, bt2020-12, smpte2084, smpte428
  288. --colormatrix <string> Specify color matrix setting ["undef"]
  289. - undef, bt709, fcc, bt470bg, smpte170m,
  290. smpte240m, GBR, YCgCo, bt2020nc, bt2020c,
  291. smpte2085
  292. --chromaloc <integer> Specify chroma sample location (0 to 5) [0]
  293. --nal-hrd <string> Signal HRD information (requires vbv-bufsize)
  294. - none, vbr, cbr (cbr not allowed in .mp4)
  295. --filler Force hard-CBR and generate filler (implied by
  296. --nal-hrd cbr)
  297. --pic-struct Force pic_struct in Picture Timing SEI
  298. --crop-rect <string> Add 'left,top,right,bottom' to the bitstream-level
  299. cropping rectangle
  300.  
  301. Input/Output:
  302.  
  303. -o, --output <string> Specify output file
  304. --muxer <string> Specify output container format ["auto"]
  305. - auto, raw, mkv, flv, mp4, avi
  306. --sar width:height Specify Sample Aspect Ratio
  307. --fps <float|rational> Specify framerate
  308. --level <string> Specify level (as defined by Annex A)
  309. --bluray-compat Enable compatibility hacks for Blu-ray support
  310. --avcintra-class <integer> Use compatibility hacks for AVC-Intra class
  311. - 50, 100, 200
  312. --stitchable Don't optimize headers based on video content
  313. Ensures ability to recombine a segmented encode
  314.  
  315. -v, --verbose Print stats for each frame
  316. --quiet Quiet Mode
  317. --log-level <string> Specify the maximum level of logging ["info"]
  318. - none, error, warning, info, debug
  319. --psnr Enable PSNR computation
  320. --ssim Enable SSIM computation
  321. --threads <integer> Force a specific number of threads
  322. --lookahead-threads <integer> Force a specific number of lookahead threads
  323. --sliced-threads Low-latency but lower-efficiency threading
  324. --sync-lookahead <integer> Number of buffer frames for threaded lookahead
  325. --non-deterministic Slightly improve quality of SMP, at the cost of repeatability
  326. --cpu-independent Ensure exact reproducibility across different cpus,
  327. as opposed to letting them select different algorithms
  328. --asm <integer> Override CPU detection
  329. --no-asm Disable all CPU optimizations
  330. --dump-yuv <string> Save reconstructed frames
  331. --sps-id <integer> Set SPS and PPS id numbers [0]
  332. --aud Use access unit delimiters
  333. --force-cfr Force constant framerate timestamp generation
  334. --dts-compress Eliminate initial delay with container DTS hack
  335.  
  336.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement