View Full Version : 2Pass VBR vs Constrained CRF modes, differences?
TEB
13th March 2018, 18:18
hi! What is the real difference between:
1. 2Pass VBR with a max min avg level, example 8mbps max, 4mbps avg.
2. Constrained/Capped CRF mode, (example: CRF22 with with a max bitrate of 8mbps
Im fully aware that different types of content will give different results, but in general what are the pros and cons with both methods from a quality perspective ?
/TEB
Asmodian
13th March 2018, 18:51
1) can target a specific bitrate.
2) cannot target a specific bitrate.
TEB
13th March 2018, 19:58
1) can target a specific bitrate.
2) cannot target a specific bitrate.
Thx for the anwser, but im fully aware of this, hence i wrote :
"pros and cons with both methods from a quality perspective ?"
jpsdr
14th March 2018, 10:04
If both result files have the same size, it's been always told that there will be no differences, because it's the same algorithm/method used in both cases.
I've nevertheless noticed a difference, not in quality, but just in the result log files.
Even if both cases are encoded with "--direct auto", and with the same parameters except the CRF/VBR part, in the result log file, i've noticed that for CRF mode, i've always a result like "Spatial : 100% Temporal : 0%".
But, in 2 pass encode, the 1rst pass is also always "Spatial : 100% Temporal : 0%". but the 2nd pass i've a "Temporal" which is not at 0. I can have for exemple "Spatial : 95% Temporal : 5%".
For now, i have the feeling that if you are in a one pass mode, you'll never access to "Temporal". No idea how it affects quality, and what exactly is or how things are impacted.
Selur
14th March 2018, 10:07
There have been discussions about this before and iirc. assuming the output file size is the same overall quality should be nearly the same, on some frames crf will look better and on some 2pass will look better.
Sharc
14th March 2018, 10:16
I understand that there are subtle differences, but you will usually not see these when watching, unless perhaps when one applies a too strict limitation of the max. bitrate / buffer control in CRF mode.
So for equal file sizes and same encoder settings the quality will be very much the same (identical). There is no clear winner as I understand it. So nothing to worry about.
Sharc
14th March 2018, 10:34
I've nevertheless noticed a difference, not in quality, but just in the result log files.
Even if both cases are encoded with "--direct auto", and with the same parameters except the CRF/VBR part, in the result log file, i've noticed that for CRF mode, i've always a result like "Spatial : 100% Temporal : 0%".
But, in 2 pass encode, the 1rst pass is also always "Spatial : 100% Temporal : 0%". but the 2nd pass i've a "Temporal" which is not at 0. I can have for exemple "Spatial : 95% Temporal : 5%".
This could just be a consequence of the "fast 1st pass" setting, I think.
I would assume that with "slow 1st pass" the result for spatial/temporal would be the same.
jpsdr
14th March 2018, 14:32
No, i'm not using fast 1st pass. And, as i said, there is also this 100% 0% on CRF encode with the same parameters than the 2nd pass, where there is not anymore 100% 0%.
TEB
14th March 2018, 20:56
I did some tests the other day with a Prores source, comparing 2pass VBR, constrained CRF and CRF "free". CRF Free won the SSIM tests overall and had the smallest filesize as a end result of the 10000 frames in my testcase. 2pass VBR actually came up ontop of CRF constrained within the same bitrate limits.
So to conclude from my perspektive.. CRF "free" gives the encoder the ability to maximize its ratecontrol to the fullest and best way, whilst constraining it (restricting it) gives a worse result than 2pass VBR
Sharc
14th March 2018, 23:04
No, i'm not using fast 1st pass. And, as i said, there is also this 100% 0% on CRF encode with the same parameters than the 2nd pass, where there is not anymore 100% 0%.
Maybe this is the explanation (https://forum.doom9.org/showpost.php?p=1113961&postcount=30). In CRF there is a first pass only, hence --direct auto defaults to ????
Edit:
b.t.w. x264 in 2-pass VBR mode defaults to "fast 1st pass". One has to specify explicitly "--slow-firstpass" when the same encoder settings should apply for both passes.
Sharc
14th March 2018, 23:11
I did some tests the other day with a Prores source, comparing 2pass VBR, constrained CRF and CRF "free". CRF Free won the SSIM tests overall and had the smallest filesize as a end result of the 10000 frames in my testcase. 2pass VBR actually came up ontop of CRF constrained within the same bitrate limits.
So to conclude from my perspektive.. CRF "free" gives the encoder the ability to maximize its ratecontrol to the fullest and best way, whilst constraining it (restricting it) gives a worse result than 2pass VBR
I think this makes sense because only 2-pass has the global view for bitrate distribution and optimum placement of I,B and P frames, which may pay off in bitrate constrained scenarios.
sneaker_ger
14th March 2018, 23:34
Placement of I/B/P doesn't change in second pass.
Sharc
15th March 2018, 00:22
Placement of I/B/P doesn't change in second pass.
Yes, but it can be different for CBR (1-pass) and 2-pass VBR encoding.
Moreover, it is very difficult to obtain exactly the same file size for CBR and 2-pass VBR mode, for a comparison.
Selur
15th March 2018, 12:27
When did this change to CBR ? I thought the discussion is about CRF.
hello_hello
15th March 2018, 13:09
The way I understand it, CRF has to guess as to the quality of the I-frames, whereas 2 pass doesn't, but on the other hand, CRF doesn't have to make any quality adjustments to achieve a particular bitrate whereas 2 pass needs to make quality adjustments as encoding progresses if the target bitrate isn't going to be achieved.
I've only ever seen CRF look worse than 2 pass when using a ridiculously low bitrate on a source with a complex opening scene. I have seen 2 pass give the ending credits of a long encode a fair bit more bitrate than CRF to achieve the requested file size.
The best explanation I've read regarding x264's rate control methods is here:
A qualitative overview of x264's rate control methods (http://git.videolan.org/?p=x264.git;a=blob_plain;f=doc/ratecontrol.txt;hb=HEAD)
Although I had a bit of a hard time wrapping my head around it initially, so I re-wrote it in a more logical manner for my brain to digest. My re-written version can be found here:
https://forum.videohelp.com/threads/381668-would-it-make-more-sense-to-use-1-pass-encoding-instead-of-2-with-x265#post2470457
Selur
15th March 2018, 17:12
Nice, didn't know your summary over at videohelp. Liked it. :)
Sharc
15th March 2018, 17:38
When did this change to CBR ? I thought the discussion is about CRF.
Sorry, I meant CRF of course ....
Sharc
15th March 2018, 18:05
I've only ever seen CRF look worse than 2 pass when using a ridiculously low bitrate on a source with a complex opening scene. I have seen 2 pass give the ending credits of a long encode a fair bit more bitrate than CRF to achieve the requested file size.....
I remember I have seen 2-pass to produce less color banding on flat scenes. Not sure whether this observation can be generalized though. 2-pass was also slightly superior for fast (relaxed) encoder settings. VBV/maxbitrate constrains have already been mentioned.
I did such test quite some years ago, so the differences might be lower now due to x264 development progress since.
TEB
23rd March 2018, 18:52
thx for a nice and constructure discussion ;)
Anyone compared CRF to other Constant Quality modes? (QP)?
I heard that CRF is more optimized with regards to high temporal motion vs. QP... I may be mistaken..
poisondeathray
23rd March 2018, 20:09
Anyone compared CRF to other Constant Quality modes? (QP)?
I heard that CRF is more optimized with regards to high temporal motion vs. QP... I may be mistaken..
"QP" is not "constant quality". It's constant quantizer
Efficiency wise --qp is worse. Quality is lower if you measured various encodes at equivalent final bitrate. It also means things like AQ (adaptive quantization) are disabled. AQ is one of the big strengths in many encoding scenarios
Asmodian
23rd March 2018, 23:03
I still think my answer is the only thing you can say, from a quality perspective. At the same size CRF and 2pass VBR provide equivalent quality with the only significant difference between the two being the ability to target a final size or not.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.