View Full Version : XviD's bitrate calc only for full-size rez?
absinthe
25th September 2004, 18:04
There's something I don't understand about the codec's built-in calculator.
I usually do encodes at a fairly large resolution (640 horizontal), and the calculator has always worked fine. But I notice that if I go into my script and resize down to half the size (say, change 640x480 down to 320x240), then go back into VirtualDub and go through the exact same process, I notice that the bitrate value comes out to be virtually the same, if not exactly the same.
Of course, if I encode, the movie comes out to be about half-a-CD in size. I've tried this several times.
What stupid thing am I doing wrong this time :rolleyes:, and does it by chance have anything to do with the 'Level' tab under "Profile@Level."
thx,
-abs
celtic_druid
25th September 2004, 18:17
The vertical component of 640x480 is 480.
The bitrate doesn't vary dependin on resolution, so if you change the resolution, but keep the desired size, length, etc. the same then it will always be the same bitrate. Possible that the codec is just saturated. If you quarter the resolution (320x240 is 1/4 of 640x480) then it does not require the same number of bits and depending on your settings may not be able to throw that many bits at it.
absinthe
26th September 2004, 02:31
Originally posted by celtic_druid
The vertical component of 640x480 is 480.
The bitrate doesn't vary dependin on resolution, so if you change the resolution, but keep the desired size, length, etc. the same then it will always be the same bitrate. Possible that the codec is just saturated. If you quarter the resolution (320x240 is 1/4 of 640x480) then it does not require the same number of bits and depending on your settings may not be able to throw that many bits at it.
Ok ... lost me. :confused:
Why is the vertical component more important?
How is 320x240 a quarter of 640x480?
What is the capital of New Guineau?
-abs
Doom9
26th September 2004, 02:41
How is 320x240 a quarter of 640x480? You gotta think in two dimensions. Sure 320 is half of 640 and 240 is half of 480, but in two dimensions, if you multiply two numbers A and B (= AB), then multiply the half of each of these numbers (1/2A * 1/2B = 1/4AB), you get 1/4 of the product of the original numbers - thus 320x240 is one quarter of 640x480 ;)
then go back into VirtualDub and go through the exact same process, I notice that the bitrate value comes out to be virtually the same, if not exactly the same. That's how it's supposed to be. What is a bitrate? It's the number of bits per unit of time, thus bits/second (of video). There's no resolution in bitrate, a bitrate is completely independent of the chosen resolution. So if you would get a different bitrate when changing the resolution, something would be seriously wrong. You can even change framerates and the bitrate would be unaffected - the only effect such a change would have is to change the number of bits allocated per frame.
Audionut
26th September 2004, 04:25
Unless of course you are using a constant quant.
Then the bitrate would drop when lowering resolution.
But as stated above, if you are encoding to a specific filesize, or bitrate, then no matter what resolution your video is, the bitrate will always be the same.
celtic_druid
26th September 2004, 04:28
You mean Papua New Guinea?
Port Moresby.
Here's one for you. What year did we (Australia) give it back?
Although vertical is probably more important, the reason that I pointed it out was because you said it was 640, which is the horizontal component.
absinthe
26th September 2004, 04:37
Ok, now wait a sec! :confused:
Now I understand the 2-D resolution math thing, but does this mean that a 1-hour video at, say, 1600 kbps with a resolution of 640x480 vs. the same video at the same bitrate and a resolution of 320x240 will take up the same amount of disc space? That doesn't seem to be true.
So bottom line, am I incorrect in thinking that I can make encodes smaller by using a smaller resolution? Say the source isn't that great to begin with, and I want to fit a whole 90-minute-or-longer movie on one CD ... are you saying I'd might as well go ahead and make it 640x480 or whatever? And if that's not the case, what factors do I vary to find the proper encode parameters?
Thanks!!
-abs
Audionut
26th September 2004, 04:48
A smaller resolution will require less bits for the same quality.
However, if you are encoding to a fixed filesize, or bitrate, the filesize will be the same.
Because you are telling the encoder to encode your video at that filesize.
Do this.
Determine your filesize and set the encoder to encode your video to that filesize. Which it sounds is what you are doing.
Encode a number of frames at 640x480, and then with the exact same encoder (xvid) settings, encode the same frames as your 640x480 test at 320x240.
Visually assess quality, and decide for yourself what is the best resolution to use.
Audionut
26th September 2004, 04:58
Originally posted by absinthe
640x480 vs. the same video at the same bitrate and a resolution of 320x240 will take up the same amount of disc space?
Yes because you are using the same bitrate.
Bitrate is what determines filesize.
If you were to set the xvid encoder to do a single pass at a constant quantinizer, then a smaller resolution would produce smaller files.
Because at a contant quant, the encoder allocates the bits of information needed to produce the target quantinizer.
absinthe
26th September 2004, 13:59
Originally posted by celtic_druid
Although vertical is probably more important, the reason that I pointed it out was because you said it was 640, which is the horizontal component.
Oops! ... looks like I sure did say that :p
Better edit that right now ...
-abs
absinthe
26th September 2004, 18:33
Okay, I think I've wrapped my head around this now.
Essentially, bitrate dictates filesize. So the exact same video with the exact same bitrate encoded at a smaller resolution will yield the same filesize, but should theoretically be of a higher visual quality than the larger resolution ... right? I.e. the bits don't have to be spread around as much.
So it is true that I can encode to a smaller rez, fitting a whole movie into a single 700 MB file, and have a better visual appearance than if I had tried to fit the whole movie on one CD at "full" resolution.
Ok, so is there a chart or some sort of unwritten standard for what bitrates produce "acceptable quality" (and I know that's an extremely subjective term) at various resolutions? For instance, I've always abided by the wisdom that bitrates for 640 horizontal rez shouldn't fall below 800.
{Question about predetermining filesize with constant Q edited out. ... I figured out you can do this with the calculator ... duh!}
-abs
Audionut
28th September 2004, 11:50
There are alot of factors that determine the final output quality.
Your best bet, is to encode how ever many frames you desire (the more the better) at full resolution, at your desired bitrate.
Assess Quality.
Make adjustments, as nessessary.
Here is an avisynth filter you might find usefull.
Removegrain (http://forum.doom9.org/showthread.php?s=&threadid=79751&highlight=removegrain)
stephanV
28th September 2004, 12:04
Originally posted by absinthe
Okay, I think I've wrapped my head around this now.
Essentially, bitrate dictates filesize. So the exact same video with the exact same bitrate encoded at a smaller resolution will yield the same filesize, but should theoretically be of a higher visual quality than the larger resolution ... right? I.e. the bits don't have to be spread around as much.
Not always... remember that resizing to a lower resolution also results in destroying detail. It is impossible to say which one is best... it depends on the source and your personal taste.
Ok, so is there a chart or some sort of unwritten standard for what bitrates produce "acceptable quality" (and I know that's an extremely subjective term) at various resolutions? For instance, I've always abided by the wisdom that bitrates for 640 horizontal rez shouldn't fall below 800.
A *very* rough method is the bit per pixel ratio: bpp = bit rate /(resolution*frame rate), the bit rate here is in bits/s (not in kbps)
a normal value for bpp would be something like 0.2 to 0.4
Another method is doing a compressibilty test, which is basically a quant 2 ecdoding over parts of the video and then take for example 60%-70% of the resulting bit rate.
{Question about predetermining filesize with constant Q edited out. ... I figured out you can do this with the calculator ... duh!}
No you can't, a constant quality encoding has an unpredictable file size.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.