x264 cli參數簡析

athrunz 2009-05-02 08:09

【原創】x264 cli參數簡析
 
說明:
1.本文基於x264 --longhelp r1074M
2.這是一份“幼兒園級”讀物,希望一個新人也能通過本文學會配置一個相對合理的x264參數
3.本文拒絕那些所謂的“高人”閱讀,既然你自認爲你自己是“高材生”,那麼讀“幼兒園級”的文檔會顯得你很幼稚
4.轉載請註明出處:sonature.com.cn 作者:剎那·F·清英

x264 core:65 r1074M b6bb3d4

Syntax: 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兩者效果等價

athrunz 2009-05-02 08:15

回覆: 【原創】x264 cli參數簡析
 
Frame-type options:
幀-類型選項:

-I, --keyint <integer> Maximum GOP size [250]
說明:指定兩個IDR幀之間的最大間隔,默認250
推薦值:默認或者FPS的10倍
範例:--keyint 300
注:[250]代表默認值爲250
提示:若想使用默認值,不使用參數即可

-i, --min-keyint <integer> Minimum GOP size [25]
說明:指定兩個IDR幀之間的最小間隔,默認25
推薦值:默認或者FPS的大小
範例:--min-keyint 30

問題:如何查看FPS?
http://mediainfo.sourceforge.net/zh-CN
去上面的網站下載mediainfo查看

--scenecut <integer> 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 <integer> 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 <integer> 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 <integer> 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 <alpha:beta> 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 <integer> Set QP (0=lossless) [26]
說明:固定量化模式,值越小質量越好,默認爲26qp = crf + --qcomp 1
推薦值:使用crf,見crf部分
範例:--qp 26

-B, --bitrate <integer> Set bitrate (kbit/s)
說明:目標碼率模式,生成的視頻碼率大小爲指定的bitrate的值,一般搭配--pass使用
推薦值:720P以下碼率爲800-2100kbps之間,720P爲3-6Mbps,1080P爲8-15Mbps以上
範例:--bitrate 1000

--crf <float> Quality-based VBR (nominal QP)
說明:固定壓縮因子模式,值越小質量越好,一般搭配--qcomp使用
推薦值:16-26
範例:--crf 26

--qcomp <float> QP curve compression: 0.0 => CBR, 1.0 => CQP [0.60]
說明:壓縮曲線,範圍爲0~1之間,數值越小曲線越平坦,與crf搭配使用,默認爲0.6
推薦值:默認
範例:--qcomp 0.6

--vbv-maxrate <integer> Max local bitrate (kbit/s) [0]
說明:設定VBV模式的最大碼率,如果需要硬解必須開啓VBV模式,默認爲0
範例:--vbv-maxrate 50000

--vbv-bufsize <integer> Enable CBR and set size of the VBV buffer (kbit) [0]
說明:設定VBV緩衝區的最大尺寸,其大小一般由硬件設備決定,默認爲0
範例:--vbv-bufsize 50000

--vbv-init <float> Initial VBV buffer occupancy [0.9]
說明:設定VBV緩衝區的初始填充尺寸,默認爲0.9
範例:--vbv-init 0.9

--qpmin <integer> Set min QP [10]
說明:設定qp的下限,默認爲10
範例:--qpmin 10

--qpmax <integer> Set max QP [51]
說明:設定qp的上限,默認爲51
範例:--qpmax 51

--qpstep <integer> Set max QP step [4]
說明:設定qp的最大步長,默認爲4
範例:--qpstep 4

--ratetol <float> Allowed variance of average bitrate [1.0]
說明:允許最終碼率偏離指定平均碼率的百分比,只在1pass中起作用,默認爲1.0
範例:--ratetol 1.0

--ipratio <float> QP factor between I and P [1.40]
說明:設定I幀相對於P幀的量化比
推薦值:默認
範例:--ipratio 1.40

--pbratio <float> QP factor between P and B [1.30]
說明:設定P幀相對於B幀的量化比
推薦值:默認
範例:--ipratio 1.30

