9

私は間違いなくFFMPEGの専門家ではありませんが、このドキュメントによると:

プリセットは、特定のエンコード速度と圧縮率を提供するオプションのコレクションです。プリセットを遅くすると、圧縮率が高くなります(圧縮率はファイルサイズごとの品質です)。一般的な使用法は、忍耐力のある最も遅いプリセットを使用することです。速度の降順での現在のプリセットは、超高速、超高速、超高速、高速、高速、中、低速、低速、非常に低速、プラセボです。

したがって、私が理解しているように、ffmpegプリセットは出力ビデオの品質に影響を与えるべきではなく、圧縮率/出力ファイルサイズのみを決定する必要があります。したがって、同じ品質設定(私が使用します-crf 24)を想定すると、ファイルは、たとえばfasterプリセットの場合よりもプリセットの場合の方が大きくなりますslower。これが、ファイルサイズを小さくするために遅いプリセットを使用する唯一の理由です。

これは事実ではないことが判明しました。さまざまなプリセットを使用してハンディカムからのHDストリームをエンコードしますが、それ以外はすべて同じです。

ffmpeg -y -i "$fname" -vf yadif=1,scale=-1:720 -acodec aac -ab 128k -ac 2 -strict experimental -vcodec libx264 -vpre slow -threads 2 -crf 24 "$outp"

驚いたことに、veryfastプリセットのファイルサイズが最小になりました。例えば:

  • slower:出力ビットレート3500kbps、エンコード速度17 fps、ファイルサイズ29MB
  • veryfast:出力ビットレート3050kbps、エンコード速度34 fps、ファイルサイズ25MB

あるべき姿ではないと思います。veryfastプリセットのエンコード品質が悪いためだろうか?または私の場合、使用するslowerことは単に何らかの理由で意味がありませんか?

4

2 に答える 2

15

はい、使用するプリセットによって品質が多少異なる場合がありますが、それほど大きくはないはずです。#x264 に関する議論からの抜粋です。x264 開発者の 1 人から提供された回答を含む、あなたと同様の質問:

verb3k | Do different presets have an effect on quality when used with CRF?
@Dark_Shikari | verb3k: yes, but not too much.
@Dark_Shikari | a 0th-order approximation is that they have no effect.
@Dark_Shikari | The main reason there's a difference is because the preset affects how x264 itself measures quality
@Dark_Shikari | that is, it uses better, more accurate methods of measuring quality
@Dark_Shikari | obviously, this will affect the definition of what -crf does!
@Dark_Shikari | It's just not too much, so we can mostly ignore it.
@Dark_Shikari | specifically, there are three big things that can affect the definition of quality
@Dark_Shikari | 1) AQ being on/off
@Dark_Shikari | jump: ultrafast to superfast
@Dark_Shikari | 2) mbtree being on/off
@Dark_Shikari | jump: superfast to veryfast
@Dark_Shikari | 3) psy-rd being on/off
@Dark_Shikari | jump: faster to fast
@Dark_Shikari | above fast there are no more big jumps.

これは、同じ CRF 値で低速のプリセットを使用すると、ビットレートあたりの品質は向上しますが、品質とビットレートの両方が高くなったり低くなったりする可能性があることを意味します。

于 2013-01-13T21:47:11.423 に答える
5

ここで役立つ場合は、git diffからslowerまでveryfastです。値だけを考えても、品質が低下する可能性があることrefがわかります。veryfast

ref
In short, this value is the number of previous frames each P-frame can use
as references.

ソース

--- a/slower
+++ b/veryfast
@@ -1,20 +1,20 @@
 cabac=1
-ref=8
+ref=1
 deblock=1:0:0
-analyse=0x3:0x133
-me=umh
-subme=9
+analyse=0x3:0x113
+me=hex
+subme=2
 psy=1
 psy_rd=1.00:0.00
-mixed_ref=1
+mixed_ref=0
 me_range=16
 chroma_me=1
-trellis=2
+trellis=0
 8x8dct=1
 cqm=0
 deadzone=21,11
 fast_pskip=1
-chroma_qp_offset=-2
+chroma_qp_offset=0
 threads=12
 lookahead_threads=2
 sliced_threads=0
@@ -25,17 +25,17 @@ bluray_compat=0
 constrained_intra=0
 bframes=3
 b_pyramid=2
-b_adapt=2
+b_adapt=1
 b_bias=0
-direct=3
+direct=1
 weightb=1
 open_gop=0
-weightp=2
+weightp=1
 keyint=250
 keyint_min=23
 scenecut=40
 intra_refresh=0
-rc_lookahead=60
+rc_lookahead=10
 rc=crf
 mbtree=1
 crf=23.0
于 2013-01-13T18:12:56.393 に答える