x264cli


x264cli
2020-11-14 (土) 08:55:58更新
カテゴリ:x264

もくじ

はじめに

ほぼMEncoderの-x264encoptsのコマンドと対応している為、訳さず、リンクを貼るに止めます。

性質

  1. 読み込める形式はraw YUV 4:2:0 (要、解像度指定)のみ。
    1. AVS(AviSynth), AVIはWin専用の模様。
  2. ビデオコデックのみ。フィルタ機能は無い。
  3. MEncoderやffmpegは、ビルド時にx264のソースコードを取り込む。いわば、部品(ライブラリ)、x264cliはそのフロントエンド。
  4. Macでは事前にraw YUV 4:2:0ファイルの作成が必須。
  5. またはffmpegをデコーダとして使い、x264cliにpipeする。

ffmpegX0.0.9u,1passの例(gpac込みでビルドされているので.mp4出力可能)

$ ffmpeg -i XXX.mpeg -an -f yuv4mpegpipe \
-croptop 0 -cropbottom 0 -cropleft 0 -cropright 0 -s 640x480 \
-r 29.97 - | x264 -v -A i4x4 -b 1 --trellis 1 --qpmin 22 qpmax 51 -B 1024 \
--me hex --threads 2 --level 51 --fps 29.97 -o XXX.mpeg.ff.video.mp4 -640x480

ここで使用したx264cli--svn426

ffmpegX0.0.9u同梱版よりも新しい為、効かないオプションや動作が異なる可能性があります。

$ x264
x264 core:44 svn-426
Syntax: x264 [options] -o outfile infile [widthxheight]

Infile can be raw YUV 4:2:0 (in which case resolution is required),
 or AVI or Avisynth if compiled with AVIS support (no).
Outfile type is selected by filename:
.264 -> Raw bytestream
.mkv -> Matroska
.mp4 -> MP4 if compiled with GPAC support (no)

凡例:

  • "-h"と"--help"は同じ意味のコマンド。よく使うものには短縮コマンドが用意されている。
  • []で括られた文字はデフォルト値。
  • integer=整数。

Options:


-h, --help

ヘルプの表示

Frame-type options:

-I, --keyint <integer>

最大GOPサイズ [250]

-i, --min-keyint <integer>

最小GOPサイズ[25]

--scenecut <integer>

上記以外のI-framesを入れる際の判断基準(閾値) [40]


-b, --bframes <integer>

I-P間に挟むB-frame数 [0]

--crf <integer>

Quality-based VBR (nominal QP)
画質ベースVBR(名目上のQP)
(svn-483)

--no-b-adapt

adaptive B-frame のオフ

--b-bias <integer>

Bフレームを使う頻度を増やす(負の値にすると減らす) [0]

--b-pyramid

Keep some B-frames as references


--no-cabac

CABACオフ

-r, --ref <integer>

参照フレーム数[1]

--nf

loop filterオフ

-f, --filter <alpha:beta>

Loop filterのパラメータ。AlphaC0 と Beta [0:0]

Ratecontrol


-q, --qp <integer>

Set QP (0=lossless) [26]

-B, --bitrate <integer>

Set bitrate

--crf <integer>

Quality-based VBR (nominal QP)

--qpmin <integer>

Set min QP [10]

--qpmax <integer>

Set max QP [51]


--qpstep <integer>

Set max QP step [4]

--ratetol <float>

Allowed variance of average bitrate [1.0]

--vbv-maxrate <integer> Max local bitrate [0]

--vbv-bufsize <integer> Size of VBV buffer [0]

--vbv-init <float>

Initial VBV buffer occupancy [0.9]


--ipratio <float>

QP factor between I and P [1.40]

--pbratio <float>

QP factor between P and B [1.30]

--chroma-qp-offset <integer>