--chroma-qp-offset <integer> QP difference between chroma and luma [0]
說明:chroma 與 luma 的QP差異值,這個值會隨着--psy-rd的使用自動調整爲-2
推薦值:默認
範例:--chroma-qp-offset 0

--aq-mode <integer> AQ method [1]
- 0: Disabled
- 1: Variance AQ (complexity mask)
說明:自適應量化方法,可以改善某些場景過於模糊等問題,默認開啓
- 0: 關閉
- 1: 可變AQ
推薦值:默認
範例:--aq-mode 1

--aq-strength <float> Reduces blocking and blurring in flat and
textured areas. [1.0]
- 0.5: weak AQ
- 1.5: strong AQ
說明:指定AQ的強度
- 0.5: 較弱的AQ
- 1.5: 較強的AQ
推薦值:默認
範例:--aq-strength 1.0

-p, --pass <1|2|3> 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 <string> Filename for 2 pass stats ["x264_2pass.log"]
說明:指定stats文件名,默認爲"x264_2pass.log"
推薦值:默認
範例:--stats "x264_2pass.log"

--cplxblur <float> Reduce fluctuations in QP (before curve compression) [20.0]
說明:減小QP的波動(在曲線壓縮以前),範圍0~999
推薦值:默認
範例:--cplxblur 20

--qblur <float> Reduce fluctuations in QP (after curve compression) [0.5]
說明:減小QP的波動(曲線壓縮之後),範圍0~99
推薦值:默認
範例:--qblur 0.5

--zones <zone0>/<zone1>/... Tweak the bitrate of some regions of the video
Each zone is of the form
<start frame>,<end frame>,<option>
where <option> is either
q=<integer> (force QP)
or b=<float> (bitrate multiplier)
說明:調整視頻中某一範圍內的碼率
每個區域已以下形式出現
<開始幀>,<結束幀>,<option>
<option> 爲下面任意一個
q=<integer> (強制 QP)
或 b=<float> (指定bitrate)
範例:--zone 0,1000,qp=30/30000,32000,b=0.5

--qpfile <string> Force frametypes and QPs
說明:強制指定幀類型與QP
推薦值:默認

 

Analysis:
分析:
-A, --partitions <string> 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 <string> Direct MV prediction mode ["spatial"]
- none, spatial, temporal, auto
說明:Direct預測方法,默認"spatial"
- none, spatial, temporal, auto
推薦值:"auto"
範例:--direct "auto"

--direct-8x8 <-1|0|1> 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 for B-frames
說明:允許對B幀進行加權預測
範例:--weightb

--me <string> 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 <integer> Maximum motion vector search range [16]
說明:最大動態矢量搜索範圍,結合--me使用,對於dia與hex,允許的範圍爲4~16,umh以上可以超過16,值越大編碼速度越慢,默認爲16
範例:--merange 16

--mvrange <integer> Maximum motion vector length [-1 (auto)]
說明:最大動態矢量長度
推薦值:默認
範例:--mvrange -1

--mvrange-thread <int> Minimum buffer between threads [-1 (auto)]
說明:線程之間的最小緩衝區大小
推薦值:默認
範例:--mvrange-thread -1

-m, --subme <integer> 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 <integer> 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 coefficient thresholding on P-frames
說明:關閉P幀的係數閥值,默認不使用
推薦值:默認
範例:--no-dct-decimate

--nr <integer> Noise reduction [0]
說明:降噪,默認0
推薦值:默認
範例:--nr 0

 

--deadzone-inter <int> Set the size of the inter luma quantization deadzo
ne [21]
--deadzone-intra <int> Set the size of the intra luma quantization deadzo
ne [11]
Deadzones should be in the range 0 - 32.
說明:設定inter/intra luma deadzone 量化值的大小,範圍0 - 32
推薦值:默認
範例:--deadzone-inter 21 --deadzone-intra 11

--cqm <string> Preset quant matrices ["flat"]
- jvt, flat
說明:預設量化矩陣 - jvt, flat
推薦值:默認
範例:--cqm "flat"


--cqmfile <string> Read custom quant matrices from a JM-compatible file
Overrides any other --cqm* options.
說明:讀取自定義JM兼容的量化矩陣文件,無視任何以--cqm開頭的參數
範例:--cqm "mycqm"



--cqm4 <list> 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 <list> Set all 8x8 quant matrices
Takes a comma-separated list of 64 integers.
說明:設定所有8x8量化矩陣,它是一張以逗號分割的64個整數的表
範例:參考--cqm4

--cqm4i, --cqm4p, --cqm8i, --cqm8p
Set both luma and chroma quant matrices
說明:設定luma與chroma的量化矩陣
範例:參考--cqm4

--cqm4iy, --cqm4ic, --cqm4py, --cqm4pc
Set individual quant matrices
說明:單獨設定量化矩陣
範例:參考--cqm4
Video Usability Info (Annex E):
The VUI settings are not used by the encoder but are merely suggestions to
the playback equipment. See doc/vui.txt for details. Use at your own risk.
視頻可用性信息:
VUI設置在編碼的時候不會用到,它僅僅作用於回放設備。詳情查看doc/vui.txt.由此帶來的風險由使用者自己承擔.

--overscan <string> Specify crop overscan setting ["undef"]
- undef, show, crop
說明:指定切邊過掃描設定,默認"undef"
- undef, show, crop

範例:--overscan "undef"

--videoformat <string> Specify video format ["undef"]
- component, pal, ntsc, secam, mac, undef
說明:指定視頻格式,默認"undef"
- component, pal, ntsc, secam, mac, undef

範例:--videoformat "undef"

--fullrange <string> Specify full range samples setting ["off"]
- off, on
說明:指定顏色全範圍樣本設置,默認"off"
- off,on

範例:--fullrange "off"

--colorprim <string> Specify color primaries ["undef"]
- undef, bt709, bt470m, bt470bg
smpte170m, smpte240m, film
說明:指定原色,默認"undef"
- undef, bt709, bt470m, bt470bg
smpte170m, smpte240m, film

範例:--colorprim "bt470bg"

--transfer <string> Specify transfer characteristics ["undef"]
- undef, bt709, bt470m, bt470bg, linear,
log100, log316, smpte170m, smpte240m
說明:指定轉換特徵,默認"undef"
- undef, bt709, bt470m, bt470bg, linear,

log100, log316, smpte170m, smpte240m

範例:--transfer "undef"

--colormatrix <string> Specify color matrix setting ["undef"]
- undef, bt709, fcc, bt470bg
smpte170m, smpte240m, GBR, YCgCo
說明:指定顏色矩陣,默認"undef"
- undef, bt709, bt470m, bt470bg, linear,
log100, log316, smpte170m, smpte240m

範例:--colormatrix "undef"

--chromaloc <integer> Specify chroma sample location (0 to 5) [0]
說明:指定chroma sample location,源爲mpeg2與mpeg4時保持默認,源爲mpeg1時設爲1,範圍爲0~5,默認 0
範例:--chromaloc 0

 

Input/Output:
輸入/輸出:

-o, --output Specify output file
說明:指定輸出文件
範例:--output output.mp4

--sar width:height Specify Sample Aspect Ratio
說明:指定sar,sar的詳細解釋看這裏
http://www.sonature.com.cn/thread-572-1-1.html
範例:--sar 40:33

--fps <float|rational> Specify framerate
說明:指定視頻的幀率
推薦值:默認
範例:--fps 29.97

--seek <integer> First frame to encode
說明:指定編碼起始幀,此幀之前的幀將被拋棄
範例:--seek 100

--frames <integer> Maximum number of frames to encode
說明:指定編碼總幀數
範例:--frames 200

--level <string> Specify level (as defined by Annex A)
說明:指定level,如無特別需要,儘量讓level處於4.1以下
範例:--level 4.1

