FFMPEG USAGE †
少しずつ日本語化してます。ご協力をお願いします。
詳しい方、どんな効果があるとかオプションの引数の型とか付け足してくれるとありがたいです。
参考資料:ffmpeg Documentation
利用可能なフォーマット、コーデック、プロトコル format.txt(-formats の出力ママです)
使い方: ffmpeg [[infile options] -i infile]... {[outfile options] outfile}...
メインオプション †
- -L
- ライセンスを表示
- -h
- ヘルプを表示
- -version
- バージョンを表示
- -formats
- 利用可能なフォーマット、コーデック、プロトコルを表示 format.txt
- -f <fmt>
- 強制的にfmtで指定したフォーマットを適用する
- -img <img_fmt>
- 強制的にimg_fmtで指定したイメージフォーマットを適用する
- -i <filename>
- インプットファイル名を指定する
- -y
- 同名ファイルがあった場合アウトプットファイルを上書きする
- -t <duration>
- 変換する時間(長さ)を指定する(hh:mm:ss.ms 又は、s)
- -fs <limit_size>
- ファイルサイズを制限する
- -ss <time_off>
- 変換開始時間をセットする(hh:mm:ss.ms 又は、s)
- -itsoffset <time_off>
- インプットファイルのオフセットを指定する(±hh:mm:ss.ms 又は、±s)
- -title <string>
- タイトルをセットする
- -timestamp <time>
- タイムスタンプをセットする
- -author <string>
- 著作者名
- -copyright <string>
- 著作権表示
- -comment <string>
- コメント
- -v <verbose>
- ログの量をコントロール(?)バーボーズモード
- -target <type>
- ターゲットのファイルタイプを指定 ("vcd", "svcd", "dvd", "dv", "pal-vcd", "ntsc-svcd", ...)
- -dframes <number>
- 変換するフレーム数を指定する
- -hq
- ハイクオリティセッティングを有効にする
ビデオオプション †
- -b <bitrate>
- ビデオビットレートの設定 (kbit/秒)
Default=200
- -vframes <number>
- 変換するビデオフレーム数
- -r <rate>
- フレームレートの設定(fps、値、小数部または簡略名)
Default=25
- -s <size>
- フレームサイズの設定(WxHか簡略名)
- -aspect <aspect>
- アスペクト比の設定(4:3、16:9、または1.3333、1.7777)
- -fixaspect
- 固定アスペクト比(変換君では元ソースのピクセル数比(←注意!)を固定しつつ足りない時は余白を追加)
- -croptop <size>
- 上部からピクセル単位でカット
- -cropbottom <size>
- 下部からピクセル単位でカット
- -cropleft <size>
- 左端からピクセル単位でカット
- -cropright <size>
- 右端からピクセル単位でカット
- 数値は必ず偶数で指定する、奇数の場合はエラーが出ます。
- -croptop -cropbottom -cropleft -cropright を -s の前に入れればトリミング出来る。
画面キャプチャし、縦横比固定でトリミングすれば数値を求められるが、キャプチャした画像が元ソースと同じピクセル数でないと誤差が起きるので注意!
- -padtop <size>
- 上部からピクセル単位で余白追加
- -padbottom <size>
- 下部からピクセル単位で余白追加
- -padleft <size>
- 左端からピクセル単位で余白追加
- -padright <size>
- 右端からピクセル単位で余白追加
- 数値は必ず偶数で指定する、奇数の場合はエラーが出ます。
- -fixaspect が上手く機能しない時はコレで補完すると良い。
- 例:-s 176x144 → -s 176x132 -padtop 6 -padbottom 6 (元ソースが720x480とか)
- -padcolor <color>
- 余白の色指定 (Hex 000000 thru FFFFFF)
- -vn
- ビデオなし
- -bt <tolerance>
- set video bitrate tolerance (in kbit/s)
- -maxrate <bitrate>
- 最大ビデオビットレートの設定 (kbit/秒)
- -minrate <bitrate>
- 最小ビデオビットレートの設定 (kbit/秒)
- -bufsize <size>
- set ratecontrol buffer size (in kByte)
- -vcodec <codec>
- ビデオコーデックを指定
Default=copy
- -sameq
- ソースと同じクオリティで変換
- ソースが VBR の場合は、暗黙に VBR となります。
- -pass <n>
- 2passのとき1pass目か2pass目かを指定(1 or 2)
- -passlogfile <file>
- 2passのときログファイル名を指定
高度なビデオオプション †
- -pix_fmt <format>
- ピクセルフォーマットの設定
- -g <gop_size>
- set the group of picture size
- -intra
- Iフレームのみを利用する。
- 動き予測を無効にする
- 変換速度は速くなるが、画像の品質は下がる(同じ品質の場合はファイルサイズが大きくなる)
- -qscale <q>
- 動画全体の量子化係数を固定する:Default = 0 (VBR)
- -qmin <q>
- 動画全体の量子化係数の最小値を設定する:Default = 2 (VBR)
- -qmax <q>
- 動画全体の量子化係数の最大値を設定する:Default = 31(VBR)
- -lmin <lambda>
- min video lagrange factor (VBR)
- -lmax <lambda>
- max video lagrange factor (VBR)
- -mblmin <q>
- マクロブロックの量子化係数の最小値を設定する:Default = 2 (VBR)
- -mblmax <q>
- マクロブロックの量子化係数の最大値を設定する:Default = 31(VBR)
- -qdiff <q>
- max difference between the quantiser scale (VBR)
- -qblur <blur>
- video quantiser scale blur (VBR)
- -qsquish <squish>
- how to keep quantiser between qmin and qmax (0 = clip, 1 = use differentiable function)
- -qcomp <compression>
- video quantiser scale compression (VBR)
- -rc_init_cplx <complexity>
- initial complexity for 1-pass encoding
- -b_qfactor <factor>
- qp factor between p and b frames
- -i_qfactor <factor>
- qp factor between p and i frames
- -b_qoffset <offset>
- qp offset between p and b frames
- -i_qoffset <offset>
- qp offset between p and i frames
- -ibias <bias>
- intra quant bias
- -pbias <bias>
- inter quant bias
- -rc_eq <equation>
- set rate control equation
- -rc_override <override>
- rate control override for specific intervals
- -me <method>
- 動き予測の手法を設定する
- -dct_algo <algo>
- set dct algo
- -idct_algo <algo>
- set idct algo
- -me_threshold <threshold>
- motion estimaton threshold
- -mb_threshold <threshold>
- macroblock threshold
- -er <n>
- set error resilience
- -ec <bit_mask>
- set error concealment
- -bf <frames>
- Bフレームを利用する。参照するフレーム数(1〜8)
- 数字が大きいほど変換速度は遅くなるが画像の品質は上がる(同じ品質の場合はファイルサイズが小さくなる)
- 対応していない携帯端末があるので注意
- -mbd <mode>
- マクロブロックのモードを決定
- 0 = FF_MB_DECISION_SIMPLE:内部変数 mb_cmp を使用します
1 = FF_MB_DECISION_BITS:必要に応じて最小ビットを選びます
2 = FF_MB_DECISION_RD:レートの歪曲収差から割り当てる
- default = 0
- -mbcmp <cmp function>
- macroblock compare function
- -ildctcmp <cmp function>
- ildct compare function
- -subcmp <cmp function>
- subpel compare function
- -cmp <cmp function>
- fullpel compare function
- -precmp <cmp function>
- pre motion estimation compare function
- -preme
- pre motion estimation
- -lelim <elim>
- single coefficient elimination threshold for luminance (negative values also consider DC coefficient)
- -celim <elim>
- single coefficient elimination threshold for chrominance (negative values also consider DC coefficient)
- -lumi_mask
- luminance masking
- -dark_mask
- darkness masking
- -scplx_mask
- spatial complexity masking
- -tcplx_mask
- temporal complexity masking
- -p_mask
- inter masking
- -4mv
- マクロブロック毎に four motion vector を利用する。(MPEG4)
- 変換速度は遅くなるが画像の品質は上がる(同じ品質の場合はファイルサイズが小さくなる)
- -obmc
- use overlapped block motion compensation (h263+)
- -lf
- use loop filter (h263+)
- -part
- data partitioning を使用する (MPEG4)
- 携帯動画では使用しません
- -ps オプションと組み合わせて使用します
- -bug <param>
- workaround not auto detected encoder bugs
- -strict <strictness>
- how strictly to follow the standards
- -deinterlace
- インタレースの解除
- 本来のデータを間引くことになるので使用には注意が必要
- -ildct
- force interlaced dct support in encoder (MPEG2/MPEG4)
- -ilme
- force interlaced me support in encoder (MPEG2/MPEG4)
- -psnr
- 処理したフレームに対して PSNR を計算する
- Peak Signal to Noise Ratio:ピーク信号対ノイズ比
- 携帯動画変換君では使用しません。
- -vstats
- エンコード情報をファイルに出力
- -vhook <module>
- insert video processing module
- -aic
- enable Advanced intra coding (h263+)
- -aiv
- enable Alternative inter vlc (h263+)
- -umv
- enable Unlimited Motion Vector (h263+)
- -ssm
- enable Slice Structured mode (h263+)
- -alt
- enable alternate scantable (MPEG2/MPEG4)
- -qprd
- -cbp
- -trell
- 格子量子化を有効にする。
- 変換速度は遅くなるが画像の品質は上がる(同じ品質の場合はファイルサイズが小さくなる)。
- -mv0
- try to encode each MB with MV=<0,0> and choose the better one (has no effect if mbd=0)
- -naq
- normalize adaptive quantization
- -cgop
- closed gop
- -sgop
- strict gop
- -noout
- skip bitstream encoding
- -scan_offset
- enable SVCD Scan Offset placeholder
- -qpel
- 1/4画素精度(クォーターペル精度)動き補償を有効にする。
- 変換速度は遅くなるが画像の品質は上がる(同じ品質の場合はファイルサイズが小さくなる)。
- 対応していない携帯端末が多い
- -intra_matrix <matrix>
- specify intra matrix coeffs
- -inter_matrix <matrix>
- specify inter matrix coeffs
- -top <n>
- top=1/bottom=0/auto=-1 field first
- -nr
- ノイズリダクション(性能は不明)
- -qns
- 量子化ノイズ(A/D,D/A変換ノイズ)をシャープに
- -sc_threshold <threshold>
- シーンチェンジ検出精度(詳細不明) threshold(スレッショルド)=閾値
- -me_range <range>
- limit motion vectors range (1023 for DivX player)
- -dc <precision>
- intra_dc_precision
- -coder
- coder type
- -context
- context model
- -pred
- prediction method
- -vprofile
- profile
- -vlevel
- level
- -nssew
- weight
- -subq
- -lowres
- -vtag <fourcc/tag>
- ビデオのfourcc/tag(コーデックなどで決められている4文字の名前みたいなもの)を強制する。
- 中身とタグがちがってると再生できなくなるので通常はいじらないが吉
- -skip_threshold <threshold>
- フレームスキップの閾値
- -skip_factor <factor>
- frame skip factor
- -skip_exp <exponent>
- frame skip exponent
- -skip_cmp <compare function>
- frame skip compare function
オーディオオプション †
- -aframes <number>
- 変換するオーディオフレーム数
- -ab <bitrate>
- チャンネル毎のオーディオビットレート (in kbit/s)
- -ar <rate>
- サンプリング周波数 (in Hz)
- -ac <channels>
- オーディオチャンネル数
- -an
- オーディオなし
- -acodec <codec>
- オーディオコーデックを指定 (変換なしのときは'copy')
- -vol <volume>
- ボリューム調整 (100=通常)
高度なオーディオオプション †
- -atag <fourcc/tag>
- オーディオ部分のfourcc/tagを書き換える。例えば-atag samrとすると中身aacでもamr_nbのタグになり再生機器をごまかせる可能性がある。ほとんどの場合中身とタグが違うと再生できなくなると思う。
オーディオ・ビデオの外部入力オプション †
- -vd <device>
- set video grab device
- -vc <channel>
- set video grab channel (DV1394 only)
- -tvstd <standard>
- set television standard (NTSC, PAL (SECAM))
- -ad <device>
- set audio device
- -grab <format>
- request grabbing using
- -gd <device>
- set grab device
高度なオプション †
- -map <file:stream>
- set input stream mapping
- -map_meta_data <outfile:infile>
- set meta data information of outfile from infile
- -debug
- print specific debug info
- -vismv
- motion vectorsを視覚化する(デバッグ用)
1:visualize forward predicted MVs of P frames
2:visualize forward predicted MVs of B frames
4:visualize backward predicted MVs of B frames
- -benchmark
- add timings for benchmarking
- -dump
- dump each input packet
- -hex
- when dumping packets, also dump the payload
- -bitexact
- only use bit exact algorithms (for codec testing)
- -re
- read input at native frame rate
- -loop
- loop (current only works with images)
- -threads <count>
- thread count
- -vsync <int>
- ビデオ同期方法(引数:整数。これを使ってるのみたことない)
- -async <int>
- オーディオ同期方法(引数:整数。1とか1000とかがよく使われる模様)
- -copyts
- copy timestamps
- -shortest
- finish encoding within shortest input
- -ps <size>
- パケットのサイズをbit単位で指定する。
- -error <rate>
- 指定したパケット毎にエラーを発生させる(通常は使用しません)
- -muxrate <rate>
- set mux rate
- -packetsize <size>
- パケットのサイズを指定する(mux)
- -muxdelay <seconds>
- set the maximum demux-decode delay
- -muxpreload <seconds>
- set the initial demux-decode delay
- -muxab <bitrate>
- mux tag にあるオーディオのビットレート値を書き換える (in kbit/s)
- -muxvb <bitrate>
- mux tag にあるビデオのビットレート値を書き換える(in kbit/s)
ご意見板 †
- いろんなオプションが日本語化されていて、さらに解説までついていて、とってもありがたいです --
- 個人的には各オプション(またはオプションの種類)ごとにページを分けて、
mpeg4,XviDで使えるか、各端末での再生状況、を集積したら良いと思う。 --
- どこにオプションを入れればいいかを書いてくれるとありがたいです。 --