Quote:
HTH. |
@kwag
I tried (manually, with a calculator) your method for CQ prediction and I got the perfect result of 19.9 with just three encodes. It would've taken me at least double that by guesswork alone :!:. Since I've finished porting Blockbuster to YV12, I think I'm going to start implementing the wizard tonight... |
@kwag:
I just did a one-disc of American Pie using CQ 19.9 and a scale factor of 0.95. Sample size was 13mb, audio is 87mb, but the final muxed encode came out at 761mb. That's out by 36mb 8O. I'm trying again with a scale factor of 0.93... What do you think may have gone wrong? Script: Code:
AudioDub(Mpeg2Source("ap.d2v"), WavSource("ap.wav")) |
Quote:
-kwag |
Quote:
If you took a desired encode size of, say, 797mb, but wanted to leave a little room for insurance, multiplying it by 0.95 would make it smaller. Dividing it by 0.95 would make it bigger. Try it in KVCD Predictor. When you lower the scale factor, the target size increases. This is because you're dividing by a number less than 1. If we multiplied by the scale factor, then lowering it would cause a corresponding decrease in the target size. I'm going to go revisit that formula and do a proper rearrangement and see what I come up with. |
Houston, we have a problem -- or, at least, I do ;).
The original formula, slightly simplified, is: final_size = secs / 100 * scale_factor * sample_size Let's assume for the moment that the scale factor is 1. This gives us: final_size = secs / 100 * sample_size Now, since the sample_size represents the encoded size of 100 clips 1 second in length, we could say that: sec_size = sample_size / 100 where sec_size means "average size of 1 second of the movie". We can then represent the formula as: final_size = secs * sec_size Which is to say, the final size will be the size of an average second times the number of seconds in the movie. Now, the reason for the scale factor was to provide for some insurance, a little headroom in the calculation. To this end, and assuming we want to use 0.95 to mean 95% of full capacity, we would multiply the left-hand side of the equation by the scale factor: final_size * scale_factor = secs * sec_size Or, rearranged: final_size = secs * sec_size / scale_factor And, expanded: final_size = secs * (sample_size / 100) / scale_factor Thus when we decrease the scale factor, the final size also decreases. When we increase the scale factor, the final size also increases. In that case the formula KVCD Predictor should be using is: sample_size = final_size * scale_factor / secs / 100 This is the formula used in 0.1a. Thoughts? |
Quote:
Sample Size = ((Total frames/Framerate)/100) * (MPEG sample file size * .95) Where increasing the factor, in this case .95, increases file size. Edit: ( And I'm not drunk, yet! :P ) Final MPEG Predicted Size = ((Total frames/Framerate)/100) * (MPEG sample file size * .95) -kwag |
Hi SansGrip!
I want to thank you for all the GREAT filters and also for the KVCD Predictor! But I just got confused now... Quote:
As the scale factor is dividing the whole thing, when we decrease the scale factor, the final size increases, because we are dividing by a smaller value. And that's not the way the formula should behave. I think that the error is here: Quote:
Just to illustrate: If we want 95% of X and X=100, we have to multiply 100 (that's the X value) by 95%, in order to get 95. If you divide by 95% you will get ~105.26, and that’s not the 95% that we want. Well, please excuse me for the bad english. And excuse me if I'm completely wrong... because it's 3:30AM here, and according to kwag, I could be drunk by now. :wink: :lol: |
Quote:
|
Quote:
Correction here: Final MPEG Predicted Size = ((Total frames/Framerate)/100) * (MPEG sample file size * .95) ( And I haven't had a beer yet. Wonder what I would write with a couple of beers :P ) Thanks muaddib, -kwag |
BTW, I think that the scale factor (.95) is just a correction for an "almost" constant accuracy error in the formula. The aim here is to get a perfect file to fill the CD completely. Isn't it, kwag?
|
Quote:
-kwag |
Nope, I'm the one who's drunk :D. I should've run some real numbers through and I would've spotted the error.
I think what's confusing me is that when you adjust the scale factor down in KVCD Predictor, the sample target size goes up, and vice versa. Is that the correct behaviour? I've been thinking way too much about noise and averages today to think properly about anything else ;). |
Quote:
|
Quote:
It should be the other way around. When you increase the factor, the file size goes up ;) -kkag |
Quote:
final_size = (secs /100) * (sample_size * scale_factor) so that MPEG sample file size is isolated on one side. Here's my attempt: final_size / (secs / 100) = sample_size * scale_factor final_size / (secs / 100) / scale_factor = sample_size And this is the formula used in KVCD Predictor. If you feed some numbers into it (movie is 5728 seconds, audio is 87mb, media is 797mb): sample_size = 710 / (5728 / 100) / 0.95 = 13.04 sample_size = 710 / (5728 / 100) / 0.90 = 13.77 sample_size = 710 / (5728 / 100) / 1.05 = 11.80 As you can see, the sample size rises when the scale factor falls, and vice versa. Either this is the correct behaviour when obtaining the sample size from the final size, or my rearrangement of the formula is wrong, or the formula itself is wrong. :) |
Quote:
|
Quote:
So the meaning is clearer, and then 5 would be +5% and make the file 5% larger, and -5 would mean -5%, and make the file 5% smaller :idea: Instead of 0.95 or 1.05 etc. -kwag |
Quote:
Code:
// This is a very simple program to calculate what the final file size of the |
Silly Question
I don't understand what the "sample size" is meant to indicate. I was expecting to see a number reflecting the final file size if I were to use template X, Y or Z, given the AVI information. AM I meant to derive this final number from the sample size number that is indicated?
|
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.