--pass
マルチパスモードの起動。
XviDで馴染みのある1st, 2ndに、"nth pass" というものが加わっている。これはまず1stパスで統計を取り、次に"nth pass" を走らせるというものだ。そしてもし結果が気に入らなかったり目標ファイルサイズに合わなかったら、2回目のパスで使った設定でもう一回走らせる事ができる。この場合"nth pass"は3回目のパスを行う。"nth pass"を走らせる度に統計ファイルはアップデートされてゆく。一方2nd passは最終出力専用で統計ファイルをアップデートしない。
--pass 1
映像を分析してstats(*統計*)をファイルに書き出す。XviDの "2 pass - First pass" のようなものだ。デフォルトではこのオプションはmuxできるファイルを書き出す。ビットレートを指定してあれば1 pass ABRに --qp 18 を指定してあればXviDの first pass modeの最高画質とほぼ同等の画質になる。一般的には--pass 1はビットレート指定の方が後続パスの画質が良くなる。
--pass 2
--pass 1で作った統計ファイルの内容に応じてレートコントロールを行った映像を出力する。このモードはXviDの "2 pass - Second pass" に相当し、統計ファイルのアップデートはしない。よりよい画質とより小さなファイルサイズになるので、一般的には2パスがお奨めだ。内部動作を視覚化する方法は後述。
(1回目) --pass 1 = 最初の統計ファイルを作る
(2回目) --pass 2 = 1回目 の統計を使って出力
--pass 3
--pass 3
はやや特別で、「3回目に走らせるパス」という意味ではない。何回でも走らせる事ができる。画質向上は大した事がないので10パスとか試みないように。これはおおむね1000フレーム以下の短い素材、即ちビットレートの平均をうまくだすには短すぎる素材に向いている。--pass 3は--pass 1と--pass 2を合わせたようなもので、--pass 1の統計を読み込み、それを参考にファイルを書き出しつつ、同時に統計ファイルにアップデートをかける。つまり "nth pass" モードを使ってエンコードすると、2回目のパスより良い統計ファイルを使う事ができるわけだ。これは内部動作を視覚化すると解り易い。視覚化(*--visualize*)は1回目の統計ファイルをベースにするが2回目を走らせるとそのリファインぶりを確かめることができる。
(1回目) --pass 1 = 最初の統計ファイルを作る
(2回目) --pass 3 = 1回目 の統計を使って出力 + 統計ファイルのアップデート
(3回目) --pass 3 = 2回目 の統計を使って出力 + 統計ファイルのアップデート
http://aflux.deltaanime.net/Zero1/MP4/x264.html#rate-control
--pass
Usage: --pass <1|2|3>
This is where you enable multi pass mode. In addition to first and second pass as you will be familliar with from using XviD, it also features "nth pass". This means that you can run a first pass to collect the stats, then run the nth pass to give you the second pass. If you are not happy with the results, or are not meeting the filesize, you can run the settings you used for the second pass again, and nth pass now does a pass 3. Nth pass works by updating the stats file each time, 2nd pass just performs a final pass and doesn't update the stats.
--pass 1
Pass 1 is the where the video is analysed and the stats are written to
a file. This is just like the "2 pass - First pass" mode in XviD. By
default this outputs a muxable file that you can use. If you specify
the bitrate at this stage it will produce a 1 pass ABR, if you use --qp
18 instead, it will output a file which should be visually the same as
XviD's full quality first pass mode. Specifying the target bitrate at
this stage as opposed to using --qp 18 will usually result in a better
quality 2nd and nth pass.
--pass 2
Pass 2 generates output based on the complexity stats collected by the
first pass, and makes ratecontrol decisions based on this. This mode is
equivalent to "2 pass - Second pass" in XviD, and does not update or
modify the stats file. 2 pass usually brings about higher quality and
lower filesizes and is always recommended. To visualise how it works,
see below.
(Pass 1) --pass 1 = Initial stats collection
(Pass 2) --pass 2 = Output using Pass 1 stats
--pass 3
--pass 3 is somewhat special. It isn't referred to as Second or Third
pass, since the amount of passes you can do with it are infinate. The
quality gain isn't, so don't go doing 10 pass encodes. It is really
only useful for sources around 1000 frames or less where it doesn't
have much time to average the bitrate properly. It essentially does the
job of -pass 1 and --pass 2, but pass 1 is still required for initial
stats collection. Instead of just reading from the stats file and
providing output, it reads from the stats file, outputs and updates it.
This means that if you do a 3 pass encode using the nth pass mode, it
will be using refined stats from pass 2. The easy way to understand
this is to visualise it.it will work from the stats from pass 1 that
have been refined when you ran pass 2.
(Pass 1) --pass 1 = Initial stats collection
(Pass 2) --pass 3 = Output using Pass 1 stats + update stats file
(Pass 3) --pass 3 = Output using Pass 2 stats + update stats
file