Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.75 KB | None | 0 0
  1. Syntax: x264 [options] -o outfile infile [widthxheight]
  2.  
  3. Infile can be raw YUV 4:2:0 (in which case resolution is required),
  4. or YUV4MPEG 4:2:0 (*.y4m),
  5. or Avisynth if compiled with support (no).
  6. or libav* formats if compiled with lavf support (no) or ffms support (no).
  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 (no)
  12.  
  13. Options:
  14.  
  15. -h, --help List basic options
  16. --longhelp List more options
  17. --fullhelp List all options
  18.  
  19. Example usage:
  20.  
  21. Constant quality mode:
  22. x264 --crf 24 -o <output> <input>
  23.  
  24. Two-pass with a bitrate of 1000kbps:
  25. x264 --pass 1 --bitrate 1000 -o <output> <input>
  26. x264 --pass 2 --bitrate 1000 -o <output> <input>
  27.  
  28. Lossless:
  29. x264 --crf 0 -o <output> <input>
  30.  
  31. Maximum PSNR at the cost of speed and visual quality:
  32. x264 --preset placebo --tune psnr -o <output> <input>
  33.  
  34. Constant bitrate at 1000kbps with a 2 second-buffer:
  35. x264 --vbv-bufsize 2000 --bitrate 1000 -o <output> <input>
  36.  
  37. Presets:
  38.  
  39. --profile Force the limits of an H.264 profile [high]
  40. Overrides all settings.
  41. - baseline:
  42. --no-8x8dct --bframes 0 --no-cabac
  43. --cqm flat --weightp 0
  44. No interlaced.
  45. No lossless.
  46. - main:
  47. --no-8x8dct --cqm flat
  48. No lossless.
  49. - high:
  50. No lossless.
  51. --preset Use a preset to select encoding settings [medium]
  52. Overridden by user settings.
  53. - ultrafast:
  54. --no-8x8dct --aq-mode 0 --b-adapt 0
  55. --bframes 0 --no-cabac --no-deblock
  56. --no-mbtree --me dia --no-mixed-refs
  57. --partitions none --ref 1 --scenecut 0
  58. --subme 0 --trellis 0 --no-weightb
  59. --weightp 0
  60. - superfast:
  61. --no-mbtree --me dia --no-mixed-refs
  62. --partitions i8x8,i4x4 --ref 1
  63. --subme 1 --trellis 0 --weightp 0
  64. - veryfast:
  65. --no-mbtree --no-mixed-refs --ref 1
  66. --subme 2 --trellis 0 --weightp 0
  67. - faster:
  68. --no-mixed-refs --rc-lookahead 20
  69. --ref 2 --subme 4 --weightp 1
  70. - fast:
  71. --rc-lookahead 30 --ref 2 --subme 6
  72. - medium:
  73. Default settings apply.
  74. - slow:
  75. --b-adapt 2 --direct auto --me umh
  76. --rc-lookahead 50 --ref 5 --subme 8
  77. - slower:
  78. --b-adapt 2 --direct auto --me umh
  79. --partitions all --rc-lookahead 60
  80. --ref 8 --subme 9 --trellis 2
  81. - veryslow:
  82. --b-adapt 2 --bframes 8 --direct auto
  83. --me umh --merange 24 --partitions all
  84. --ref 16 --subme 10 --trellis 2
  85. --rc-lookahead 60
  86. - placebo:
  87. --bframes 16 --b-adapt 2 --direct auto
  88. --slow-firstpass --no-fast-pskip
  89. --me tesa --merange 24 --partitions all
  90. --rc-lookahead 60 --ref 16 --subme 10
  91. --trellis 2
  92. --tune Tune the settings for a particular type of source
  93. or situation
  94. Overridden by user settings.
  95. Multiple tunings are separated by commas.
  96. Only one psy tuning can be used at a time.
  97. - film (psy tuning):
  98. --deblock -1:-1 --psy-rd <unset>:0.15
  99. - animation (psy tuning):
  100. --bframes {+2} --deblock 1:1
  101. --psy-rd 0.4:<unset> --aq-strength 0.6
  102. --ref {Double if >1 else 1}
  103. - grain (psy tuning):
  104. --aq-strength 0.5 --no-dct-decimate
  105. --deadzone-inter 6 --deadzone-intra 6
  106. --deblock -2:-2 --ipratio 1.1
  107. --pbratio 1.1 --psy-rd <unset>:0.25
  108. --qcomp 0.8
  109. - stillimage (psy tuning):
  110. --aq-strength 1.2 --deblock -3:-3
  111. --psy-rd 2.0:0.7
  112. - psnr (psy tuning):
  113. --aq-mode 0 --no-psy
  114. - ssim (psy tuning):
  115. --aq-mode 2 --no-psy
  116. - fastdecode:
  117. --no-cabac --no-deblock --no-weightb
  118. --weightp 0
  119. - zerolatency:
  120. --bframes 0 --force-cfr --rc-lookahead 0
  121. --sync-lookahead 0 --sliced-threads
  122. --slow-firstpass Don't force these faster settings with --pass 1:
  123. --no-8x8dct --me dia --partitions none
  124. --ref 1 --subme {2 if >2 else unchanged}
  125. --trellis 0 --fast-pskip
  126.  
  127. Frame-type options:
  128.  
  129. -I, --keyint <integer> Maximum GOP size [250]
  130. -i, --min-keyint <integer> Minimum GOP size [auto]
  131. --no-scenecut Disable adaptive I-frame decision
  132. --scenecut <integer> How aggressively to insert extra I-frames [40]
  133. --intra-refresh Use Periodic Intra Refresh instead of IDR frames
  134. -b, --bframes <integer> Number of B-frames between I and P [3]
  135. --b-adapt <integer> Adaptive B-frame decision method [1]
  136. Higher values may lower threading efficiency.
  137. - 0: Disabled
  138. - 1: Fast
  139. - 2: Optimal (slow with high --bframes)
  140. --b-bias <integer> Influences how often B-frames are used [0]
  141. --b-pyramid <string> Keep some B-frames as references [normal]
  142. - none: Disabled
  143. - strict: Strictly hierarchical pyramid
  144. - normal: Non-strict (not Blu-ray compatible)
  145. --no-cabac Disable CABAC
  146. -r, --ref <integer> Number of reference frames [3]
  147. --no-deblock Disable loop filter
  148. -f, --deblock <alpha:beta> Loop filter parameters [0:0]
  149. --slices <integer> Number of slices per frame; forces rectangular
  150. slices and is overridden by other slicing options
  151. --slice-max-size <integer> Limit the size of each slice in bytes
  152. --slice-max-mbs <integer> Limit the size of each slice in macroblocks
  153. --tff Enable interlaced mode (top field first)
  154. --bff Enable interlaced mode (bottom field first)
  155. --constrained-intra Enable constrained intra prediction.
  156. --pulldown <string> Use soft pulldown to change frame rate
  157. - none, 22, 32, 64, double, triple, euro (requires cfr input)
  158. --fake-interlaced Flag stream as interlaced but encode progressive.
  159. Makes it possible to encode 25p and 30p Blu-Ray
  160. streams. Ignored in interlaced mode.
  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, 0=lossless) [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 [10]
  174. --qpmax <integer> Set max QP [51]
  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 (experimental)
  184. --aq-strength <float> Reduces blocking and blurring in flat and
  185. textured areas. [1.0]
  186.  
  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 of -1 lets x264 choose. Frametypes: I,i,P,B,b.
  205. QPs are restricted by qpmin/qpmax.
  206.  
  207. Analysis:
  208.  
  209. -A, --partitions <string> Partitions to consider ["p8x8,b8x8,i8x8,i4x4"]
  210. - p8x8, p4x4, b8x8, i8x8, i4x4
  211. - none, all
  212. (p4x4 requires p8x8. i8x8 requires --8x8dct.)
  213. --direct <string> Direct MV prediction mode ["spatial"]
  214. - none, spatial, temporal, auto
  215. --no-weightb Disable weighted prediction for B-frames
  216. --weightp <integer> Weighted prediction for P-frames [2]
  217. - 0: Disabled
  218. - 1: Blind offset
  219. - 2: Smart analysis
  220. --me <string> Integer pixel motion estimation method ["hex"]
  221. - dia: diamond search, radius 1 (fast)
  222. - hex: hexagonal search, radius 2
  223. - umh: uneven multi-hexagon search
  224. - esa: exhaustive search
  225. - tesa: hadamard exhaustive search (slow)
  226. --merange <integer> Maximum motion vector search range [16]
  227. --mvrange <integer> Maximum motion vector length [-1 (auto)]
  228. --mvrange-thread <int> Minimum buffer between threads [-1 (auto)]
  229. -m, --subme <integer> Subpixel motion estimation and mode decision [7]
  230. - 0: fullpel only (not recommended)
  231. - 1: SAD mode decision, one qpel iteration
  232. - 2: SATD mode decision
  233. - 3-5: Progressively more qpel
  234. - 6: RD mode decision for I/P-frames
  235. - 7: RD mode decision for all frames
  236. - 8: RD refinement for I/P-frames
  237. - 9: RD refinement for all frames
  238. - 10: QP-RD - requires trellis=2, aq-mode>0
  239. --psy-rd 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. Requires CABAC. [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.  
  255. --deadzone-inter <int> Set the size of the inter luma quantization deadzone [21]
  256. --deadzone-intra <int> Set the size of the intra luma quantization deadzone [11]
  257. Deadzones should be in the range 0 - 32.
  258. --cqm <string> Preset quant matrices ["flat"]
  259. - jvt, flat
  260. --cqmfile <string> Read custom quant matrices from a JM-compatible file
  261. Overrides any other --cqm* options.
  262. --cqm4 <list> Set all 4x4 quant matrices
  263. Takes a comma-separated list of 16 integers.
  264. --cqm8 <list> Set all 8x8 quant matrices
  265. Takes a comma-separated list of 64 integers.
  266. --cqm4i, --cqm4p, --cqm8i, --cqm8p
  267. Set both luma and chroma quant matrices
  268. --cqm4iy, --cqm4ic, --cqm4py, --cqm4pc
  269. Set individual quant matrices
  270.  
  271. Video Usability Info (Annex E):
  272. The VUI settings are not used by the encoder but are merely suggestions to
  273. the playback equipment. See doc/vui.txt for details. Use at your own risk.
  274.  
  275. --overscan <string> Specify crop overscan setting ["undef"]
  276. - undef, show, crop
  277. --videoformat <string> Specify video format ["undef"]
  278. - component, pal, ntsc, secam, mac, undef
  279. --fullrange <string> Specify full range samples setting ["off"]
  280. - off, on
  281. --colorprim <string> Specify color primaries ["undef"]
  282. - undef, bt709, bt470m, bt470bg
  283. smpte170m, smpte240m, film
  284. --transfer <string> Specify transfer characteristics ["undef"]
  285. - undef, bt709, bt470m, bt470bg, linear,
  286. log100, log316, smpte170m, smpte240m
  287. --colormatrix <string> Specify color matrix setting ["undef"]
  288. - undef, bt709, fcc, bt470bg
  289. smpte170m, smpte240m, GBR, YCgCo
  290. --chromaloc <integer> Specify chroma sample location (0 to 5) [0]
  291. --nal-hrd <string> Signal HRD information (requires vbv-bufsize)
  292. - none, vbr, cbr (cbr not allowed in .mp4)
  293. --pic-struct Force pic_struct in Picture Timing SEI
  294.  
  295. Input/Output:
  296.  
  297. -o, --output Specify output file
  298. --muxer <string> Specify output container format ["auto"]
  299. - auto, raw, mkv, flv
  300. --demuxer <string> Specify input container format ["auto"]
  301. - auto, yuv, y4m
  302. --index <string> Filename for input index file
  303. --sar width:height Specify Sample Aspect Ratio
  304. --fps <float|rational> Specify framerate
  305. --seek <integer> First frame to encode
  306. --frames <integer> Maximum number of frames to encode
  307. --level <string> Specify level (as defined by Annex A)
  308.  
  309. -v, --verbose Print stats for each frame
  310. --no-progress Don't show the progress indicator while encoding
  311. --quiet Quiet Mode
  312. --psnr Enable PSNR computation
  313. --ssim Enable SSIM computation
  314. --threads <integer> Force a specific number of threads
  315. --sliced-threads Low-latency but lower-efficiency threading
  316. --thread-input Run Avisynth in its own thread
  317. --sync-lookahead <integer> Number of buffer frames for threaded lookahead
  318. --non-deterministic Slightly improve quality of SMP, at the cost of repeatability
  319. --asm <integer> Override CPU detection
  320. --no-asm Disable all CPU optimizations
  321. --visualize Show MB types overlayed on the encoded video
  322. --dump-yuv <string> Save reconstructed frames
  323. --sps-id <integer> Set SPS and PPS id numbers [0]
  324. --aud Use access unit delimiters
  325. --force-cfr Force constant framerate timestamp generation
  326. --tcfile-in <string> Force timestamp generation with timecode file
  327. --tcfile-out <string> Output timecode v2 file from input timestamps
  328. --timebase <int/int> Specify timebase numerator and denominator
  329. <integer> Specify timebase numerator for input timecode file
  330. or specify timebase denominator for other input
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement