基本語法:php
x264 [options]-o outfile infile
注意與ffmpeg的輸入輸出文件位置剛好相反:html
ffmpeg[options][[infile options]-i infile]... {[outfile options] outfile}…
x264.exe NUL C:\input.avs x264 /dev/null ~/input.y4m--output--output
當輸入視頻是原始YUV時,還必須指明分辨率。你可能也要使用--fps
來指定幀率:react
x264.exe NUL 25 1280x720 D:\input.yuv x264 /dev/null 30000/1001 640x480 ~/input.yuv --output--fps--input-res--output--fps--input-res
爲了減小使用者花費時間和精力在命令行上而設計的一套系統。ios
默認值: not setgit
Limit the profile of the output stream. If you specify a profile, it overrides all other settings, so if you use it, you will be guaranteed a compatible stream. If you set this option, you cannot use lossless encoding (--qp
0 or --crf
0).web
You should set this if you know your playback device only supports a certain profile. Most decoders support High profile, so there's no need to set this.redis
Values available: baseline, main, high, high10, high422, high444
.算法
限制輸出流的profile。這個參數將覆蓋其它的設定,此選項能保證輸出profile兼容的視頻流。若是使用了這個選項,將不能進行無損壓縮。api
若是播放裝置僅支援某個profile,則應該設此選項。大多數解碼器都支援High profile,因此沒有設定的必要。promise
建議:不設置。除非解碼環境只支持main或者baseline profile的解碼。
默認值: medium
Change options to trade off compression efficiency against encoding speed. If you specify a preset, the changes it makes will be applied before all other parameters are applied.
You should generally set this option to the slowest you can bear.
Values available: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo
.
變動選項,以權衡壓縮效率和編碼速度。若是指定了preset,它會在其它選項生效前生效。
一般應該將此選項設爲可接受的最慢值。
默認值: 無
Tune options to further optimize them for your input content. If you specify a tuning, the changes will be applied after --preset
but before all other parameters.
If your source content matches one of the available tunings you can use this, otherwise leave unset.
Values available: film, animation, grain, stillimage, psnr, ssim, fastdecode, zerolatency
.
在上一個選項基礎上進一步優化輸入。若是指定了一個tune值,它將在preset以後,其它選項以前生效。
建議:根據輸入進行選擇,若是視頻的內容符合其中一個值,則可使用此選項,若是沒有合適的就不要指定。
默認值: Not Set
Using --pass
1 applies the following settings at the end of parsing the command line:
--ref
1--no-8x8dct
--partitions
i4x4 (if originally enabled, else none)--me
dia--subme
MIN( 2, subme )--trellis
0使用--pass 1會在解析命令列的最後增長以上設置。
You can set --slow-firstpass
to disable this.
Note: --preset
placebo
enables --slow-firstpass
.
使用--preset
placebo
也會啓用--slow-firstpass
.。
See also: --pass
.
默認值: 250
Sets the maximum interval between IDR-frames (又叫作keyframes) in x264's output. You can specify "infinite" to never insert non-scenecut IDR-frames.
IDR-frames are 'delimiters' in the stream - no frame can reference data from the other side of the IDR-frame. As well as this, IDR-frames are also I-frames, so they don't reference data from any other frame. This means they can be used as seek points in a video.
Note that I-frames are generally significantly larger than P/B-frames (often 10x or more in low motion scenes), so they can play havoc with ratecontrol when combined with aggressively low VBV settings (eg, sub-second buffer sizes). In these cases, investigate --intra-refresh
.
The default setting is fine for most videos. When encoding for Blu-ray, broadcast, live streaming or certain other specialist scenarios you may require a significantly smaller GOP length (often ~1x fps).
設置x264輸出中的最大IDR幀(亦稱關鍵幀)間距。能夠指定infinite讓x264永遠不要插入非場景變動的IDR幀。
IDR幀是視頻流的「分隔符」,全部幀都不可使用越過關鍵幀的幀做爲參考幀。IDR幀是I幀的一種,它們不參照其它幀。這意味着它們能夠做爲視頻的搜索(seek)點。
I幀一般明顯大於P/B幀(在低動態場景一般爲10倍大或更多),因此當它們與極低的VBV設定合併使用時會打亂碼率控制。在這些狀況下,請研究--intra-refresh。
這個選項能夠設置IDR幀的最大間隔幀數(亦稱最大圖像組長度GOP)。較大的值將致使IDR幀減小(會用佔用空間更少的P幀和B幀取代),也就同時減弱了參照幀選擇的限制。較小的值致使減小搜索一個隨機幀所需的平均時間。
建議:默認值(fps的10倍)對大多數視頻都很好。若是在爲藍光、廣播、直播流或者其它什麼專業流編碼,可能須要更小的GOP長度(一般等於幀率)。
See also: --min-keyint
, --scenecut
, --intra-refresh
默認值: auto (MIN(--keyint
/ 10,--fps
))
Sets the minimum length between IDR-frames.
See --keyint
for an explanation of IDR-frames. Very small keyint ranges can cause "incorrect" IDR-frame placement (for example, a strobing scene). This option limits the minimum length in frames after each IDR-frame before another can be placed.
The maximum allowed value for min-keyint is --keyint
/2+1
建議: Default, or 1x your framerate.
設定IDR幀之間的最小長度。太小的keyint範圍會致使「不正確的」IDR幀位置(例如閃屏場景)。此選項限制了IDR幀之間的最小距離。
min-keyint容許的最大值是--keyint
/2+1。
建議:默認值,或者等於幀率
See also: --keyint
, --scenecut
默認值: Not Set
Completely disables adaptive I-frame decision.徹底關閉自適應I幀決策
See also: --scenecut
默認值: 40
Sets the threshold for I/IDR frame placement (read: scene change detection).
x264 calculates a metric for every frame to estimate how different it is from the previous frame. If the value is lower than scenecut, a 'scenecut' is detected. An I-frame is placed if it has been less than --min-keyint
frames since the last IDR-frame, otherwise an IDR-frame is placed. Higher values of scenecut increase the number of scenecuts detected. For more information on how the scenecut comparison works, see http://forum.doom9.org/showthread.php?t=121116.
Setting scenecut to 0 is equivalent to setting --no-scenecut
.
建議: Default
設置使用I幀、IDR幀的閾值(場景變換檢測)。
x264爲每一幀計算一個度量值,來估計與前一幀的不一樣程度。若是該值低於scenecut,那麼就算檢測到一個「場景變換」。若是此時與前一個IDR幀的距離低於--min-keyint則插入一個I幀,不然放置一個IDR幀。越大的scenecut值會增長偵測到場景變動的次數。
See also: --keyint
, --min-keyint
, --no-scenecut
默認值: Off
Disables IDR-frames, instead x264 uses intra coding for each macroblock in the frame every --keyint
frames. Blocks are refreshed in a horizontally scrolling column - the 'refresh wave'. This benefits low-latency streaming by making it possible to achieve more constant frame sizes than is possible with standard IDR-frames. It also increases the resilience of the video stream to packet loss. This option does reduce compression efficiency, hence only use it when needed.
Fun facts:
停用IDR幀,做爲替代x264會爲每隔keyint數量的幀使用宏塊內部編碼。區塊是以一個水平捲動的行刷新,稱爲刷新波。這有利於低延遲的流,使它有可能比標準的IDR幀達到更加固定的幀大小。它也加強了視頻流對丟包的恢復能力。此選項會下降壓縮效率,所以必要時才使用。
有趣的事:
默認值: 3
Sets the maximum number of concurrent B-frames that x264 can use.
Without B-frames, a typical x264 stream has frame types like so: IPPPPP...PI. With --bframes 2, up to two consecutive P-frames can be replaced with B-frames, like: IBPBBPBPPPB...PI.
B-frames are similar to P-frames, except they can use motion prediction from future frames as well. This can lead to significantly better efficiency in terms of compression ratio. Their average quality is controlled by --pbratio
.
Fun facts:
--b-pyramid
, while 'b' can refer to a B-frame that is not. If you see a mix of 'B' and 'b', it's usually related to the above. When the difference is not important, just 'B' is generally used to refer to all B-frames.設置x264可以使用的B幀的最大連續數量。
沒有B幀時,一個典型的x264流幀類型是這樣的:IPPPPP…PI。若是設置了-bframes 2,那麼兩個連續的P幀就能夠用B幀替換,就像這樣:IBPBBPBPPPB…PI。
B幀和P幀的區別在於它能夠參照它以後的幀,這個特色讓它能夠顯著地提高壓縮率。他們的平均品質受 –pbratio選項的控制。
有趣的事:
See also: --no-b-adapt
, --b-bias
, --b-pyramid
, --ref
, --pbratio
, --partitions
, --weightb
默認值: 1
Set the adaptive B-frame placement decision algorithm. This setting controls how x264 decides between placing a P- or B-frame.
no-b-adapt
setting did.
--b-frames
setting. When using this mode, you basically always want to use
--bframes
16.
--b-frames
setting.
Note: For a multi-pass encode, this option is only needed for the first pass where frame types are decided.
設置B幀決策算法,此選項控制x264如何放置P幀或B幀。
注意:多遍編碼時,只有第一趟編碼(first pass)才須要此選項,由於第一趟編碼結束時,幀類型就已經被決定了
默認值: 0
Controls the likelihood of B-frames being used instead of P-frames. Values greater than 0 increase the weighting towards B-frames, while values less than 0 do the opposite. This number is an arbitrary metric. The range is from -100 to 100. A value of 100/-100 does not guarantee every/no P-frame will be converted (use --b-adapt
0 for that).
Only use this if you think you make better ratecontrol decisions than x264.
控制使用B幀而不使用P幀的可能性。大於0的值增長偏向B幀的加權,而小於0的值則相反。此值是一個任意計量。範圍從-100到100。100並不保證全是B幀(要全是B幀該使用--b-adapt 0),而-100也不保證全是P幀。
請只在你認爲你能作出比x264更好的碼率控制時才使用這個選項。
See also: --b-frames
, --ipratio
默認值: normal
Allow the use of B-frames as references for other frames. Without this setting, frames can only reference I- or P-frames. Although I/P-frames are more valued as references because of their higher quality, B-frames can also be useful. B-frames designated as references will get a quantizer halfway between P-frames and normal B-frames. You need to use at least two B-frames before B-pyramid will work.
If you're encoding for Blu-ray, use 'none' or 'strict'.
容許B幀做爲其餘幀的參照幀。沒有此設定時,幀只能參照I/P幀。雖然I/P幀因其較高的品質做爲參照幀更有價值,但B幀也是頗有用的。做爲參照幀的B幀會獲得一個介於P幀和普通B幀之間的量化值。只有在--bframes設置大於等於2時此選項才生效。
若是是在爲藍光編碼,須使用none或strict。
See also: --bframes
, --refs
, --no-mixed-refs
默認值: none
Open-GOP is an encoding technique which increases efficiency. Some decoders don't fully support open-GOP streams, which is why it hasn't been enabled by default. You should test with all decoders your streams will be played on, or (if that's impossible) wait until support is generally available.
open-gop的說明能夠參閱http://forum.doom9.org/showthread.php?p=1300124#post1300124
Open-GOP是一個提高壓縮效率的編碼技術。某些解碼器不徹底支持open-gop流,這也是爲何它默認沒有啓用的緣由。你應該測試全部可能用來播放此流的解碼器。
默認值: Not set
Disables CABAC (Context Adaptive Binary Arithmetic Coder) stream compression and falls back to the less efficient CAVLC (Context Adaptive Variable Length Coder) system. Significantly reduces both the compression efficiency (10-20% typically) and the decoding requirements.
關閉CABAC (Context Adaptive Binary Arithmetic Coder)壓縮,使用較爲低效的CAVLC (Context Adaptive Variable Length Coder)。大幅下降壓縮效率(一般10~20%)和解碼的硬件需求。
默認值: 3
Controls the size of the DPB (Decoded Picture Buffer). The range is from 0-16. In short, this value is the number of previous frames each P-frame can use as references. (B-frames can use one or two fewer, depending on if they are used as references or not.) The minimum number of refs that can be referenced is 1.
Also note that the H.264 spec limits DPB size for each level. If adhering to Level 4.1 specs, the maximum refs for 720p and 1080p video are 9 and 4 respectively. You can read more about levels and 4.1 in particular under --level
.
控制解碼圖片緩衝(DPB:Decoded Picture Buffer)的大小。範圍是從0到16。總之,此值設置每一個P幀能夠選擇它以前的多少幀做爲參照幀(B幀可使用的數目要少一或兩個,取決於它們是否做爲參照幀)。能夠被參照的最小ref數是1,即只參照本身前面的那幀。
須要注意的是,H.264規格限制了每一個level的DPB大小。若是遵照Level 4.1規格,720p和1080p視頻的最大ref數分別是9和4。
See also: --b-pyramid
, --no-mixed-refs
, --level
默認值: Not Set
Completely disables the loop filter. Not Recommended.徹底停用循環濾鏡。不建議。
See Also: --deblock
默認值: 0:0
Controls the loop filter (aka inloop deblocker), which is part of the H.264 standard. It is very efficient in terms of encoding time vs. quality gained.
You can find a good description of how the loop filter parameters work in this doom9 thread (看樓主和akupenguin的回覆).
控制循環濾鏡(亦稱爲內置去塊濾鏡),這是H.264標準的一部分。是個性價比很高的選項。
See Also: --no-deblock
默認值: 0
Sets the number of slices per frame, and forces rectangular slices. (Overridden by either --slice-max-size
or --slice-max-mbs
if they are set.)
If you are encoding for Blu-ray, set this to four. Otherwise, don't use this unless you know you need to.
設置每幀的分片數,而且強制爲矩形切片。
若是是在爲藍光編碼,將值設爲4。不然,不要使用此選項,除非你肯定真的有必要。。
See Also: --slice-max-size
, --slice-max-mbs
.
默認值: 0
Sets the maximum slice size in bytes, including estimated NAL overhead. (Currently is not compatible with --interlaced
.)
設定最大的切片大小(單位是字節),包括估計的NAL額外負荷。
See Also: --slices
默認值: 0
Sets the maximum slice size in macroblocks. (Currently is not compatible with --interlaced
.)
設置每一個分片包含的最大宏塊數量。
See Also: --slices
Enable interlaced encoding and specify the top field is first. x264's interlaced encoding uses MBAFF, and is inherently less efficient than progressive encoding. For that reason, you should only encode interlaced if you intend to display the video on an interlaced display (or can't deinterlace the video before sending it to x264). Implies --pic-struct
.
啓用交錯式(隔行)編碼並指定頂場優先。x264的交錯式編碼使用MBAFF,自己效率不如逐行掃描。出於此緣由,僅在須要在隔行顯示的設備上顯示時纔開啓此選項(或是送給x264以前沒法進行反隔行掃描)。此選項會自動啓用--pic-struct。
Enable interlaced encoding and specify the bottom field is first. See --tff
for more info.
Forces x264 to output in progressive mode.
默認值: Not Set
Enable constrained intra prediction, which is required for the base layer of SVC encodes. Since EveryoneTM ignores SVC you can likewise ignore this switch.
啓用限制的內部預測,這是SVC編碼的底層所須要的。既然每一個人都忽略SVC,你也同樣能夠忽略此選項。
默認值: none
Signal soft telecine for your (progressive, constant framerate) input stream using one of a few preset modes. Soft telecine is explained in more detail on the HandBrake wiki. The available presets are: none, 22, 32, 64, double, triple
and euro
.
Specifying any mode but none
implies --pic-struct
.
爲你的輸入流(逐行掃描的,固定幀率的)使用一組預設的「軟性電視模式」。
除了none以外的選項都會自動啓用--pic-struct。
默認值: Not Set
Mark a stream as interlaced even when not encoding as interlaced. Allows encoding of 25p and 30p Blu-ray compliant videos.
把流標誌爲隔行的但不按隔行編碼。用於編碼25p和30p的藍光兼容視頻。
默認值: Not Set
If you're encoding 3d video, this parameter sets a bitstream flag that tells your decoder how the 3d video was packed. The values and what they mean can be found in x264 --fullhelp
.
若是你在編碼3D視頻,此參數設定一個位元流標誌,用來告訴解碼器此3D視頻是如何封裝的。
默認值: Not Set
The first of three possible ratecontrol methods. Set x264 to encode the movie in Constant Quantizer mode. The number you give here specifies the P-frame quantizer. The quantizer used for I- and B-frames is derived from --ipratio
and --pbratio
. CQ mode targets a certain quantizer, which means final filesize is not known (although it can be reasonably accurately estimated with some methods). A setting of 0 will produce lossless output. qp produces larger files than --crf
for the same visual quality. qp mode also disables adaptive quantization, since by definition 'constant quantizer' implies no adaptive quantization.
This option is mutually exclusive with --bitrate
and --crf
. See this article for more information on the various ratecontrol systems.
You should generally use --crf
instead, although qp doesn't require lookahead to run and thus can be faster.
三種碼率控制方法之一。設置x264以固定量化值模式編碼視頻。這裏給的值將被做爲P幀的量化值,I幀和B幀的量化值從ipratio和pbratio參數中取得。CQ模式把某個特定量化值做爲目標,這意味着最終文件大小是未知的(雖然能夠經過一些方法來準確地估計)。設置爲0將產出無損輸出。相同視覺質量時,QP模式產出的文件會比crf模式更大。QP模式將關閉自適應量化器,由於按照定義「固定量化值」意味着沒有彈性量化。
這個選項和 bitrate和crf是互斥的,三者只能選一個。
通常而言crf都能代替QP模式,不過QP由於徹底不須要預測因此它會運行得更快些。
See also: --bitrate
, --crf
, --ipratio
, --pbratio
默認值: Not Set
The second of three ratecontrol methods. Encode the video in target bitrate mode. Target bitrate mode means the final filesize is known, but the final quality is not. x264 will attempt to encode the video to target the given bitrate as the overall average. The parameter given is the bitrate in kilobits/sec. (8bits = 1byte and so on). Note that 1 kilobit is 1000, not 1024 bits.
This setting is often used in conjunction with --pass
for two-pass encoding.
This option is mutually exclusive with --qp
and --crf
.
三種碼率控制方法之二。設置x264使用固定目標比特率模式來編碼視頻。目固定目標比特率意味着最終的文件大小是可知的,可是目標的質量是不可知的。x264會試圖讓最終文件的總體碼率與給定的碼率相等。參數的單位是kilobits/sec(8bits = 1byte字節)。
一般這個選項與pass選項配合進行2趟編碼。
這個選項和qp和crf是互斥的,三者只能選一個。
See also: --qp
, --crf
, --ratetol
, --pass
, --stats
默認值: 23.0
The final ratecontrol method: Constant Ratefactor. While qp targets a certain quantizer, and bitrate targets a certain filesize, crf targets a certain 'quality'. The idea is for crf n to give the same perceptual quality as qp n, just in a smaller space. The arbitrary unit of measure for crf values is the "ratefactor".
CRF achieves this by reducing the quality of 'less important' frames. In this context, 'less important' means frames in complex or high-motion scenes, where quality is either more expensive (in terms of bits) or less visible, will have their quantizer increased. The bits saved in frames like these are redistributed to frames where they will be more effective.
CRF will take less time than a 2pass bitrate encode, because the 'first pass' from a 2pass encode was skipped. On the other hand, it's impossible to predict the bitrate a CRF encode will come out to. It's up to you to decide which rate-control mode is better for your circumstances.
This option is mutually exclusive with qp and bitrate.
最後一種碼率控制方法:固定碼率係數。qp是把某個量化值做爲目標,bitrate是把某個文件大小做爲目標,而crf則是把某個「品質」做爲目標。crf能夠提供跟QP同樣的視覺質量,可是文件更小。crf值的單位是「碼率係數(ratefactor)」。
crf是經過下降那些「不那麼重要」的幀的質量來達到此目的的。「不那麼重要」的意思是那些過於耗費碼率又難以用肉眼察覺的幀,好比複雜或者高速運行的場景。省下來的碼率會用在其它更有效的幀裏。
crf編碼比2趟編碼快,由於它至關於省略了第1趟編碼。因此crf的最終碼率也是不可預測的。你須要根據具體的應用場景來選擇碼率控制方式。
此選項與--qp和--bitrate互斥。
默認值: 40
Sets the number of frames to use for mb-tree ratecontrol and vbv-lookahead. The maximum allowed value is 250.
For the mb-tree portion of this, increasing the frame count generates better results but is also slower. The maximum buffer value used by mb-tree is the MIN( rc-lookahead, --keyint
)
For the vbv-lookahead portion of this, increasing the frame count generates better stability and accuracy when using vbv. The maximum value used by vbv-lookahead is:
MIN(rc-lookahead, MAX(keyint, MAX(vbv-maxrate, bitrate) / vbv-bufsize * fps))
設定mb-tree碼率率控制和vbv-lookahead可以使用的幀數。最大容許值是250。
對於mb-tree而言,增長幀數會帶來更好的效果但也會更慢。mb-tree使用的最大緩衝值是rc-lookahead和keyint中較小的那一個。
對於vbv-lookahead而言,當使用vbv時,增長幀數會帶來更好的穩定性和準確度。
See Also: --no-mbtree
, --vbv-bufsize
, --vbv-maxrate
, --sync-lookahead
默認值: 0
Sets the maximum rate the VBV buffer should be assumed to refill at.
VBV reduces quality, so you should only use this if you're encoding for a playback scenario that requires it.
設置VBV(Video Buffering Verifier)可用的最大碼率。使用VBV會下降視頻質量,只在真正須要的時候才設定它。
See also: --vbv-bufsize
, --vbv-init
默認值: 0
Sets the size of the VBV buffer in kilobits.
VBV reduces quality, so you should only use this if you're encoding for a playback scenario that requires it.
See also: --vbv-maxrate
, --vbv-init
默認值: 0.9
Sets how full the VBV Buffer must be before playback starts.
If it is less than 1, the the initial fill is: vbv-init * vbv-bufsize
. Otherwise it is interpreted as the initial fill in kbits.
設置在視頻開始播放前VBV緩衝必須填滿多少。
若是值小於1,初始的填滿量是:vbv-init * vbv-bufsize。若是大於1,該值便是初始的填滿量(單位是kbits)。
See also: --vbv-maxrate
, --vbv-bufsize
默認值: Not set
A similar setting to --qpmax
except instead of specifying a maximum quantizer you're specifying a maximum ratefactor. This option only works when you are using CRF and have VBV enabled. It prevents x264 from reducing the ratefactor (aka "quality") below the given value even when doing so would violate VBV constraints. This setting is mostly applicable to custom streaming servers. More information can be found here.
相似--qpmax,除了指定的是最大碼率係數ratefactor而非最大量化值。這個選項僅在crf和vbv同時啓用的時候有效。它阻止x264下降碼率係數(亦稱爲「品質」)到低於給定的值,即便這樣作會違反VBV的條件約束。此設定通常用於自定義的流服務器。
See Also: --crf
, --vbv-maxrate
, --vbv-bufsize
默認值: 0
Defines the minimum quantizer that x264 will ever use. The lower the quantizer, the closer the output is to the input. At some point, the output of x264 will look the same as the input, even though it is not exactly the same. Usually there is no reason to allow x264 to spend more bits than this on any particular macroblock.
With adaptive quantization enabled (the default), raising qpmin is discouraged because this could reduce the quality of flat background areas of the frame.
定義x264可使用的最小量化值。量化值越小,輸出就越接近輸入。到了必定的值,x264的輸出看起來會跟輸入同樣,即便它並不徹底相同。一般沒有理由容許x264花費比這更多的比特數在任何特定的宏塊上。
若是開啓了自適應量化器(默認啓用),不建議提升qpmin的值,由於這會下降幀裏面平滑背景區域的品質。
默認值: 51
The opposite of qpmin, above. Defines the maximum quantizer that x264 can use. The default of 51 is the highest quantizer available for use in the H.264 spec, and is extremely low quality. This default effectively disables qpmax. You may want to set this lower (values in the 30-40 range are generally as low as you'd go) if you want to cap the minimum quality x264 can output, but adjusting it is generally not recommended.
定義x264可使用的最大量化值。默認值51是H.264規格中可供使用的最大量化值,並且品質極低。此默認值51至關於禁用qpmax。若是你想控制x264輸出的最低品質,能夠將此值設小一點(一般在30~40範圍內),但一般並不建議調整此值。
See also: --qpmin
, --pbratio
, --crf-max
默認值: 4
Sets the maximum change in quantizer between two frames.
設定兩幀之間量化值的最大變動幅度。
默認值: 1.0
This is a dual purpose parameter:
--crf
encode, but the filesize will blow out.
這個參數有兩個目的:
不少影片(好比動做片)在電影結尾時十分複雜。但1趟編碼並不知道這一點,結尾所需的比特數一般被低估,每每到最後比特都已經用完了。將ratetol設爲inf能夠減輕這種狀況,它容許編碼器用相似–crf的方式工做,固然,文件大小會暴增。
默認值: 1.40
Modifies the target average increase in quantizer for I-frames as compared to P-frames. Higher values increase the quality of I-frames generated.
修改I幀量化值相比P幀量化值的目標平均增量。更高的值意味着更高的I幀質量
See also: --pbratio
默認值: 1.30
Modifies the target average decrease in quantizer for B-frames as compared to P-frames. Higher values decrease the quality of B-frames generated. Not used with mbtree (enabled by default), which calculates the optimum value automatically.
修改B幀量化值相比P幀量化值的目標平均減量。更高的值意味着更低的B幀質量。當mbtree啓用時(默認啓用),此設定無做用,mbtree會自動計算最佳值。
See also: --ipratio
默認值: 0
Add an offset to the quantizer of chroma planes when encoding. The offset can be negative.
When using psy options are enabled (psy-rd, psy-trellis), x264 automatically subtracts 2 from this value to compensate for these optimisations overly favouring luma detail by default.
Note: x264 only encodes the luma and chroma planes at the same quantizer up to quantizer 29. After this, chroma is progressively quantized by a lower amount than luma until you end with luma at q51 and chroma at q39. This behavior is required by the H.264 standard.
在編碼時增長色度平面量化值的偏移。偏移能夠爲負值。
當開啓 psy-rd或 psy-trellis時,x264會自動將此值再減去2,下降色度的量化參數用於補償亮度。 注意:x264僅在同一量化值編碼亮度平面和色度平面,直到量化值29。在此以後,色度逐步以比亮度低的量進行量化,直到亮度爲q51,色度爲q39爲止。此行爲是由H.264標準所要求。
Adaptive Quantization Mode
默認值: 1
Without AQ, x264 tends to underallocate bits to less-detailed sections. AQ is used to better distribute the available bits between all macroblocks in the video. This setting changes what scope AQ re-arranges bits in:
自適應量化器模式。不使用自適應量化的話,x264趨向於使用較少的bit在缺少細節的場景裏。自適應量化能夠在整個視頻的宏塊裏更好地分配比特。它有如下選項:
See also: --aq-strength
Adaptive Quantization Strength
默認值: 1.0
Sets the strength of AQ bias towards low detail ('flat') macroblocks. Negative values are not allowed. Values outside the range 0.0 - 2.0 are probably a bad idea.
自適應量化強度。
設置自適應量化對於缺少細節(平坦)的宏塊的強度。不容許負值。0.0 – 2.0以外的值不推薦使用。 See also: --aq-mode
默認值: Not Set
This is an important setting for 2pass encoding. It controls what x264 will do with the --stats
file. It has three settings:
The stats file contains information about every input frame, which can be input to x264 in order to improve the output. The idea is you run a first pass to generate the stats file, and the second pass will create an optimized encode of the video. The improvement is mostly gained from better ratecontrol.
這是2趟編碼的一個重要選項。它控制x264如何處理stats指定的文件。有三個設置:
stats文件包含了每一個輸入幀的信息,x264能夠讀取這些信息來改善輸出。你能夠先跑第一趟編碼生成stats文件,而後第二趟編碼就可使用這個文件優化編碼。視頻質量會獲得很大的提高,大部分緣由是由於進行了更好的碼率控制。
See also: --stats
, --bitrate
, --slow-firstpass
默認值: 'x264_2pass.log'
Set the location that x264 will read/write the --pass
to/from.
設置x264讀取和寫入的stats文件名
See also: --pass
默認值: Not Set
Disable macroblock tree ratecontrol. Using macroblock tree ratecontrol overall improves the compression by keeping track of temporal propagation across frames and weighting accordingly. Requires a new large statsfile in addition to the already existing for multipass encodes.
建議: Default
關閉基於宏塊樹的比特控制。基於宏塊樹的比特控制經過持續監控宏塊在幀間的運動和相應權重來改善總體壓縮率。除了已經存在的stats文件,它還會單獨生成一個更大的stats文件。
See Also: --rc-lookahead
默認值: 0.60
Quantizer curve compression factor. 0.0 => Constant Bitrate, 1.0 => Constant Quantizer.
When used with mbtree, it affects the strength of mbtree. (Higher qcomp = weaker mbtree).
建議: Default
量化值曲線壓縮係數。0.0意味着恆定比特率,1.0意味着恆定量化值。
若是開啓了mbtree,這個選項會影響mbtree的強度(更高的qcomp值意味着更弱的mbtree)。
默認值: 20
Apply a gaussian blur with the given radius to the quantizer curve. This means that the quantizer assigned to each frame is blurred temporally with its neighbours to limit quantizer fluctuations.
以給定的半徑範圍套用高斯模糊於量化值曲線。這意味着分配給每一個幀的量化值會被它的鄰近幀模糊掉,以限制量化值的波動。
默認值: 0.5
Apply a gaussian blur with the given radius to the quantizer curve, after curve compression. Not a very important setting.
在量化曲線壓縮後,以給定的半徑範圍套用高斯模糊於量化值曲線。不是一個很重要的選項。
默認值: Not Set
Tweak settings for specific sections of the video. You can modify most x264 options per-zone.
Options:
These two options are special. You can only set one per zone, and if you set one, it must be the first option listed for the zone:
調節視頻的特殊片段。你能夠修改每一個片段的大多數x264選項。
選項:
如下2個選項是特殊選項,每一個zone只能設置其中一個,此選項必須是zone列出來的第一個選項:
The other available options are as follows:
Limitations:
--ref
--me
esa/tesa--me
was originally specified as dia, hex, or umhExample: 0,1000,b=2/1001,2000,q=20,me=3,b-bias=-1000
限制:
建議: Default
Manual override to standard ratecontrol. Specify a file that gives the quantizer and frametype for specified frames. The format is 'framenum frametype quantizer'. For example:
手動改變標準的碼率控制方法。給定一個爲指定的幀賦予量化值和幀類型的文件。格式是’幀序號 幀類型 量化值’
0 I 18 < IDR (key) I-frame 1 P 18 < P-frame 2 B 18 < Referenced B-frame 3 i 18 < Non-IDR (non-key) I-frame 4 b 18 < Non-referenced B-frame 5 K 18 < Keyframe*
--open-gop
is none
, otherwise it equates to a Non-IDR I-Frame flagged with the Recovery Point SEI默認值: 'p8x8,b8x8,i8x8,i4x4'
H.264 video is split up into 16x16 macroblocks during compression. These blocks can be further split up into smaller partitions, which is what this option controls.
With this option, you enable individual partitions. Partitions are enabled per-frametype (i.e., I, P, B). The available partitions are p8x8, p4x4, b8x8, i8x8, and i4x4.
You can also set 'none' or 'all'.
p4x4 is generally not very useful and has an extremely high ratio of speed cost to resulting quality gain.
H.264在壓縮過程當中會被切分爲16×16大小的宏塊。這些塊能夠進一步切分爲更小的塊,這就是此選項要控制的部分。
此選項能夠啓用個別分割。分割能夠依不一樣幀類型(I、P、B)而啓用。
通常而言,開啓p4x4不會帶來多少的質量提高,並且它極其耗時,是個性價比比較低的選項。
See also: --no-8x8dct
默認值: 'spatial'
Set prediction mode for 'direct' motion vectors. There are two modes available: spatial and temporal. You can also select none to disable direct MVs, and auto to allow x264 to swap between them as it sees fit. If you set auto, x264 outputs information on the usage at the end of the encode. 'auto' works best in a 2pass encode, but will work in single-pass encodes too. In first-pass auto mode, x264 keeps a running average of how well each method has so far performed, and picks the next prediction mode from that. Note that you should only enable auto on the second pass if it was enabled on the first pass; if it wasn't, the second pass will default to temporal. Direct none wastes bits and is strongly discouraged.
建議: 'auto'
爲’direct’類型的運動矢量設定預測模式。有兩種模式可用:空間預測時間預測。你也能夠設置爲’none’關閉預測,或者設置爲’auto’讓x264在二者之間切換爲適合的模式。若是設爲auto,x264會在編碼結束時告訴你它的選擇。’auto’最好在2趟編碼中使用,但也能夠在1趟編碼時使用。
在第一階段auto模式,x264持續記錄每一個方法執行到目前爲止的好壞,並從該記錄挑選下一個預測模式。
注意,若是第1趟編碼時選擇了’auto’,那麼第2趟編碼時也必須設置爲’auto’。否則,第2趟編碼會使用’temporal’。none模式會浪費比特數,所以強烈不建議。
默認值: Not Set
H.264 allows you to 'weight' references in B-frames, which allows you to change how much each reference affects the predicted picture. This disables that feature.
建議: Default
H.264容許給可參考B幀加上影響預測圖像的權重,此選項會關閉此特性。
默認值: 2
Enables use of explicit weighted prediction to improve compression in P-frames. Also improves quality in fades. Higher modes are slower.
NOTE: When encoding for Adobe Flash set this to 1 - its decoder generates artifacts otherwise. Flash 10.1 fixes this bug.
Modes:
開啓明確的權重預測以提升P幀壓縮。同時也能改善淡入淡出的品質。越高級的模式越耗時,有如下模式:
注意:在爲Adobe Flash編碼時,請將此值設爲1,不然它的解碼器會產生不天然痕跡。Flash 10.1修正了此bug。
默認值: 'hex'
Set the full-pixel motion estimation method. There are five choices:
設定全像素動態估算方法。有5種選擇:
See also: --merange
默認值: 16
merange controls the max range of the motion search in pixels. For hex and dia, the range is clamped to 4-16, with a default of 16. For umh and esa, it can be increased beyond the default 16 to allow for a wider-range motion search, which is useful on HD footage and for high-motion footage. Note that for umh, esa, and tesa, increasing merange will significantly slow down encoding.
Extremely high merange (e.g. >64) is unlikely to find any new motion vectors that are useful, so it may very slightly decrease compression in some cases by picking motion vector deltas so large that they even worsen prediction of future motion vectors in the rare cases they're locally useful, making them worse than useless.
The effect is so small as to be near-negligible, though, and you shouldn't be using such insane settings.see this post
merange控制運動搜索的最大像素範圍。對於hex和dia,範圍在4-16像素,默認爲16。對於umh和esa,能夠超過默認的16像素進行大範圍的運行搜索,這對HD視頻和高動態鏡頭而言頗有用。注意,對於umh、esa和tesa,增長merange會大幅減慢編碼速度。
極大的merange(如>64)不大可能找到任何有用的動態向量,因此在某些狀況下它可能會輕微地下降壓縮效率。
See also: --me
默認值: -1 (auto)
Set the maximum (vertical) range of any one motion vector in pixels. The default value is level-dependent:
Note: if you want to manually override the mvrange, subtract 0.25 from the above values when setting (eg --mvrange 127.75).
設定動態向量的最大(垂直)範圍(單位是像素)。默認值依level不一樣而不一樣。
注意:若是你想要手動覆寫mvrange,在設定時請從上述值減去0.25(例如--mvrange 127.75)。
建議: Default
默認值: -1 (auto)
Set the minimum motion vector buffer between threads. Don't touch it.
建議: Default
設置線程間運動矢量緩衝區大小的最小值。不要碰這個選項。
默認值: 7
Set the subpixel estimation complexity. Higher numbers are better. Levels 1-5 simply control the subpixel refinement strength. Level 6 enables RDO for mode decision, and level 8 enables RDO for motion vectors and intra prediction modes. RDO levels are significantly slower than the previous levels.
Using a value less than 2 will enable a faster, and lower quality lookahead mode, as well as cause poorer --scenecut
decisions to be made, and thus it is not recommended.
Possible Values:
--trellis
=2,
--aq-mode
> 0)
設定子像素估算複雜度。值越大越好。層級1到5只是控制子像素細分強度。級別6給模式決策開啓RDO(碼率失真優化模式),級別8給運動矢量和幀內預測模式開啓RDO。開啓RDO會比以前的級別更加耗時。
使用小於2的值不但會啓用較快且品質較低的lookahead模式,並且會致使較差的scenecut決策,所以不建議。
建議: Default, or higher, unless speed is very important.
Alias of --subme
默認值: 1.0:0.0
The first number is the strength of Psy-RDO to use (requires subme>=6 to activate). The second number is the strength of Psy-Trellis (requires trellis>=1 to activate). Note that Trellis is still considered 'experimental', and almost certainly is a Bad Thing for at least cartoons.
See this thread on doom9 for an explanation of psy-rd.
Life is short, and this article saved valubale time on this Earth.
第1個數字是psy-RDO的強度(subme大於等於6時激活)。第2個數字是Psy-Trellis的強度(trellis大於等於1時激活)。注意Trellis的特性還是’實驗性’的,至少對於動畫視頻來講它是不適合使用的。
默認值: Not Set
Mixed refs will select refs on a per-8x8 partition, rather than per-macroblock basis. This improves quality when using multiple reference frames, albeit at some speed cost. Setting this option will disable it.
建議: Default
混合參照會以每一個8x8分割爲基礎來選取參照,而不是以每一個宏區塊爲基礎。當使用多個參照幀時這會改善品質,但要損失一些速度。設定此選項會停用該功能。
See also: --ref
默認值: Not Set
Normally, motion estimation works off both the luma and chroma planes. This disables chroma motion estimation for a small speed boost.
建議: Default
一般運動估計都會同時考慮亮度和色度因素。開啓此選項將會忽略色度因素以換取一些速度的提高。
默認值: Not Set
Adaptive 8x8 DCT enables the intelligent adaptive use of 8x8 transforms in I-frames. This disables the feature.
建議: Default
自適應的8×8離散餘弦轉換會在I幀中開啓更智能的自適應8×8時域變換。開啓此選項能夠禁用這個特性。(注:此選項是將H.264的Profile從High降爲Main的重要參數)
默認值: 1
Performs Trellis quantization to increase efficiency.
On Macroblock provides a good compromise between speed and efficiency. On all decisions reduces speed further.
See: Trellis Quantization
建議: Default
Note: Requires --cabac
使用網格編碼量化來提升效率:
選項1提供了速度和效率間較好的均衡,選項2大幅下降速度。注意:須要開啓cabac選項
默認值: Not Set
Disables early skip detection on P-frames. At low bitrates, provides a moderate quality increase for a large speed cost. At high bitrates, has negligible effect on both speed and quality.
建議: Default
關閉P幀的早期跳過偵測。在低碼率時,適中地提升品質但要損失不少速度。在高碼率時,對速度和品質的影響都微不足道。
默認值: Not Set
DCT Decimation will drop DCT blocks it deems "unnecessary". This will improve coding efficiency, with a usually negligible loss in quality. Setting this option will disable it.
建議: Default
DCT抽樣會丟棄它認爲「沒必要要的DCT塊。這會改善編碼效率,一般質量損失能夠忽略。此選項關閉此特性。
默認值: Not Set
Performs fast noise reduction. Estimates film noise based on this value and attempts to remove it by dropping small details before quantization. This may not match the quality of a good external noise reduction filter, but it performs very fast.
建議: Default or (100 to 1000 for denoising)
執行快速去噪。根據此值估算影片的噪聲,並經過在量化前捨棄小細節來嘗試去除噪音。效果可能不如優秀的外部去造濾鏡,但它執行得很是快。
默認值: Not Set
Set the size of the inter/intra luma quantization deadzone. Deadzones should be in the range of 0 to 32. The deadzone value sets the level of fine detail that x264 will arbitrarily drop without attempting to preserve. Very fine detail is both hard to see and expensive to encode, dropping this detail without attempting to preserve it stops wasting bits on such a low-return section of the video. Deadzone isincompatible with Trellis.
建議: Default
設置幀間/幀內亮度量化器的盲區大小。盲區的範圍應該在0-32,此值設定x264會任意捨棄而不嘗試保留細微細節的級別。很是細微的細節既難以發覺,編碼代價又昂貴,丟棄它們能夠避免在這些低迴報的部分浪費比特數。此選項和Trellis選項不相容。
默認值: Flat (Not Set)
Sets all custom quantization matrices to those of a built-in preset. The built-in presets are flat
or JVT
.
建議: Default
See also: --cqmfile
爲內建的預設設定全部自定義的量化矩陣。內建的預設有flat和JVT。
默認值: Not Set
Sets custom quantization matrices from a specified JM-compatible file. Overrides any other --cqm* options.
建議: Default
使用一個JM格式矩陣文件設置自定義的量化矩陣。會覆蓋其餘以cqm開頭的選項。
See also: --cqm
默認值: Not Set
建議: Default
These options set a flag in the output stream that can be read by the decoding application and possibly acted on. It's worth noting that most of these options in most scenarios are pointless, and are usually ignored by software decoders.
這些選項在輸出流裏設定一個標記,標記能夠被解碼器讀取並採起可能的動做。在大多數場景中這些參數都沒什麼意義,並且常常被解碼器所忽略。
默認值: undef
How to handle overscan. Overscan is used here in the sense of a device only displaying part of an image.
如何處理溢出掃描。溢出掃描的意思是裝置只顯示圖像的一部分。(注:溢出掃描技術本用在陰極射線管顯示器中爲保持畫面完整。)
Possible Values:
建議: Crop before encoding and use show if your device supports it, otherwise ignore.
若是你的設備支持此選項,建議在編碼以前對視頻進行裁剪而後設置爲show。若是不支持就別管此選項了。
默認值: undef
Indicates what the video was before encoding/digitizing.
Possible Values:
建議: Whatever your source video was, or undefined.
指示此視頻在 編碼/數字化 以前是什麼格式。
建議:設爲原視頻的格式,或者設爲undef
默認值: auto
Indicates whether the output range of luma and chroma levels should be limited or full. If set to TV, the limited ranges will be used. If set to auto, use the same range as input.
NOTE: If range and --input-range
differ, then a range conversion will occur!若是range和--input-range不一樣,則會進行範圍轉換。
See this pagefor a simple description.
建議: Default.
指示亮度和色度級別的輸出範圍是有限範圍仍是全範圍。若是設爲TV,則會使用有限範圍。若是設爲auto,則會使用與輸入相同的範圍。
See also: --input-range
默認值: undef
Set what color primaries for converting to RGB.設置轉換到RGB的原色
Possible Values:
建議: Default, unless you know what your source uses.
默認值: undef
Set the opto-electronic transfer characteristics to use. (Sets the gamma curve to use for correction.)設定要使用的光電子傳輸特性(設置用於修正的伽馬曲線)。
Possible Values
See: Gamma Correction
建議: Default, unless you know what your source uses.
默認值: undef
Set the matrix coefficients used in deriving the luma and chroma from the RGB primaries.
Possible Values
設置用於從RGB原色中提取亮度和色度的矩陣係數。
See: YCbCr
建議: Whatever your sources uses, or default.源使用的矩陣,或者默認值。
默認值: 0
Sets the chroma sample location. (as defined in Annex E of the ITU-T Specification).
設定色度採樣位置
Values range from 0 to 5.
See x264's vui.txt
建議:
默認值: None
Signal HRD information. Required for Blu-ray streams, television broadcast and a few other specialist areas. Acceptable values are:
建議: none, unless you need to signal this information.
設置HRD信息。用於藍光流、電視廣播和其餘一些特殊場合。
See also: --vbv-bufsize
, --vbv-maxrate
, --aud
默認值: Not Set
Force sending pic_struct in Picture Timing SEI.
Implied when you use --pulldown
or --tff
/--bff
.
強制按照圖像時序SEI傳送pic_struct。當使用--pulldown或--tff/--bff時會自動啓用。
建議: Default
默認值: Not Set
Specify a bitstream-level cropping rectangle. You can use this if you want the decoder to crop on playback, but don't want to crop the video x264 encodes for some reason. Specify the value in pixels that should be cropped on playback.
指定一個比特流級的裁剪矩形。若是想要解碼器在播放時裁剪,但由於某些緣由不想要裁剪視頻再讓x264編碼,則可使用此選項。指定的值是在播放時應該被裁剪的像素值。
默認值: Not Set.
Specifies output filename. The extension you specify determines the output format of your video. If the extension is not recognised the default output format is the raw video stream (generally stored with the .264 extension).
The special location NUL
(Windows) or /dev/null
(Unix) specifies the output should be discarded. This is particularly useful when using --pass
1, as the only output you care about is that from --stats
.
指定輸出文件名。由文件的擴展名決定視頻的輸出格式。若是擴展名沒法識別則默認採用 raw 格式(一般以.264後綴進行存儲)。
特殊的文件名 NUL (Windows)或者 /dev/null (Unix)表示丟棄輸出內容。當使用 pass 1 時特別有用,由於你惟一關心的輸出來自 stats。
默認值: auto
Specifies what format to write to.指定輸出格式。
Possible Values
The 'auto' option will pick a muxer based on the supplied output filename.
‘auto’選項將根據提供的文件名選擇相應的封裝器。
See also: --output
建議: Default
默認值: Automatically detected.
Sets what demuxer and decoder x264 uses for parsing the input video.
Possible Values
If the input file has an extension of raw, y4m or avs, x264 will use the relevant demuxer to read the file. Standard input uses the raw demuxer. Otherwise, x264 will attempt to open the file with ffms, then lavf, and then fail.
The 'lavf' and 'ffms' options require x264 to be compiled with the respective libraries. If either is used, x264 will carry over the timecodes from the input file, provided you don't output to raw. This effectively makes x264 VFR-aware. The other options can have a constant framerate specified with --fps
or a variable framerate with --tcfile-in
.
指定x264用於分析輸入視頻的解封裝器和解碼器。
若是輸入文件爲raw、y4m 或 avs,x264會使用相應的解封裝器讀取文件。標準輸入使用raw解封裝器。不然,x264 將依次嘗試使用 ffms, lavf 來打開文件,直至最終失敗。
‘lavf’和‘ffms’參數須要用其它的庫文件編譯x264。若是使用二者之一,並且輸出不是raw 的話,x264會從輸入文件中帶入時間碼。這將使x264有效的感知VFR。其它選項能夠經過指定--fps爲固定幀率,或者經過指定--tcfile-in爲可變幀率。
建議: Default.
默認值: i420
Tell x264 what colourspace your raw video input is with this switch. Supported colourspaces are listed in x264 --fullhelp
.
告訴x264視頻源的色彩空間。注意:當指定爲 RGB 色彩空間時,視頻在壓縮前會按 bt601 矩陣轉換爲 YUV。
默認值: i420
Tell x264 what colourspace you want out. Supported colourspaces are listed in x264 --fullhelp
.
Possible Values
告訴x264要輸出什麼色彩空間。
See Also: --input-csp
默認值: auto
Indicates the source's range of luma and chroma levels. Can be set to TV for limited ranges or PC for full ranges.
NOTE: If --range
and input-range differ, then a range conversion will occur!
建議: Default, unless you know if your source is TV or PC levels.
指定源的亮度和色度層級範圍。能夠爲TV設定爲有限範圍或爲PC設定爲全範圍。
注意:若是--range和input-range不一樣,則會進行範圍轉換。
建議:默認值,除非你知道源是TV或PC層級
See also: --range
Specify the input resolution of raw video input. Use the syntax --input-res 720x576
.
爲raw格式輸入視頻指定分辨率。
默認值: Not Set
An optional setting that only takes effect when using the ffms --demuxer
. Specifies a file for ffms to write out indexing data for the input file to, which can be referred to in a future encode to remove the need to reindex the video. Generally not needed -- indexing is not a slow process relative to video encoding.
See also: --demuxer
, FFMS2 API Documentation
一個僅在使用 ffms --demuxer 時才起做用的可選設置。爲 ffms 指定一個用於爲輸入文件創建索引數據的文件,之後編碼的時候能夠省去再次創建索引的時間。一般不須要,由於相對於編碼來講索引很是快。
建議: Default, unless you want to save a minute amount of time indexing.默認值,除非想節省創建索引的幾分鐘時間
默認值: Not Set
Specifies the input video's Sample Aspect Ratio (SAR) to be used by the encoder in width:height.
This in conjunction with frame dimensions can be used to encode an anamorphic output by determining the Display Aspect Ratio (DAR) via the formula: DAR = SAR x width/height
See Main Article here
建議: You might need to set this if you're using the resize filter and encoding with anamorphic input.
以「寬:高」格式指定編碼器使用的輸入視頻的採樣縱橫比。
綜合SAR 和幀尺寸能夠編碼依賴顯示縱橫比的變形輸出,公式爲:DAR = SAR x width/height
建議:若是使用 resize 濾鏡和變形視頻源的話,應該指定。
「可變形」是種特殊應用,可參考細說DVD的畫面比例。
默認值: autodetected
Specifies video framerate as either a float (29.970) a rational (30000/1001), or an integer (2997/100) value. x264 detects and uses the framerate from the input stream header when available (y4m, avs, ffms and lavf demuxer), otherwise uses 25. Setting this implies --force-cfr
.
If you are using raw YUV input and --bitrate
-based ratecontrol, you need to specify the correct framerate using this parameter or --tcfile-in
. x264 won't hit your target bitrate otherwise.
以浮點數(29.970)、有理數(30000/1001)或整數(2997/100)值指定視頻的幀率。當使用y4m、avs、ffms或lavf解封裝器時,x264會使用從輸入流頭部偵測到的幀率,不然使用25做爲幀率。設定此選項會自動啓用--force-cfr。
若是正在使用 raw YUV 視頻源而且基於 --bitrate 碼率控制,須要經過此選項或 -tcfile-in來指定正確的幀率。不然,x264 沒法達到設定的碼率目標。
默認值: Not Set
Specifies the first frame to encode, allowing the encode to begin at any point in the source.
指定要編碼的初始幀,容許從視頻源的任意位置開始編碼。
建議: Default
默認值: Not Set
Specifies the maximum number of frames to encode, allowing the encode to finish at any point before the end of the source.
指定要編碼的最大幀數,容許在視頻源結束前的任意位置終止編碼。
建議: Default
默認值: -1 (auto)
Sets the level flag in the output bitstream (as defined by Annex A of the H.264 standard). Permissible levels are:
1 1b 1.1 1.2 1.3 2 2.1 2.2 3 3.1 3.2 4 4.1 4.2 5 5.1
If you do not specify --level
on the commandline, x264 will attempt to autodetect the level. This detection is not perfect and may underestimate the level if you are not using VBV. x264 will also automatically limit the DPB size (see --ref
) to remain in compliance with the level you select (unless you also manually specify --ref
). Note: specifying the level does not automatically set the --vbv-maxrate
or --vbv-bufsize
, however it will warn if the level specific properties are exceeded.
What Level Do I Pick?
Level 4.1 is often considered the highest level you can rely on desktop consumer hardware to support. Blu-ray Discs only support level 4.1, and many non-mobile devices like the Xbox 360 specify level 4.1 as the highest they officially support. Mobile devices like the iPhone/Android are a totally different story.
Wikipedia has a nice chart detailing the restrictions for each level, if you want to read it.
建議: Default, unless you are aiming for a specific device.
在輸出流中設定等級標誌。
若是在命令行中沒有指定--level,x264會嘗試自動偵測level。此偵測並不完美,並且若是沒有使用VBV則可能會低估level。x264也會自動限制DPB的大小來保持與所選level相匹配(除非你也手動指定--ref)。
注意:指定level並不會自動設定--vbv-maxrate或--vbv-bufsize,可是若是它們的參數超過設定的等級會告警。
如何選擇等級?
Level 4.1 經常是桌面型硬件能支持的最高等級。藍光碟僅支持 Level 4.1,許多非手機類設備,像 Xbox 360,指定 Level 4.1 爲其官方支持的最高等級。手機設備,像 iPhone/Android 則是徹底不一樣的處理方式。
建議: Default,除非是爲一個特定設備編碼。
默認值: Not set
Modify x264's options to ensure better compatibility with all Blu-Ray players. Only neccessary if your video will be played by Blu-Ray hardware players.
This setting makes some option changes:
--weightp
at 1--min-keyint
to 1--intra-refresh
修改x264的選項以保證與藍光播放機有更好的兼容性。僅當你的視頻在藍光機上播放時才須要此選項。
此設定變動一些選項:
It also enables some internal x264 hacks to produce more hardware-player-friendly streams. For example:
它也啓用了x264內部的一些特殊處理
建議: Set if you're encoding for hardware Blu-Ray players.默認值,除非針對藍光播放機。
默認值: Not Set
Displays statistics for each encoded frame.
顯示每一個已編碼幀的統計信息。
建議: Default
默認值: Not Set
Disables the progress indicator while encoding.
編碼時關閉進度指示器。
建議: Default
默認值: Not Set
Enables Quiet Mode, silencing status messages from x264.
啓用安靜模式,使x264不顯示狀態訊息。
建議: Default
默認值: info
Manually specify the logging level of both x264cli and libx264.
手動設定x264cli和libx264的日誌等級。
Possible Values
越往下,日誌信息越詳細。
建議: Default
默認值: Not Set
Enables PSNR calculations that are reported on completion at the cost of a small decrease in speed.
開啓 PSNR 計算,會在編碼完成後給出報告,會略微下降一些速度。
建議: Default
默認值: Not Set
Enables SSIM calculations that are reported on completion at the cost of a small decrease in speed.
開啓SSIM 計算,會在完成後給出報告,會略微下降一些速度。
建議: Default
默認值: auto (frame based threads: 1.5 * logical processors, rounded down; slice based threads: 1 * logical processors)
Enables parallel encoding by using more than 1 thread to increase speed on multi-core systems. The quality loss from multiple threads is mostly negligible unless using very high numbers of threads (say, above 16). The speed gain should be slightly less than linear until you start using more than 1 thread per 40px of vertical video, at which point the gain from additional threads sharply decreases.
x264 currently has an internal limit on the number of threads set at 128, realistically you should never set it this high.
建議: Default
默認:auto (基於幀的線程數:1.5x邏輯處理器數,向下舍入取整;基於分片的線程數:1x邏輯處理器數)
在多核處理器上經過開啓多線程並行編碼以加快速度。質量損失能夠忽略不計,除非使用很是多的線程(好比超過16個)。速度增加和線程的數量近似於線性,直到視頻垂直方向每40px多於1個線程爲止,超過臨界點後再增長線程數所得到的速度增加將大幅降低。
當前在 x264 內部對線程數量限制爲128,實際上你不該該設置這麼高。
See also: --sliced-threads
, --thread-input
默認值: off
Enables slice-based threading. This threading method produces lower quality results than the default method both compression and efficiency-wise, but adds no encoding latency.
開啓基於分片的線程。比默認方式的質量和效率都低,可是沒有編碼延遲。
The maximum number of sliced threads is MIN( (height+15)/16 / 4, 128 )
建議: Default (off), unless you are doing some sort of realtime streaming or low latency is important.除非你正在作實時流或者當低延遲很是重要時。
默認值: Set if threads > 1.
Decodes the input video in a separate thread to the encoding process.
在單獨的線程中解碼輸入視頻用於編碼進程。
建議: Default.
默認值: auto (--bframes
+1)
Sets the number of frames to be used as a buffer for threaded lookahead. Maximum Value is 250. Automatically disabled during the 2nd or greater pass or when using sliced threads.
Setting this to 0 disables threaded lookahead, which allows lower latency at the cost of reduced performance.
設置用於線程預測的幀緩存大小。最大值爲250。在第二遍佈更多遍編碼時或基於分片線程時會自動關閉。
將此選項設爲0將關閉線程預測,將減少延遲,可是以下降性能爲代價。
建議: Default
默認值: Not Set
Slightly improve quality when encoding with --threads
> 1, at the cost of non-deterministic output encodes. This enables multi-threaded mv and uses the entire lookahead buffer in slicetype decisions when slicetype is threaded -- rather than just the minimum amount known to be available.
Not for general use.通常不用。
建議: Default
在 --threads>1 時能夠稍微提升編碼質量,以非肯定性輸出編碼爲代價。開啓多線程 mv 和 在分片類型決策時使用所有的向前預測緩存。
See also: threads
默認值: auto
Override automatic CPU detection. Useful for debugging or troubleshooting.不理會自動 CPU 檢測。用於調試或排除故障。
建議: Default
默認值: Not Set
Disables all CPU optimisations. Useful for debugging or troubleshooting.關閉全部 CPU 優化。用於調試或排除故障。
建議: Default
默認值: Not Set
Enables Macroblock Type visualizations over the encoded video. Useful for frame by frame debugging or analysis.
Requires compile time support, and an X11 windowing system.
開啓已編碼視頻宏塊可視化。用於逐幀調試或分析。
須要編譯支持和 X11 窗口系統。
建議: Default
默認值: Not Set
Dumps the reconstructed YUV frames to the specified file. Useful mostly for debugging. Not for general use.
把重建的 YUV 幀轉存到指定文件。一般用於調試。通常不用。
建議: Default
默認值: Not Set
Set SPS (sequence parameter set) and PPS (picture parameter set) id numbers. Not for general use.設置序列參數集和圖像參數集id號。通常不用。
建議: Default
默認值: Not Set
Use access unit delimiters.設置訪問單元分隔符。
建議: Default, unless encoding for Blu-ray, in which case set this option.僅用於藍光碟
默認值: Not Set
If using ffms2 or lavf demuxers, timecodes are copied from the input file, provided the output file is not raw. This option disables this, and forces x264 to generate its own. When using this you probably also want to set --fps
.
若是使用 ffms2 或 lavf 解封裝器,且輸出文件不是 raw 格式,則從輸入文件複製時間碼。此選項關閉這個功能,並強制 x264 本身產生。當使用此選項時通常也會設置--fps。
建議: Default
Specify a timecodes file which should be used to interpret the framerate of the input video. The timecode file can be in either v1 or v2 format which are described in the mkvmerge documentation.
指定一個說明輸入視頻幀率的時間碼文件。
See Also: --tcfile-out
, --force-cfr
, --fps
Output a timecode file (v2 format) based on the input timestamps. For use when you're encoding a VFR input video and want to dump the timecodes. For details on the file format, see --tcfile-in
.
輸出一個基於輸入時間戳的時間碼文件(v2 格式)。用於當你正在編碼一個 VFR 視頻源而且想轉存時間碼的時候。
默認值: Not Set
Allows you to set a custom timebase.
The numerator is 'seconds', and the denominator is 'ticks'. Means how many seconds one tick takes.
--tcfile-in
, it will use the value passed as the numerator, and generate the denominator accordingly.Not compatible with --force-cfr
mode.
容許你自定義時間基準。
分子是‘秒’,分母是‘ticks’。意思是1個 tick 多少秒。
與--force-cfr 不兼容。
建議: Default
默認值: Not Set
A hack, implemented for FLV and MP4 containers only, that can work around buggy decoders that expect all DTSs to be positive. As per the commit message for this change, use at your own risk.
Note: DTS refers to Decode TimeStamp. Each frame is allocated a DTS that reflects its position in the 'coded order' of the stream, as opposed to the 'display order' of the stream, which is specified by thePresentation TimeStamp. The order frames are stored in the stream is different to the order they are displayed due to compression techniques such as B-frames, which result in frames requiring data from frames that will be displayed after.
一個小把戲,僅適用於FLV和MP4容器,能夠在有缺陷的解碼器下工做,這些解碼器認爲全部的 DTS 都是正數。使用此選項風險自擔。
注:DTS指的是解碼時間戳。每一幀都分配一個 DTS,對應其在流的‘編碼順序’中的位置,不一樣於由顯示時間戳PTS指定的‘顯示順序’。因爲使用 B 幀等壓縮技術的緣由,形成某些幀須要後續幀的數據。所以各幀在視頻流中的保存順序與其顯示順序是不一樣的。
The x264 filtering system is used to process the input video before encoding. Multiple filters can also be applied sequentially to the input video.x264過濾系統會在視頻源被編碼前處理它們。能夠順序使用多個過濾器(濾波器)。
The basic syntax to apply a filter is this:
--video-filter <filter>
You can apply multiple filters sequentially by delimiting them with a /
連續使用多個過濾器時用 / 分隔
--video-filter <filter1>/<filter2>
You can 'chain' as many filter operations as you like together.你能夠按本身喜歡的方式鏈式使用多個過濾器。
The available filters are:
Syntax: crop:left,top,right,bottom
Remove pixels from the edges of the frame.從幀的邊緣移去像素,就是常說的剪裁。
Syntax: resize:[width,height][,sar][,fittobox][,csp][,method]
Resizes frames and/or converts frames between different colorspaces. Requires x264 to be compiled with libswscale.
There are a few possible modes on how to resize frames:
Options that are independent of the resizing mode are
fastbilinear, bilinear, bicubic, experimental, point, area, bicublin, gauss, sinc, lanczos, spline
調整幀尺寸 和/或 轉換幀的色彩空間。須要 x264 編譯時帶上 libswscale 庫。
有下面幾種調整幀尺寸的方式:
與調整尺寸無關的參數:
Example:
resize:width=1280,height=720,method=spline
Syntax: select_every:step,offset1[,offset2,...]
"Select" only a subset of input frames to encode, dropping the rest. Every step
frames, take only the frames specified with an offset. 僅選擇部分輸入幀進行編碼,丟棄其它。每隔 step 幀,僅使用 offset 指定的幀。For example: To encode every second frame:每2幀,丟棄第1幀,採用第2幀
select_every:2,1
To drop every third frame:每3幀,採用第0,1幀,丟棄第2幀
select_every:3,0,1
You can see more examples at the Avisynth wiki (which has an identical filter).
PDF版下載:藝搜下載