-v, --verbose Print stats for each frame
說明:顯示所有幀的狀態
範例:--verbose

--progress Show a progress indicator while encoding
說明:編碼時顯示進度條
範例:--progress

--quiet Quiet Mode
說明:安靜模式
範例:--quiet

--no-psnr Disable PSNR computation
說明:不計算PSNR
範例:--no-psnr

--no-ssim Disable SSIM computation
說明:不計算SSIM
範例:--no-ssim

--threads <integer> Parallel encoding
說明:指定編碼線程數
範例:--threads 8

--thread-input Run Avisynth in its own thread
說明:在單獨線程上運行AVS
範例:--thread-input

--non-deterministic Slightly improve quality of SMP, at the cost of repeatability
說明:略微提升SMP質量
範例:--non-deterministic

--asm <integer> Override CPU detection
說明:覆蓋CPU檢測數據
範例:--asm 120

--no-asm Disable all CPU optimizations
說明:不使用所有CPU優化參數
範例:--no-asm

--visualize Show MB types overlayed on the encoded video
說明:顯示編碼視頻的宏塊類型
範例:--visualize

--dump-yuv <string> Save reconstructed frames
說明:保存重建的幀
範例:--dump-yuv "文件名"

--sps-id <integer> Set SPS and PPS id numbers [0]
說明:設定SPS與PPS ID號
範例:--sps-id 0

--aud Use access unit delimiters
說明:使用訪問單元限定符
範例:--aud





 

athrunz 2009-05-02 08:15

回覆: 【原創】x264 cli參數簡析
 
Frame-type options:
幀-類型選項:

-I, --keyint <integer> Maximum GOP size [250]
說明:指定兩個IDR幀之間的最大間隔,默認250
推薦值:默認或者FPS的10倍
範例:--keyint 300
注:[250]代表默認值爲250
提示:若想使用默認值,不使用參數即可

-i, --min-keyint <integer> Minimum GOP size [25]
說明:指定兩個IDR幀之間的最小間隔,默認25
推薦值:默認或者FPS的大小
範例:--min-keyint 30

問題:如何查看FPS?
http://mediainfo.sourceforge.net/zh-CN
去上面的網站下載mediainfo查看

--scenecut <integer> 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 <integer> 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 <integer> 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 <integer> 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 <alpha:beta> 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

 

athrunz 2009-05-02 08:15

回覆: 【原創】x264 cli參數簡析
 
Ratecontrol:
壓縮比控制:

-q, --qp <integer> Set QP (0=lossless) [26]
說明:固定量化模式,值越小質量越好,默認爲26qp = crf + --qcomp 1
推薦值:使用crf,見crf部分
範例:--qp 26

-B, --bitrate <integer> Set bitrate (kbit/s)
說明:目標碼率模式,生成的視頻碼率大小爲指定的bitrate的值,一般搭配--pass使用
推薦值:720P以下碼率爲800-2100kbps之間,720P爲3-6Mbps,1080P爲8-15Mbps以上
範例:--bitrate 1000

--crf <float> Quality-based VBR (nominal QP)
說明:固定壓縮因子模式,值越小質量越好,一般搭配--qcomp使用
推薦值:16-26
範例:--crf 26

--qcomp <float> QP curve compression: 0.0 => CBR, 1.0 => CQP [0.60]
說明:壓縮曲線,範圍爲0~1之間,數值越小曲線越平坦,與crf搭配使用,默認爲0.6
推薦值:默認
範例:--qcomp 0.6

--vbv-maxrate <integer> Max local bitrate (kbit/s) [0]
說明:設定VBV模式的最大碼率,如果需要硬解必須開啓VBV模式,默認爲0
範例:--vbv-maxrate 50000

--vbv-bufsize <integer> Enable CBR and set size of the VBV buffer (kbit) [0]
說明:設定VBV緩衝區的最大尺寸,其大小一般由硬件設備決定,默認爲0
範例:--vbv-bufsize 50000