QP difference between chroma and luma [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

--stats <string>

Filename for 2 pass stats ["x264_2pass.log"]

--rceq <string>

Ratecontrol equation ["blurCplx^(1-qComp)"]

  • 対応不明


--qcomp <float>

QP curve compression: 0.0 => CBR, 1.0 => CQP [0.60]

--cplxblur <float>

Reduce fluctuations in QP (before curve compression) [20.0]

--qblur <float>

Reduce fluctuations in QP (after curve compression) [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)


Analysis:

-A, --analyse <string>

Partitions to consider ["p8x8,b8x8,i8x8,i4x4"]

- p8x8, p4x4, b8x8, i8x8, i4x4

- none, all

(p4x4 requires p8x8. i8x8 requires --8x8dct.)



--direct <string>

Direct MV prediction mode ["temporal"]

- none, spatial, temporal

-w, --weightb

Weighted prediction for B-frames

--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 (slow)

--merange <integer>

Maximum motion vector search range [16]

-m, --subme <integer>

Subpixel motion estimation and partition

decision quality: 1=fast, 6=best. [5]

--b-rdo

RD based mode decision for B-frames. Requires subme 6.

--mixed-refs

Decide references on a per partition basis

--no-chroma-me

Ignore chroma in motion estimation

--bime

Jointly optimize both MVs in B-frames

-8, --8x8dct

Adaptive spatial transform size

-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

--no-fast-pskip

Disables early SKIP detection on P-frames

--nr <integer>

Noise reduction [0]

--cqm <string>

Preset quant matrices ["flat"]

- jvt, flat

--cqmfile <string>

Read quant matrices from a JM-compatible file

Overrides any other --cqm* options.

--cqm4 <list>

Set all 4x4 quant matrices Takes a comma-separated list of 16 integers.

  • 不明

--cqm8 <list>

Set all 8x8 quant matrices

Takes a comma-separated list of 64 integers.

  • 不明

--cqm4i, --cqm4p, --cqm8i, --cqm8p

Set both luma and chroma quant matrices

  • cqm4i対応無し
  • cqm4p対応無し
  • cqm8iはcqm8iyか?
  • cqm8pはcqm8pyか?

--cqm4iy, --cqm4ic, --cqm4py, --cqm4pc

Set individual quant matrices



Video Usability Info (Annex E):

VUI設定はエンコーダが使うものではなく、再生機器に情報提供するだけのもの。詳細はdoc/vui.txt参照。自己責任で使う事。

--sar width:height

Specify Sample Aspect Ratio

  • 対応不明。

*SARの指定値はガーベラ 趣味の花束ブログ参照。



--overscan <string>

Specify crop overscan setting ["undef"]

- undef, show, crop

  • 対応不明。


--videoformat <string>

Specify video format ["undef"]

- component, pal, ntsc, secam, mac, undef

  • 対応不明。


--fullrange <string>

Specify full range samples setting ["off"]

- off, on

  • 対応不明。

  • YUVが16-235にマップされてるか0-255にマップされてるかということではないでしょうか? -- MASA.H? 2006-08-23 (水) 21:52:02

--colorprim <string>

Specify color primaries ["undef"]

- undef, bt709, bt470m, bt470bg

smpte170m, smpte240m, film

  • 対応不明。


--transfer <string>

Specify transfer characteristics ["undef"]

- undef, bt709, bt470m, bt470bg, linear,

log100, log316, smpte170m, smpte240m

  • 対応不明。


--colormatrix <string>

Specify color matrix setting ["undef"]

- undef, bt709, fcc, bt470bg

smpte170m, smpte240m, GBR, YCgCo

  • 対応不明。


--chromaloc <integer>

Specify chroma sample location (0 to 5) [0]

  • 対応不明


Input/Output:

--level <integer>

Specify level (as defined by Annex A)

--fps <float|rational>

Specify framerate--デフォルトは25

  • ofps

--seek <integer>

First frame to encode

--frames <integer>

Maximum number of frames to encode

-o, --output

Specify output file

--threads <integer>

Parallel encoding (uses slices)

--no-asm

Disable all CPU optimizations
※x86のアセンブラで書かれた部分を使わない。

--no-psnr

Disable PSNR computation

--quiet

Quiet Mode--エンコード中にターミナルに表示を出さない

-v, --verbose

Print stats for each frame--エンコード中にターミナルに各フレームのエンコード状況を出す

--progress

Show a progress indicator while encoding--エンコード中にターミナルに進捗状況を出す

--visualize

Show MB types overlayed on the encoded video
エンコードされた映像上にマクロブロック・タイプをオーバーレイ表示する。

--aud

Use access unit delimiters



FrontPage
MPlayer
Manuals
Documents
カテゴリ

■GENERAL
MEMO
LINK
雑談所
最近の更新
popular

■Other Tools
ffmpeg
mkvmerge
mp4box
MPEG Streamclip
QTCoffee
x264cli

■About
About Wiki

edit


blog


本日1
昨日0
累積47951