View Full Version : Constant Quality with Fixed File Size
Half-Light Agent
19th July 2013, 09:50
What is the effect of adding a fixed file size on an x264 Constant Quality encode in MeGUI? Other than limiting the file size.
Answer: MeGUI ignores the CRF and calculates and uses an ABR to fit the file size.
Groucho2004
19th July 2013, 10:46
Constant quality and fixed file size are mutually exclusive since every video source has different bitrate requirements for a given (perceived) quality.
Half-Light Agent
19th July 2013, 13:09
What does that translate into though, in encoding an x264 at, for example, Constant Quality 18 for 120 minutes and a file size of 900MB?
On the level of bitrate that is roughly 1000k. Will the x264 encoder ignore the CRF and treat the job as a 1000k encode, or will it somehow use the CRF within the prescribed file size?
Groucho2004
19th July 2013, 13:42
What does that translate into though, in encoding an x264 at, for example, Constant Quality 18 for 120 minutes and a file size of 900MB?
On the level of bitrate that is roughly 1000k. Will the x264 encoder ignore the CRF and treat the job as a 1000k encode, or will it somehow use the CRF within the prescribed file size?
Not quite sure what you're asking but maybe this helps:
If you use CRF encoding, the resulting bitrate (and therefore file size) is largely unpredictable. Bitrates can easily vary by a factor of 10 at a given CRF, depending on the source material.
Will the x264 encoder ignore the CRF and treat the job as a 1000k encode, or will it somehow use the CRF within the prescribed file size?
What's "prescribed file size"?
Half-Light Agent
19th July 2013, 14:11
As you note, the bitrate and resultant file size of CRF encodes can be very large. On the other hand MeGUI offers the option to specify a file size target. I am wondering what the effect is on the encoding job, when a Constant Quality encode is limited to a specific file size. Is the CRF mode ignored, and instead the job is treated as an ABR encode, or is the CRF mode somehow modified to fit the file size?
Groucho2004
19th July 2013, 14:38
As you note, the bitrate and resultant file size of CRF encodes can be very large. On the other hand MeGUI offers the option to specify a file size target. I am wondering what the effect is on the encoding job, when a Constant Quality encode is limited to a specific file size. Is the CRF mode ignored, and instead the job is treated as an ABR encode, or is the CRF mode somehow modified to fit the file size?
If you're targeting a certain bitrate (through "--bitrate" switch), the resulting quality depends on the source material.
Have a look at this thread (http://forum.doom9.org/showthread.php?p=1589841), it should answer all your questions.
Half-Light Agent
19th July 2013, 15:03
I understand that ABR has a predictable file size, while CRF does not. That is what makes me wonder what happens when a fixed size is set for a CRF. Assuming that the source and encoding settings would result in a file size too large to fit, what happens then?
For example:
A 720p, 8mbit/s source of 120 minutes.
A MeGUI\One Click\Video\x264\CRF 18 encode kept at original resolution.
A MeGUI\One Click\Output\File size of 900MB.
At 900MB, the file has a maximum bitrate of 1mbit/s. A CRF 18 will not fit, but the encode finishes successfully with a file of 900MB.
detmek
19th July 2013, 17:14
But, you can not set the fixed size for CRF. And if you set a fixed size (bitrate) you can not use CRF.
Selur
19th July 2013, 21:06
dum, di, dum,.. since crf and 2pass use the same rate control and the quality of a crf and a 2pass encode for the same file size is about the same, shoudln't "Constant Quality with Fixed File Size" simply be the same as a normal 2pass encode?
Half-Light Agent
19th July 2013, 22:05
Yes, you can set a fixed file size for a CRF in MeGUI as per above example. Try it.
@Selur: this is what I'm mumbling about. I don't know what happens to make a CRF fit a file size.
detmek
19th July 2013, 22:06
Well, it should. But it shouldn't be named "Constant Quality with fixed file size". CRF is not "Constant Quality" but "Constant Rate Factor". We just like to call it "Constant Quality". And one can not specify --crf xx --bitrate xxxx. Or in profived example --crf 18 --bitrate 1000.
The point is - one can not set file size for CRF. Every file size setting in GUI is translated to --bitrate for x264 encoder. And --bitrate excludes --crf.
So, with refference what Selur said, if one sets CRF file size iz unpredictable and if one sets file size (bitrate) CRF is unpredictable.
Edit:
No, you can not set fixed file size for CRF in MeGUI. If you choose x264 profile with CRF and set file size in MeGUI window, CRF is replaced with appropriate bitrate. Check your log files after (or during) encoding.
sneaker_ger
19th July 2013, 22:23
Regardless of what is possible to set in the MeGUI GUI: x264 simply does not support combining CRF (--crf) and ABR (--bitrate), so it definitely does not work.
Half-Light Agent
19th July 2013, 22:30
When you set Const. Quality x264 encode AND fixed file size output in MeGUI (as per my earlier example), MeGUI ignores the CRF and calculates and uses an ABR to fit the file size?
raffriff42
19th July 2013, 22:57
> When you set Const. Quality x264 encode AND fixed file size output in MeGUI
Could you please post screen shot(s) showing how you do this exactly?
Half-Light Agent
19th July 2013, 23:03
@riffraff42: I could, but it seems that for the actual encode MeGUI ignores the CRF and switches to ABR instead to achieve the target file size.
raffriff42
19th July 2013, 23:05
Because see post #2. Third base!
Half-Light Agent
19th July 2013, 23:10
Third base?
raffriff42
19th July 2013, 23:26
Abbot and Costello. "Who's on first?" Old time comedy routine. I thought it was well known enough to be understandable. My remark was an attempt to humorously convey my impression that this discussion is going around in circles.
https://www.youtube.com/watch?v=kTcRRaXV-fg
Half-Light Agent
19th July 2013, 23:35
Understood. :)
As to the discussion on a loop - I think it broke when it became clear that what is possible in an interface and what is possible in reality are not the same.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.