--vbv-init <float> Initial VBV buffer occupancy [0.9]
說明:設定VBV緩衝區的初始填充尺寸,默認爲0.9
範例:--vbv-init 0.9

--qpmin <integer> Set min QP [10]
說明:設定qp的下限,默認爲10
範例:--qpmin 10

--qpmax <integer> Set max QP [51]
說明:設定qp的上限,默認爲51
範例:--qpmax 51

--qpstep <integer> Set max QP step [4]
說明:設定qp的最大步長,默認爲4
範例:--qpstep 4

--ratetol <float> Allowed variance of average bitrate [1.0]
說明:允許最終碼率偏離指定平均碼率的百分比,只在1pass中起作用,默認爲1.0
範例:--ratetol 1.0

--ipratio <float> QP factor between I and P [1.40]
說明:設定I幀相對於P幀的量化比
推薦值:默認
範例:--ipratio 1.40

--pbratio <float> QP factor between P and B [1.30]
說明:設定P幀相對於B幀的量化比
推薦值:默認
範例:--ipratio 1.30

--chroma-qp-offset <integer> QP difference between chroma and luma [0]
說明:chroma 與 luma 的QP差異值,這個值會隨着--psy-rd的使用自動調整爲-2
推薦值:默認
範例:--chroma-qp-offset 0

--aq-mode <integer> AQ method [1]
- 0: Disabled
- 1: Variance AQ (complexity mask)
說明:自適應量化方法,可以改善某些場景過於模糊等問題,默認開啓
- 0: 關閉
- 1: 可變AQ
推薦值:默認
範例:--aq-mode 1

--aq-strength <float> Reduces blocking and blurring in flat and
textured areas. [1.0]
- 0.5: weak AQ
- 1.5: strong AQ
說明:指定AQ的強度
- 0.5: 較弱的AQ
- 1.5: 較強的AQ
推薦值:默認
範例:--aq-strength 1.0

-p, --pass <1|2|3> 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 <string> Filename for 2 pass stats ["x264_2pass.log"]
說明:指定stats文件名,默認爲"x264_2pass.log"
推薦值:默認
範例:--stats "x264_2pass.log"

--cplxblur <float> Reduce fluctuations in QP (before curve compression) [20.0]
說明:減小QP的波動(在曲線壓縮以前),範圍0~999
推薦值:默認
範例:--cplxblur 20

--qblur <float> Reduce fluctuations in QP (after curve compression) [0.5]
說明:減小QP的波動(曲線壓縮之後),範圍0~99
推薦值:默認
範例:--qblur 0.5

--zones <zone0>/<zone1>/... Tweak the bitrate of some regions of the video
Each zone is of the form
<start frame>,<end frame>,<option>
where <option> is either
q=<integer> (force QP)
or b=<float> (bitrate multiplier)
說明:調整視頻中某一範圍內的碼率
每個區域已以下形式出現
<開始幀>,<結束幀>,<option>
<option> 爲下面任意一個
q=<integer> (強制 QP)
或 b=<float> (指定bitrate)
範例:--zone 0,1000,qp=30/30000,32000,b=0.5

--qpfile <string> Force frametypes and QPs
說明:強制指定幀類型與QP
推薦值:默認

 

athrunz 2009-05-02 08:16

回覆: 【原創】x264 cli參數簡析
 
Analysis:
分析:
-A, --partitions <string> 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 <string> Direct MV prediction mode ["spatial"]
- none, spatial, temporal, auto
說明:Direct預測方法,默認"spatial"
- none, spatial, temporal, auto
推薦值:"auto"
範例:--direct "auto"

--direct-8x8 <-1|0|1> 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 for B-frames
說明:允許對B幀進行加權預測
範例:--weightb

--me <string> 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 <integer> Maximum motion vector search range [16]
說明:最大動態矢量搜索範圍,結合--me使用,對於dia與hex,允許的範圍爲4~16,umh以上可以超過16,值越大編碼速度越慢,默認爲16
範例:--merange 16

