Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#1 | Link |
Registered User
Join Date: Jun 2012
Posts: 70
|
Estimating/Predicting CRF bitrate or file size
As the title says, is it possible to estimate beforehand the expected bitrate or file size of a given encode at a given CRF factor??
The reason I ask is because I would like to estimate the output size of an encode at CRF 20 for example, then actually encode the video in a size based 2-pass mode. I am not trying to keep the encodes below a certain file size, but rather, trying to maximize quality at the best file size possible. So encoding in 2-pass without a quality reference would be flying blindly. That's why I rely on a constant quality CRF pass to get the needed bitrate for a 2-pass encode to achieve a certain level of quality. But as you can imagine, this is a very slow and time/resources consuming approach. This is why I'm looking for some kind of estimation method or quick virtual CRF pass that estimates the bitrate quickly without actually encoding the video. Thanks. P.S: Please, let the CRF vs 2-pass debate for another thread. To me, based on the testing that I've done, 2-pass produces slightly better (but pretty noticeable) quality than CRF at a given bitrate. |
![]() |
![]() |
![]() |
#2 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
That's what I do mostly. I run a compressibility pass with a certain CRF value on about 5%-10% of the source which gives me a pretty accurate number for the required bitrate.
__________________
Groucho's Avisynth Stuff |
|
![]() |
![]() |
![]() |
#3 | Link |
Registered User
Join Date: Jun 2012
Posts: 70
|
Yes, I know. I don't mean estimating in general. I am asking about estimating the bitrate of the output of a CRF n encode of a specific source, and not the bitrate of CRF n in general.
Hmm.. Does this really work? I mean the source has to be really monotone for this to work, which is hardly the case in real-life videos. |
![]() |
![]() |
![]() |
#4 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
Obviously you have to use something like SelectRangeEvery(1000, 100) in Avisynth (select 100 out of every 1000 frames). It's quite accurate even with just 5%.
__________________
Groucho's Avisynth Stuff Last edited by Groucho2004; 4th September 2012 at 17:43. |
|
![]() |
![]() |
![]() |
#6 | Link |
Registered User
Join Date: Jun 2012
Posts: 70
|
Can u elaborate further? I'm not very savvy in Avisynth. Can you suggest a sample script. Also, what do you feed the script into? I for example encode in Avidemux, so what I would need to do is feed the mentioned script into Avidemux instead of the actual video, right?
|
![]() |
![]() |
![]() |
#7 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
Can't help you with GUIs, never used any, sorry.
__________________
Groucho's Avisynth Stuff Last edited by Groucho2004; 4th September 2012 at 21:48. Reason: typo |
|
![]() |
![]() |
![]() |
#8 | Link | |
Registered User
Join Date: Jun 2012
Posts: 70
|
Quote:
Code:
DirectShowSource("input.mkv", audio=false, fps=23.976) SelectRangeEvery(1000, 100) |
|
![]() |
![]() |
![]() |
#9 | Link |
Registered User
Join Date: Jun 2012
Posts: 70
|
When you say --bitrate (obtaind from the first pass), is there anyway to get this automatically? If not, then this method beats the purpose of an overnight 2-pass encode. If I have to wait for the result of a full single CRF pass anyway, then I might as well use the bitrate in a full additional 2-pass overnight encode.
|
![]() |
![]() |
![]() |
#10 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Yes, as simple as that.
__________________
Groucho's Avisynth Stuff |
![]() |
![]() |
![]() |
#11 | Link | |
Registered User
Join Date: May 2006
Posts: 957
|
Quote:
I don't know why you would run a slow first pass with crf and then (on average) get the same result again on the second pass.
__________________
x264 log explained || x264 deblocking how-to preset -> tune -> user set options -> fast first pass -> profile -> level Doom10 - Of course it's better, it's one more. |
|
![]() |
![]() |
![]() |
#13 | Link |
Guest
Posts: n/a
|
Which isn't possibly true if you really did encode with CRF and 2-pass with the same settings and both were at the same bitrate. 2-pass uses the CRF algorithm to encode it just selects the appropriate CRF value for the bitrate you specified. You've basically tried to claim that CRF is inferior to itself which is a nonsensical statement.
Last edited by SassBot; 4th September 2012 at 22:03. |
![]() |
![]() |
#14 | Link | |
Guest
Posts: n/a
|
And you don't have to take my word for it. From Dark Shikari's mouth:
Quote:
|
|
![]() |
![]() |
#15 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
He's using a "GUI" so that might explain different settings. I can imagine that these programs tend to hide certain settings from the user because the programmer thinks that an inexperienced user should not touch them. I don't know avidemux so this is just a hypothesis.
__________________
Groucho's Avisynth Stuff |
![]() |
![]() |
![]() |
#16 | Link | ||
Guest
Posts: n/a
|
Quote:
Quote:
Last edited by SassBot; 4th September 2012 at 22:39. |
||
![]() |
![]() |
#17 | Link | |||
Registered User
Join Date: Jun 2012
Posts: 70
|
Quote:
Quote:
![]() Well, anyways Mr. Sass, I am very much aware of the point you made, having read extensively about this matter. Actually, I had even spent some good time reading the thread you quoted Dark Shikari's post from. Nevertheless, it seems a lot of people are still unconvinced with your claims. I for one am neither convinced nor unconvinced. I am skeptical, and I am running trials to find out myself. Which brings me to my second point: both my CRF and 2-pass encodes were done with the same settings. I am using a GUI, but I am not aware of any settings it's hiding. So as far as I can tell, both encodes have the exact same settings. Quote:
Anyways, I've ran an ABX test (15 trials), and I scored right 15/15, so trust me, I see a difference. Anyways, I am willing to accept your claims if you care to explain them further. If 2-pass and CRF are the same, does that mean that the first pass of a 2-pass encode is simply running to determine the "n" needed for the given bitrate or size, and the 2nd pass is nothing more than CRF n ?? Also, what's the precision of "n"?? If it's an integer, then your whole claim is nonsensical. If it's a single float, then it might hold some truth to it, though that would still be inaccurate to hit a given target bitrate. So what is it? CRF n or n.x or n.xy or what? In the GUI I use, I can only specify integer as CRF's argument. And before you even go there, this has nothing to do with my trial. I encoded in CRF first, and then used the output's bitrate in 2-pass, and not the other way around. |
|||
![]() |
![]() |
![]() |
#18 | Link | ||
Registered User
Join Date: Jun 2012
Posts: 70
|
Also, Sass, this from the same thread you quoted:
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#19 | Link | |||||||
Guest
Posts: n/a
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
It's highly doubtful that the "small difference" is even remotely visually perceptible. Quote:
Last edited by SassBot; 5th September 2012 at 04:28. |
|||||||
![]() |
![]() |
#20 | Link | |||
Registered User
Join Date: Jun 2012
Posts: 70
|
Quote:
This is not "CRF gives same quality as CQ", this is "CRF = 2-pass because 2nd pass is CRF", and thus, one shouldn't see a difference even in a still frame, right? Quote:
Or does it not use them in the 2nd pass, in which case, why are they left over then? Quote:
Also, how can I check the CRF value of an already encoded file? MediaInfo seems to only provide a rounded integer value. This admittance is what confuses me. I mean I do want to believe, and you make a good scientific argument, but then, you acknowledge the presence of differences that are "small" and that are "visually imperceptible". How can there be differences if it's CRF x CRF? Doesn't CRF = 2-pass mean that the 2 encodes should be identical even on the PSNR level? Last edited by Makaveli84; 5th September 2012 at 11:19. |
|||
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|