X264参数设定详细解释
- 格式:doc
- 大小:20.09 KB
- 文档页数:22
X264参数设定详细解释x264 core:65 r1074M b6bb3d4Syntax: x264 [options] -o outfile infile [widthxheight]语法(命令行写法):x264 [参数] -o 输出文件名输入文件名[宽x高]范例:x264 --crf 26 --ref 3 --mixed-refs --bframes 3 --b-adapt 2 --b-pyramid --weightb --deblock -1:-1 --trellis 2 --partitions all --8x8dct --me umh --threads auto --thread-input --aud --progress --no-psnr --no-ssim -o output.mp4 input.avs 720x480 Infile can be raw YUV 4:2:0 (in which case resolution is required),or YUV4MPEG 4:2:0 (*.y4m),or AVI or Avisynth if compiled with AVIS support (yes).输入文件可以是RAW YUV 4:2:0(在某些情况下分辨率是必需的)或者YUV4MPEG 4:2:0 (*.y4m)或者AVI 或Avisynth(后面的yes说明支持AVS输入)Outfile type is selected by filename:.264 -> Raw bytestream.mkv -> Matroska.mp4 -> MP4 if compiled with GPAC support (yes)输出文件类型由输出文件名指定:.264 -> Raw 格式.mkv -> MKV格式.MP4 -> MP4格式(yes说明支持MP4输出)Options:可选参数:-h, --help List the more commonly used options --longhelp List all options-h, --help 显示常用参数--longhelp 显示全部参数注:-h,--help代表-h与--help两者都可以,-h是简化写法举个例子:x264 -h与x264 --help两者效果等价——————————————————————————————————————Frame-type options:帧-类型选项:-I, --keyint Maximum GOP size [250]说明:指定两个IDR帧之间的最大间隔,默认250推荐值:默认或者FPS的10倍范例:--keyint 300注:[250]代表默认值为250提示:若想使用默认值,不使用参数即可-i, --min-keyint Minimum GOP size [25]说明:指定两个IDR帧之间的最小间隔,默认25推荐值:默认或者FPS的大小范例:--min-keyint 30问题:如何查看FPS?/zh-CN去上面的网站下载mediainfo查看--scenecut How aggressively to insert extra I-frames [40]说明:指定强制使用IDR帧的阀值,值越大强度越高,默认为40推荐值:默认范例:--scenecut 40--pre-scenecut Faster, less precise scenecut detection.Required and implied by multi-threading.说明:效果同scenecut,速度比scenecut快,但是精度稍低,默认设定为当threads>1时,永远使用--pre-scenecut 推荐值:默认-b, --bframes Number of B-frames between I and P [0]说明:设定I帧与P帧之间的最大B帧数量,范围0~16推荐值:3-6范例:--bframes 3--b-adapt Adaptive B-frame decision method [1]Higher values may lower threading efficiency.- 0: Disabled- 1: Fast- 2: Optimal (slow with high --bframes)说明:B帧自适应方法,默认为1- 0: 关闭- 1: 高速- 2: 最优化(--bframes的值越高速度越慢)推荐值:2范例:--b-adapt 2--b-bias Influences how often B-frames are used [0]说明:影响B帧使用的频繁程度,默认为0推荐值:0范例:--b-bias 0--b-pyramid Keep some B-frames as references说明:允许其它帧参考B帧,默认不使用推荐值:开启范例:--b-pyramid--no-cabac Disable CABAC说明:关闭CABAC,默认不使用-r, --ref Number of reference frames [1]说明:设定参考帧的数量,范围0~16,默认值为1,过大的值可能导致无法硬解,参考以下公式计算良好硬解的最大参考帧最大参考帧数量计算公式:maximum ref = 12288 * 1024 / ( width * height * 1.5)推荐值:3-6范例:--ref 3--no-deblock Disable loop filter说明:关闭deblock filter,默认不使用推荐值:默认范例:--no-deblock-f, --deblock Loop filter AlphaC0 and Beta parameters [0:0]说明:设定deblock filter参数,alpha为Deblocking strength,beta为Deblockingthreshold,值越大deblocking效果越好,画面越干净,但是会损失一些细节并有些许模糊,反之亦然,上下限不要超过-3,3,默认0,0推荐值:默认范例:--deblock 0:0--interlaced Enable pure-interlaced mode说明:隔行编码模式,默认关闭范例:--interlaced——————————————————————————————————————Ratecontrol:压缩比控制:-q, --qp Set QP (0=lossless) [26]说明:固定量化模式,值越小质量越好,默认为26,qp = crf + --qcomp 1推荐值:使用crf,见crf部分范例:--qp 26-B, --bitrate Set bitrate (kbit/s)说明:目标码率模式,生成的视频码率大小为指定的bitrate 的值,一般搭配--pass使用推荐值:720P以下码率为800-2100kbps之间,720P为3-6Mbps,1080P为8-15Mbps以上范例:--bitrate 1000--crf Quality-based VBR (nominal QP) 说明:固定压缩因子模式,值越小质量越好,一般搭配--qcomp使用推荐值:16-26范例:--crf 26--qcomp QP curve compression: 0.0 => CBR, 1.0 => CQP [0.60]说明:压缩曲线,范围为0~1之间,数值越小曲线越平坦,与crf搭配使用,默认为0.6推荐值:默认范例:--qcomp 0.6--vbv-maxrate Max local bitrate (kbit/s) [0]说明:设定VBV模式的最大码率,如果需要硬解必须开启VBV模式,默认为0范例:--vbv-maxrate 50000--vbv-bufsize Enable CBR and set size of the VBV buffer (kbit) [0]说明:设定VBV缓冲区的最大尺寸,其大小一般由硬件设备决定,默认为0范例:--vbv-bufsize 50000--vbv-init Initial VBV bufferoccupancy [0.9]说明:设定VBV缓冲区的初始填充尺寸,默认为0.9范例:--vbv-init 0.9--qpmin Set min QP [10]说明:设定qp的下限,默认为10范例:--qpmin 10--qpmax Set max QP [51]说明:设定qp的上限,默认为51范例:--qpmax 51--qpstep Set max QP step [4]说明:设定qp的最大步长,默认为4范例:--qpstep 4--ratetol Allowed variance of average bitrate [1.0]说明:允许最终码率偏离指定平均码率的百分比,只在1pass 中起作用,默认为1.0范例:--ratetol 1.0--ipratio QP factor between I and P [1.40]说明:设定I帧相对于P帧的量化比推荐值:默认范例:--ipratio 1.40--pbratio QP factor between P and B [1.30]说明:设定P帧相对于B帧的量化比推荐值:默认范例:--ipratio 1.30--chroma-qp-offset QP difference between chroma and luma [0]说明:chroma 与luma 的QP差异值,这个值会随着--psy-rd的使用自动调整为-2推荐值:默认范例:--chroma-qp-offset 0--aq-mode AQ method [1]- 0: Disabled- 1: Variance AQ (complexity mask)说明:自适应量化方法,可以改善某些场景过于模糊等问题,默认开启- 0: 关闭- 1: 可变AQ推荐值:默认范例:--aq-mode 1--aq-strength Reduces blocking and blurring in flat andtextured areas. [1.0]- 0.5: weak AQ- 1.5: strong AQ说明:指定AQ的强度,减小低细节宏块的量化值,默认1.0 - 0.5: 较弱的AQ- 1.5: 较强的AQ推荐值:默认范例:--aq-strength 1.0-p, --pass Enable multipass ratecontrol- 1: First pass, creates stats file- 2: Last pass, does not overwrite stats file- 3: Nth pass, overwrites stats file说明:多重压缩模式,1 pass 或N pass生成stats文件,2pass调用生成的stats文件对压缩进行优化,更合理的分配码率,一般没必要进行N pass- 1: 第1 pass,生成stats文件- 2: 最终pass,不覆盖stats文件- 3: 第N pass,覆盖stats文件推荐值:2范例:--pass 2--stats Filename for 2 pass stats["x264_2pass.log"]说明:指定stats文件名,默认为"x264_2pass.log"推荐值:默认范例:--stats "x264_2pass.log"--cplxblur Reduce fluctuations in QP (before curve compression) [20.0]说明:减小QP的波动(在曲线压缩以前),范围0~999推荐值:默认范例:--cplxblur 20--qblur Reduce fluctuations in QP (after curve compression) [0.5]说明:减小QP的波动(在曲线压缩之后),范围0~99推荐值:默认范例:--qblur 0.5--zones //... Tweak the bitrate of someregions of the videoEach zone is of the form,,where is eitherq= (force QP)or b= (bitrate multiplier)说明:调整视频中某一范围内的码率每个区域已以下形式出现,,为下面的任意一个q= (强制QP)或b= (指定bitrate)范例:--zone 0,1000,qp=30/30000,32000,b=0.5--qpfile Force frametypes and QPs说明:强制指定帧类型与QP推荐值:默认Analysis:分析:-A, --partitions Partitions to consider["p8x8,b8x8,i8x8,i4x4"]- p8x8, p4x4, b8x8, i8x8, i4x4- none, all(p4x4 requires p8x8. i8x8 requires --8x8dct.)说明:宏块分割方式,默认["p8x8,b8x8,i8x8,i4x4"]- p8x8, p4x4, b8x8, i8x8, i4x4- none, all(p4x4 需要p8x8. i8x8 需要--8x8dct.)推荐值:默认范例:--partitions "p8x8,b8x8,i8x8,i4x4"--direct Direct MV prediction mode ["spatial"]- none, spatial, temporal, auto说明:Direct预测方法,默认"spatial"- none, spatial, temporal, auto推荐值:"auto"范例:--direct "auto"--direct-8x8 Direct prediction size [1] - 0: 4x4- 1: 8x8- -1: smallest possible according to level说明:Direct预测大小,默认为-1- 0: 4x4- 1: 8x8- -1: 根据Level确定一个最小值范例:--direct 1-w, --weightb Weighted prediction forB-frames说明:允许对B帧进行加权预测范例:--weightb--me Integer pixel motion estimation method ["hex"]- dia: diamond search, radius 1 (fast)- hex: hexagonal search, radius 2- umh: uneven multi-hexagon search- esa: exhaustive search- tesa: hadamard exhaustive search (slow)说明:全像素动态预测方法,越往下精度越高,速度越慢,默认"hex"- dia: 菱形搜索, 半径1 (高速)- hex: 六边形搜索, 半径2- umh: 不规则多边形搜索- esa: 全面搜索- tesa: hadamard变换全面搜索(最慢)推荐值:"umh"范例:--me "umh"--merange Maximum motion vector search range [16]说明:最大动态矢量搜索范围,结合--me使用,对于dia与hex,允许的范围为4~16,umh以上可以超过16,值越大编码速度越慢,默认为16范例:--merange 16--mvrange Maximum motion vector length [-1 (auto)]说明:最大动态矢量长度推荐值:默认范例:--mvrange -1 --mvrange-thread Minimum buffer between threads [-1 (auto)]说明:线程之间的最小缓冲区大小推荐值:默认范例:--mvrange-thread -1 -m, --subme Subpixel motion estimation and mode decision [6]- 0: fullpel only (not recommended)- 1: SAD mode decision, one qpel iteration- 2: SATD mode decision- 3-5: Progressively more qpel- 6: RD mode decision for I/P-frames- 7: RD mode decision for all frames- 8: RD refinement for I/P-frames- 9: RD refinement for all frames说明:子像素动态预测模式策略,值越大效果越好,速度越慢,默认6- 0: 仅fullpel (不推荐)- 1: SAD模式策略, 1 qpel迭代- 2: SATD模式策略- 3-5: 依次qpel增加- 6: I/P-帧RD模式策略- 7: 所有帧RD模式策略- 8: I/P-帧RD refinement模式策略- 9: 所有帧RD refinement模式策略推荐值:6以上范例:--subme 7--psy-rd Strength of psychovisual optimization ["1.0:0.0"]#1: RD (requires subme>=6)#2: Trellis (requires trellis, experimental)说明:视觉优化,--psy-rd 1.0:0.0 代表#1为1.0,#2为0.0,#2还在测试阶段,默认1.0:0.0#1: RD (需要subme>=6)#2: Trellis (需要trellis, 测试阶段)推荐值:#1 (0~1.0),#2 0.0范例:--psy-rd 1.0:0.0--mixed-refs Decide references on a per partition basis说明:对每个宏块区进行参考帧判断,开启后可以提升质量,但会降低速度推荐值:开启范例:--mixed-refs--no-chroma-me Ignore chroma in motion estimation说明:在动态预测中忽略chroma推荐值:默认范例:--no-chroma-me-8, --8x8dct Adaptive spatial transform size说明:自适应空间变换大小推荐值:使用范例:--8x8dct-t, --trellis Trellis RD quantization. Requires CABAC. [0]- 0: disabled- 1: enabled only on the final encode of a MB- 2: enabled on all mode decisions说明:Trllis RD量化.需要CABAC,值越大速度越慢,默认0- 0:关闭- 1:基于宏块- 2:在所有模式策略中使用推荐值:1范例:--trellis 1--no-fast-pskip Disables early SKIP detection on P-frames说明:关闭早期的P帧快速检测,开启可以提升质量,但会减低一些速度,默认不使用推荐值:使用范例:--no-fast-pskip--no-dct-decimate Disables coefficientthresholding on P-frames说明:关闭P帧的系数阀值,默认不使用推荐值:默认范例:--no-dct-decimate--nr Noise reduction [0]说明:降噪,默认0推荐值:默认范例:--nr 0--deadzone-inter Set the size of the inter luma quantization deadzone [21]--deadzone-intra Set the size of the intra luma quantization deadzone [11]Deadzones should be in the range 0 - 32.说明:设定inter/intra luma deadzone 量化值的大小,范围0 - 32推荐值:默认范例:--deadzone-inter 21 --deadzone-intra 11--cqm Preset quant matrices ["flat"]- jvt, flat说明:预设量化矩阵- jvt, flat推荐值:默认范例:--cqm "flat"--cqmfile Read custom quant matricesfrom a JM-compatible fileOverrides any other --cqm* options.说明:读取自定义JM兼容的量化矩阵文件,无视任何以--cqm开头的参数范例:--cqm "mycqm"--cqm4 Set all 4x4 quant matrices Takes a comma-separated list of 16 integers.说明:设定所有4x4量化矩阵,它是一张以逗号分割的16个整数的表范例:--cqm"16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16"--cqm8 Set all 8x8 quant matricesTakes a comma-separated list of 64 integers.说明:设定所有8x8量化矩阵,它是一张以逗号分割的64个整数的表范例:参考--cqm4--cqm4i, --cqm4p, --cqm8i, --cqm8pSet both luma and chroma quant matrices说明:设定luma与chroma的量化矩阵范例:参考--cqm4--cqm4iy, --cqm4ic, --cqm4py, --cqm4pc Set individual quant matrices说明:单独设定量化矩阵范例:参考--cqm4Video Usability Info (Annex E):The VUI settings are not used by the encoder but aremerely suggestions tothe playback equipment. See doc/vui.txt for details. Use at your own risk.视频可用性信息:VUI设置在编码的时候不会用到,它仅仅作用于回放设备。