--mvrange <integer> Maximum motion vector length [-1 (auto)]
說明:最大動態矢量長度
推薦值:默認
範例:--mvrange -1

--mvrange-thread <int> Minimum buffer between threads [-1 (auto)]
說明:線程之間的最小緩衝區大小
推薦值:默認
範例:--mvrange-thread -1

-m, --subme <integer> 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 <integer> 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 coefficient thresholding on P-frames
說明:關閉P幀的係數閥值,默認不使用
推薦值:默認
範例:--no-dct-decimate

--nr <integer> Noise reduction [0]
說明:降噪,默認0
推薦值:默認
範例:--nr 0

 

athrunz 2009-05-02 08:16

回覆: 【原創】x264 cli參數簡析
 
--deadzone-inter <int> Set the size of the inter luma quantization deadzo
ne [21]
--deadzone-intra <int> Set the size of the intra luma quantization deadzo
ne [11]
Deadzones should be in the range 0 - 32.
說明:設定inter/intra luma deadzone 量化值的大小,範圍0 - 32
推薦值:默認
範例:--deadzone-inter 21 --deadzone-intra 11

--cqm <string> Preset quant matrices ["flat"]
- jvt, flat
說明:預設量化矩陣 - jvt, flat
推薦值:默認
範例:--cqm "flat"


--cqmfile <string> Read custom quant matrices from a JM-compatible file
Overrides any other --cqm* options.
說明:讀取自定義JM兼容的量化矩陣文件,無視任何以--cqm開頭的參數
範例:--cqm "mycqm"



--cqm4 <list> 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 <list> Set all 8x8 quant matrices
Takes a comma-separated list of 64 integers.
說明:設定所有8x8量化矩陣,它是一張以逗號分割的64個整數的表
範例:參考--cqm4

--cqm4i, --cqm4p, --cqm8i, --cqm8p
Set both luma and chroma quant matrices
說明:設定luma與chroma的量化矩陣
範例:參考--cqm4

--cqm4iy, --cqm4ic, --cqm4py, --cqm4pc
Set individual quant matrices
說明:單獨設定量化矩陣
範例:參考--cqm4
Video Usability Info (Annex E):
The VUI settings are not used by the encoder but are merely suggestions to
the playback equipment. See doc/vui.txt for details. Use at your own risk.
視頻可用性信息:
VUI設置在編碼的時候不會用到,它僅僅作用於回放設備。詳情查看doc/vui.txt.由此帶來的風險由使用者自己承擔.

--overscan <string> Specify crop overscan setting ["undef"]
- undef, show, crop
說明:指定切邊過掃描設定,默認"undef"
- undef, show, crop

範例:--overscan "undef"

--videoformat <string> Specify video format ["undef"]
- component, pal, ntsc, secam, mac, undef
說明:指定視頻格式,默認"undef"
- component, pal, ntsc, secam, mac, undef

範例:--videoformat "undef"

--fullrange <string> Specify full range samples setting ["off"]
- off, on
說明:指定顏色全範圍樣本設置,默認"off"
- off,on

範例:--fullrange "off"

--colorprim <string> Specify color primaries ["undef"]
- undef, bt709, bt470m, bt470bg
smpte170m, smpte240m, film
說明:指定原色,默認"undef"
- undef, bt709, bt470m, bt470bg
smpte170m, smpte240m, film

範例:--colorprim "bt470bg"

--transfer <string> Specify transfer characteristics ["undef"]
- undef, bt709, bt470m, bt470bg, linear,
log100, log316, smpte170m, smpte240m
說明:指定轉換特徵,默認"undef"
- undef, bt709, bt470m, bt470bg, linear,

log100, log316, smpte170m, smpte240m

範例:--transfer "undef"

--colormatrix <string> Specify color matrix setting ["undef"]
- undef, bt709, fcc, bt470bg
smpte170m, smpte240m, GBR, YCgCo
說明:指定顏色矩陣,默認"undef"
- undef, bt709, bt470m, bt470bg, linear,
log100, log316, smpte170m, smpte240m

