x264命令行参数解释_第1页
x264命令行参数解释_第2页
x264命令行参数解释_第3页
x264命令行参数解释_第4页
x264命令行参数解释_第5页
已阅读5页,还剩11页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

x264 命令行参数解释 使用格式:x264 默认选项 -o 输出文件 输入文件 长 x 宽 输入支持格式:RAW/y4m/avi/avs(编译时可选) 输出支持格式:264/mkv/mp4(编译时可选) x264 的许多参数可以有-/-两种输入法,笔者也不知道为什么。以下等价参数用“参 数 1/参数 2 ”表示,参数尾部()内为个人推荐。 -h/-help 帮助 帧类型选项: -I/-keyint 最大 IDR 帧间距,默认 250 -i/-min-keyint 最小 IDR 帧间距,默认 25 -scenecut 画面动态变化限,当超出此值时插入 I 帧,默认 40 -b/-bframes 在 IP 帧之间可插入的 B 帧数量最大值,范围 016,默认 0 -no-b-adapt 关闭自适应 B 帧判定(-b 设为 1 时可用,其他不推荐) -b-bias 控制插入 B 帧判定,范围-100+100,越高越容易插入 B 帧,默认 0 -b-pyramid 允许 B 帧做参考帧 -no-cabac 关闭内容自适应二进制算术编码(CABAC,高效率的熵编码)(会提 高速度,但严重影响质量) -r/-ref 最大参考帧数,范围 016,默认 1 -nf 关闭环路滤波(一种除马赛克算法) -f/-filter 设置环路滤波的 AlphaC 和 Beta 的参数,范围-6-6,默认都为 0 码率控制选项: -q/-qp 固定量化模式并设置使用的量化值,范围 051,0 为无损压缩,默认 26 -B/-bitrate 设置平均码率 -crf 质量模式,量化值动态可变(目前不太成熟,质量不如设置固定量化值) -qpmin 设置最小量化值,范围 051,默认 10 -qpmax 设置最大量化值,范围 051,默认 51 -qpstep 设置相邻帧之间的量化值差,范围 050,默认 4 -ratetol 平均码率模式下,瞬时码率可以偏离的倍数,范围 0.1100.0,默认 1.0 -vbv-maxrate 平均码率模式下,最大瞬时码率,默认 0(与-B 设置相同) -vbv-bufsize 码率控制缓冲区的大小,单位 kbit,默认 0 -vbv-init 码率控制缓冲区数据保留的最大数据量与缓冲区大小之比,范围 01.0,默认 0.9 -ipratio I 帧和 P 帧之间的量化系数,默认 1.40 -pbratio P 帧和 B 帧之间的量化系数,默认 1.30 -色度-qp-offset 色度和亮度之间的量化差,范围-12+12,默认 0 -p/-pass 多次压缩码率控制 1:第一次压缩,创建统计文件 2:按建立的统计文件压缩并输出,不覆盖统计文件, 3:按建立的统计文件压缩,优化统计文件 -stats 统计文件的名称,默认“x264_2pass.log“ -rceq 速率控制公式,默认“blurCplx(1-qComp)“ -qcomp 线性量化控制,0.0 为固定码率,1.0 为固定量化值,默认 0.6,只用于 2- pass 和质量模式 -cplxblur 根据相邻帧平滑量化值比例的最大值,范围 099.9,默认 20.0,只用 于 2-pass 和质量模式 -qblur 对统计文件结果平滑量化值比例的最大值,范围 099.9,默认 0.5,只用于 2-pass -zones / 分段量化,格式为:,,可选项为:q=(量化值)或 b=(码率倍数) 分析选项: -A/-analyse 动态块划分方法,默认“p8x8,b8x8,i8x8,i4x4“。可选项: p8x8/p4x4/b8x8/i8x8/i4x4;none/all(p4x4 需要 p8x8. i8x8 需要-8x8dct) -direct 动态预测方式,默认 “spatial“。可选项: none/spatial/temporal/auto -w/-weightb 允许 B 帧加权预测(可以减少相邻 B 帧质量低的影响) -me 对全像素块动态预测搜索的方式,默认“hex“,可选项: dia:菱形搜索,半径 1 (快) hex:正六边形搜索,半径 2 umh:可变半径六边形搜索 esa:全面搜索(很慢,而且效果与 umh 几乎相同) -merange -me 为 umh/esa 时的搜索半径,最大 64,默认 16 -m/-subme 动态预测和分区方式,可选项 17,默认 5(与压缩质量和时间关系密切, 1 是 7 速度的四倍以上) 1:用全像素块进行动态搜索,对每个块再用快速模式进行四分之一像素块精确搜索 2:用半像素块进行动态搜索,对每个块再用快速模式进行四分之一像素块精确搜索 3:用半像素块进行动态搜索,对每个块再用质量模式进行四分之一像素块精确搜索 4:用快速模式进行四分之一像素块精确搜索 5:用质量模式进行四分之一像素块精确搜索 6:进行 I、P 帧像素块的速率失真最优化(rdo) 7:进行 I、P 帧运动矢量及块内部的速率失真最优化(质量最好) -b-rdo B 帧也进行 rdo,需要-subme 在 6 以上 -mixed-refs 可以在一帧内使用不同参考帧 -no-chroma-me 不进行色度的动态预测 -bime 可以平均 B 帧参考块的运动矢量 -8/-8x8dct 可以使用 8x8 的离散余弦变换(DCT) -t/-trellis Trellis 量化,对每个 8x8 的块寻找合适的量化值,需要 CABAC,默认 0 0:关闭 1:只在最后编码时使用 2:一直使用 -no-fast-pskip 关闭快速 P 帧跳过检测 -no-dct-decimate 关闭 P 帧联合编码(可以增加细节,但也会增大体积) -nr 噪声去除,范围 0100000,默认 0 -cqm 设置外部量化矩阵格式,默认“flat“,可选项:jvt/flat -cqmfile 读取 JM 格式的外部量化矩阵文件,自动忽略其他-cqm*选项 -cqm4 设置 4x4 的量化矩阵,用逗号分开,范围 1255 的 16 个整数 -cqm8 设置 8x8 的量化矩阵,用逗号分开,范围 1255 的 64 个整数 -cqm4i/-cqm4p/-cqm8i/-cqm8p 设置 I、P 帧不同的量化矩阵 -cqm4iy/-cqm4ic/-cqm4py/-cqm4pc 设置亮度、色度不同的量化矩阵 视频标准化选项: 这些选项与编码无关,不过如果要用 mp4 之类的播放器,可以设置,风险自担 -sar width:height 设置长宽比 -overscan 过扫描线,默认“undef“(不设置),可选项:show(观看)/crop(去除) -videoformat 视频格式,默认“undef“,可选项: component/pal/ntsc/secam/mac/undef -fullrange Specify full range samples setting,默认“off“,可选项: off/on(我也不明白这是干什么的,请高手指点) -colorprim 原始色度格式,默认“undef“,可选项: undef/bt709/bt470m/bt470bg,smpte170m/smpte240m/film -transfer 转换方式,默认“undef“,可选项: undef/bt709/bt470m/bt470bg/linear,log100/log316/smpte170m/smpte240m -colormatrix 色度矩阵设置,默认 “undef“,undef/bt709/fcc/bt470bg,smpte170m/smpte240m/GBR/YCgCo -chromaloc 色度样本指定,范围 05,默认 0 输入、输出选项: -level 设定等级(as defined by Annex A)(不明白,请高手指点) -fps 设定帧率 -seek 设定起始帧 -frames 最大编码帧数 -o/-output 指定输出文件 -threads 编码线程(使用分片技术) -thread-input 在编码线程中运行 Avisynth -no-asm 关闭全部 CPU 优化指令 -no-psnr 关闭 PSNR 计算 -quiet 安静模式 -v/-verbose 显示每一个帧的信息 -progress 显示编码进程 -visualize 显示运动矢量 -sps-id 设置 SPS 和 PPS 的 ID 值,默认 0 -aud 使用数据单元定义符号 - - 2006-9-14 03:00 PM adminx264 编码器参数设置详解 bitrate= Sets the average bitrate to be used in kbits/second (default: off). Since local bitrate may vary, this average may be inaccurate for very short videos (see ratetol). Constant bitrate can be achieved by combining this with vbv_maxrate, at significant reduction in quality. qp_constant= This selects the quantizer to use for P-frames. I- and B-frames are offset from this value by ip_factor and pb_factor, respectively. 20?40 is a useful range (default: 26). Lower values result in better fidelity, but higher bitrates. 0 is lossless. Note that quantization in H.264 works differently from MPEG-1/2/4: H.264s quantization parameter (QP) is on a logarithmic scale. The mapping is approximately H264QP = 12 + 6*log2(MPEGQP). For example, MPEG at QP=2 is equivalent to H.264 at QP=18. crf= Enables constant quality mode, and selects the quality. The scale is similar to QP. Like the bitrate-based modes, this allows each frame to use a different QP based on the frames complexity. pass= Enable 2 or 3-pass mode. It is recommended to always encode in 2 or 3-pass mode as it leads to a better bit distribution and improves overall quality. 1 first pass 2 second pass (of two pass encoding) 3 Nth pass (second and third passes of three pass encoding) Here is how it works, and how to use it: The first pass (pass=1) collects statistics on the video and writes them to a file. You might want to deactivate some CPU-hungry options, apart from the ones that are on by default. In two pass mode, the second pass (pass=2) reads the statistics file and bases ratecontrol decisions on it. In three pass mode, the second pass (pass=3, that is not a typo) does both: It first reads the statistics, then overwrites them. You can use all encoding options, except very CPU-hungry options. The third pass (pass=3) is the same as the second pass, except that it has the second pass statistics to work from. You can use all encoding options, including CPU-hungry ones. The first pass may use either average bitrate or constant quantizer. ABR is recommended, since it does not require guessing a quantizer. Subsequent passes are ABR, and must specify bitrate. turbo= Fast first pass mode. During the first pass of a two or more pass encode it is possible to gain speed by disabling some options with negligible or even no impact on the final pass output quality. 0 disabled (default) 1 Reduce subq, frameref and disable some inter-macroblock partition analysis modes. 2 Reduce subq and frameref to 1, use a diamond ME search and disable all partition analysis modes. Level 1 can increase first pass speed up to 2x with no change in the global PSNR of the final pass compared to a full quality first pass. Level 2 can increase first pass speed up to 4x with about +/- 0.05dB change in the global PSNR of the final pass compared to a full quality first pass. keyint= Sets maximum interval between IDR-frames (default: 250). Larger values save bits, thus improve quality, at the cost of seeking precision. Unlike MPEG-1/2/4, H.264 does not suffer from DCT drift with large values of keyint. keyint_min= Sets minimum interval between IDR-frames (default: 25). If scenecuts appear within this interval, they are still encoded as I-frames, but do not start a new GOP. In H.264, I-frames do not necessarily bound a closed GOP because it is allowable for a P-frame to be predicted from more frames than just the one frame before it (also see frameref). Therefore, I-frames are not necessarily seekable. IDR-frames restrict subsequent P-frames from referring to any frame prior to the IDR-frame. scenecut= Controls how aggressively to insert extra I-frames (default: 40). With small values of scenecut, the codec often has to force an I-frame when it would exceed keyint. Good values of scenecut may find a better location for the I-frame. Large values use more I-frames than necessary, thus wasting bits. -1 disables scene-cut detection, so I-frames are inserted only once every other keyint frames, even if a scene-cut occurs earlier. This is not recommended and wastes bitrate as scenecuts encoded as P-frames are just as big as I-frames, but do not reset the “keyint counter“. frameref= Number of previous frames used as predictors in B- and P-frames (default: 1). This is effective in anime, but in live-action material the improvements usually drop off very rapidly above 6 or so reference frames. This has no effect on decoding speed, but does increase the memory needed for decoding. Some decoders can only handle a maximum of 15 reference frames. bframes= maximum number of consecutive B-frames between I- and P-frames (default: 0) (no)b_adapt Automatically decides when to use B-frames and how many, up to the maximum specified above (default: on). If this option is disabled, then the maximum number of B-frames is used. b_bias= Controls the decision performed by b_adapt. A higher b_bias produces more B- frames (default: 0). (no)b_pyramid Allows B-frames to be used as references for predicting other frames. For example, consider 3 consecutive B-frames: I0 B1 B2 B3 P4. Without this option, B-frames follow the same pattern as MPEG-124. So they are coded in the order I0 P4 B1 B2 B3, and all the B-frames are predicted from I0 and P4. With this option, they are coded as I0 P4 B2 B1 B3. B2 is the same as above, but B1 is predicted from I0 and B2, and B3 is predicted from B2 and P4. This usually results in slightly improved compression, at almost no speed cost. However, this is an experimental option: it is not fully tuned and may not always help. Requires bframes = 2. Disadvantage: increases decoding delay to 2 frames. (no)deblock Use deblocking filter (default: on). As it takes very little time compared to its quality gain, it is not recommended to disable it. deblockalpha= AlphaC0 parameter of deblocking filter (default: 0). This adjusts thresholds for the H.264 in-loop deblocking filter. First, this parameter adjusts the maximum amount of change that the filter is allowed to cause on any one pixel. Secondly, this parameter affects the threshold for difference across the edge being filtered. A positive value reduces blocking artifacts more, but will also smear details. The default behavior of the filter almost always achieves optimal quality, so it is best to either leave it alone, or make only small adjustments. However, if your source material already has some blocking or noise which you would like to remove, it may be a good idea to turn it up a little bit. deblockbeta= Beta parameter of deblocking filter (default: 0). Affects the detail threshold. Very detailed blocks are not filtered, since the smoothing caused by the filter would be more noticeable than the original blocking. (no)cabac Use CABAC (Context-Adaptive Binary Arithmetic Coding) (default: on). Slightly slows down encoding and decoding, but should save 10-15% bitrate. Unless you are looking for decoding speed, you should not disable it. qp_min= (ABR or two pass) Minimum quantizer, 10?30 seems to be a useful range (default: 10). qp_max= (ABR or two pass) maximum quantizer (default: 51) qp_step= (ABR or two pass) maximum value by which the quantizer may be incremented/decremented between frames (default: 2) ratetol= (ABR or two pass) allowed variance in average bitrate (no particular units) (default: 1.0) vbv_maxrate= (ABR or two pass) maximum local bitrate, in kbits/second (default: disabled) vbv_bufsize= (ABR or two pass) averaging period for vbv_maxrate, in kbits (default: none, must be specified if vbv_maxrate is enabled) vbv_init= (ABR or two pass) initial buffer occupancy, as a fraction of vbv_bufsize (default: 0.9) ip_factor= quantizer factor between I- and P-frames (default: 1.4) pb_factor= quantizer factor between P- and B-frames (default: 1.3) qcomp= (ABR or two pass) quantizer compression (default: 0.6). A lower value makes the bitrate more constant, while a higher value makes the quantization parameter more constant. cplx_blur= (two pass only) Temporal blur of the estimated frame complexity, before curve compression (default: 20). Lower values allow the quantizer value to jump around more, higher values force it to vary more smoothly. cplx_blur ensures that each I- frame has quality comparable to the following P-frames, and ensures that alternating high and low complexity frames (e.g. low fps animation) do not waste bits on fluctuating quantizer. qblur= (two pass only) Temporal blur of the quantization parameter, after curve compression (default: 0.5). Lower values allow the quantizer value to jump around more, higher values force it to vary more smoothly. zones=/. User specified quality for specific parts (ending, credits, .) (ABR or two pass). Each zone is , where option may be q= quantizer b= bitrate multiplier NOTE: The quantizer option is not strictly enforced. It affects only the planning stage of ratecontrol, and is still subject to overflow compensation and qp_min/qp_max. direct_pred= Determines the type of motion prediction used for direct macroblocks in B-frames. 0 None: Direct macroblocks are not used. 1 Spatial: Motion vectors are extrapolated from neighboring blocks. (default) 2 Temporal: Motion vectors are interpolated from the following P-frame. 3 Auto: The codec selects between spatial and temporal for each frame. Spatial and temporal are approximately the same speed and PSNR, the choice between them depends on the video content. Auto is slightly better, but slower. direct_pred=0 is both slower and lower quality. (no)weight_b Use weighted prediction in B-frames. Without this option, bidirectionally predicted macroblocks give equal weight to each reference frame. With this option, the weights are determined by the temporal position of the B-frame relative to the references. Requires bframes 1. (no)i4x4 Use additional macroblock type i4x4 (default: enabled). Without this option, P- and B-frames will use only i16x16 and the inter types specified below. (no)i8x8 Use additional macroblock type i8x8 (default: enabled). This option has no effect unless 8x8dct is enabled. (no)b8x8mv Use additional macroblock types b16x8, b8x16, b8x8 (default: enabled). Without this option, B-frames will use only types i16x16, i8x8, i4x4, b16x16, skip, direct. See 4x4mv for details. (no)8x8mv Use additional macroblock types p16x8, p8x16, p8x8 (default: enabled). Without this option, P-frames will use only types i16x16, i8x8, i4x4, p16x16, skip. This option is provided for experimentation only. It is not recommended to disable 8x8mv in a real encode. (no)4x4mv Use additional macroblock types p8x4, p4x8, p4x4 (default: disabled). Without this option, P-frames will use only types i16x16, i8x8, i4x4, p16x16, p16x8, p8x16, p8x8, skip. Requires 8x8mv. The idea is to find the type and size that best describe a certain area of the picture. For example, a global pan is better represented by 16x16 blocks, while small moving objects are better represented by smaller blocks. 4x4mv is recommended only with subq = 3. (no)8x8dct Adaptive spatial transform size: allows macroblocks to choose between 4x4 and 8x8 DCT. Also allows the i8x8 macroblock type. Without this option, only 4x4 DCT is used. me= Select fullpixel motion estimation algorithm. 1 diamond search, radius 1 (fast) 2 hexagon search, radius 2 (default) 3 uneven multi-hexagon search (slow) 4 exhaustive search (very slow, and no better than 3) me_range= radius of exhaustive or multi-hexagon motion search (default: 16) subq= Adjust subpel refinement quality. This parameter controls quality versus speed tradeoffs involved in the motion estimation decision process. subq=5 can compress up to 10% better than subq=1. 1 Runs fullpixel precision motion estimation on all candidate macroblock types. Then selects the best type. Then refines the motion of that type to fast quarterpixel precision (fastest). 2 Runs halfpixel precision motion estimation on all candidate macroblock types. Then selects the best type. Then refines the motion of that type to fast quarterpixel precision. 3 As 2, but uses a slower quarterpixel refinement. 4 Runs fast quarterpixel precision motion estimation on all candidate macroblock types. Then selects the best type. Then finishes the quarterpixel refinement for that type. 5 Runs best quality quarterpixel precision motion estimation on all candidate macroblock types, before selecting the best type (default). 6 Enables rate-distortion optimization of macroblock types in I- and P-frames. 7 Enables rate-distortion optimization of motion vectors and intra modes. (best) In the above, “all candidates“ does not exactly mean all enabled types: 4x4, 4x8, 8x4 are tried only if 8x8 is better than 16x16. (no)chroma_me Takes into account chroma information during subpixel motion search (default: enabled). Requires subq=5. (no)mixed_refs Allows each 8x8 or 16x8 motion partition to independently select a reference frame. Without this option, a whole macroblock must use the same reference. Requires frameref1. (no)brdo Enables rate-distortion optimization of macroblock types in B-frames. Requires subq=6. (no)bime Refine the two motion vectors used in bidirectional macroblocks, rather than re- using vectors from the forward and backward searches. This option has no effect without B-frames. trellis= rate-distortion optimal quantization 0 disabled 1 enabled only for the final encode (default) 2 enabled during all mode decisions (slow, requires subq=6) (no)fast_pskip Performs early skip detection in P-frames (default: enabled). This usually improves speed at no cost, but it can sometimes produce artifacts in areas with no details, like sky. (no)dct_decimate Eliminate dct blocks in P-frames containing only a small single coefficient (default: enabled). This will remove some details, so it will save bits that can be spent again on other frames, hopefully raising overall subjective quality. If you are compressing non-anime content with a high target bitrate, you may want to disable this to preserve as much detail as possible. nr= Noise reduction, 0 means disabled. 100?1000 is a useful range for typical content, but you may want to turn it up a bit

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论