範例:--colormatrix "undef"

--chromaloc <integer> Specify chroma sample location (0 to 5) [0]
說明:指定chroma sample location,源爲mpeg2與mpeg4時保持默認,源爲mpeg1時設爲1,範圍爲0~5,默認 0
範例:--chromaloc 0

 

athrunz 2009-05-02 08:16

回覆: 【原創】x264 cli參數簡析
 
Input/Output:
輸入/輸出:

-o, --output Specify output file
說明:指定輸出文件
範例:--output output.mp4

--sar width:height Specify Sample Aspect Ratio
說明:指定sar,sar的詳細解釋看這裏
http://www.sonature.com.cn/thread-572-1-1.html
範例:--sar 40:33

--fps <float|rational> Specify framerate
說明:指定視頻的幀率
推薦值:默認
範例:--fps 29.97

--seek <integer> First frame to encode
說明:指定編碼起始幀,此幀之前的幀將被拋棄
範例:--seek 100

--frames <integer> Maximum number of frames to encode
說明:指定編碼總幀數
範例:--frames 200

--level <string> Specify level (as defined by Annex A)
說明:指定level,如無特別需要,儘量讓level處於4.1以下
範例:--level 4.1

-v, --verbose Print stats for each frame
說明:顯示所有幀的狀態
範例:--verbose

--progress Show a progress indicator while encoding
說明:編碼時顯示進度條
範例:--progress

--quiet Quiet Mode
說明:安靜模式
範例:--quiet

--no-psnr Disable PSNR computation
說明:不計算PSNR
範例:--no-psnr

--no-ssim Disable SSIM computation
說明:不計算SSIM
範例:--no-ssim

--threads <integer> Parallel encoding
說明:指定編碼線程數
範例:--threads 8

--thread-input Run Avisynth in its own thread
說明:在單獨線程上運行AVS
範例:--thread-input

--non-deterministic Slightly improve quality of SMP, at the cost of repeatability
說明:略微提升SMP質量
範例:--non-deterministic

--asm <integer> Override CPU detection
說明:覆蓋CPU檢測數據
範例:--asm 120

--no-asm Disable all CPU optimizations
說明:不使用所有CPU優化參數
範例:--no-asm

--visualize Show MB types overlayed on the encoded video
說明:顯示編碼視頻的宏塊類型
範例:--visualize

--dump-yuv <string> Save reconstructed frames
說明:保存重建的幀
範例:--dump-yuv "文件名"

--sps-id <integer> Set SPS and PPS id numbers [0]
說明:設定SPS與PPS ID號
範例:--sps-id 0

--aud Use access unit delimiters
說明:使用訪問單元限定符
範例:--aud

 

gswudi 2009-05-02 21:17

回覆: 【原創】x264 cli參數簡析
 
改個顏色吧。這個色真刺眼, 我不信有人能堅持看完。

 

athrunz 2009-05-02 23:07

回覆: 【原創】x264 cli參數簡析
 
那得請高手大人自行寫一篇了,那時候你愛哪個顏色就哪個顏色

 

gswudi 2009-05-03 07:54

回覆: 【原創】x264 cli參數簡析
 
引用:

作者: athrunz
那得請高手大人自行寫一篇了,那時候你愛哪個顏色就哪個顏色


無語,你什麼邏輯啊。不說了。只是給個建議讓改個色。搞的好像NB哄哄一樣。又不關我事。

 

yeyunlong 2009-05-08 20:16

回覆: 【原創】x264 cli參數簡析
 
不錯 看過的最詳細的一篇

--pre-scenecut Faster, less precise scenecut detection.
Required and implied by multi-threading.

說明:效果同scenecut,速度比scenecut快,但是精度稍低,默認設定爲當threads>1時,永遠使用--pre-scenecut
推薦值:默認


r1120
Date:Wed 2009.03.04

Remove pre-scenecut from fprofile commands as well

其實可以稍微更新下.......


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章