View Full Version : Bitrate on the first pass with x264
shutdown
11th May 2006, 12:59
Does it have a significance?
What I want to know - is it safe to change the bitrate on the second pass?
GodofaGap
11th May 2006, 13:12
Does it have a significance?
Yes, getting a good rate control depends on it. If you fill in a random number. You will not get optimal results.
is it safe to change the bitrate on the second pass?
You could of course get away with changing it a little bit, but don't double or half it in the second pass. There is no practical reason to do so anyway. (Perhaps only if you would want to do some testing and speed things up.)
shutdown
11th May 2006, 13:37
Thanks,
Yes only by a few Kbps, I made a small error calculating the bitrate to get a certain filesize.
I'm used to encoding xvid's - there this option on the first pass has no meaning...
While we're at it...
I understand that the target bitrate on x264 is exact - i.e if I put 1000 Kbps I get just that (or very close), as opposed to xvid where if I choose 1000 Kbps I get 1000/1.024. Is that correct?
While we're at it...
I understand that the target bitrate on x264 is exact - i.e if I put 1000 Kbps I get just that (or very close), as opposed to xvid where if I choose 1000 Kbps I get 1000/1.024. Is that correct?
That would depend on what you mean by 1000 kbps. I think that for both XviD and x264 it is 1 000 000 bps (just as it should be), not 1 024 000 bps, which you seem to use in your calculations if dividing by 1.024 gives the correct size.
Daodan
11th May 2006, 14:10
Maybe he is refering to the fact that with xvid sometimes you don't get the desired bitrate (even in two pass), which happens sometimes (I have variations in 100 kbps for 2h movie, which is quite a lot). x264 is very accurate, even for very short samples.
shutdown
11th May 2006, 14:17
That would depend on what you mean by 1000 kbps. I think that for both XviD and x264 it is 1 000 000 bps (just as it should be), not 1 024 000 bps, which you seem to use in your calculations if dividing by 1.024 gives the correct size.
What I mean is:
With xvid entering target bitrate of say 1000Kbps gives 1,000,000 bps (10^6)
While x264 calculating it with base 2 - if I enter 1000Kbps as target I get 1,024,000 bps (10^3 * 2^10)
And most information apps displays the bitrate with base 2.
What I mean is:
With xvid entering target bitrate of say 1000Kbps gives 1,000,000 bps (10^6)
As it should.
While x264 calculating it with base 2 - if I enter 1000Kbps as target I get 1,024,000 bps (10^3 * 2^10)
Are you sure?
And most information apps displays the bitrate with base 2.
Then they display it incorrectly. See http://en.wikipedia.org/wiki/Bits_per_second
Inventive Software
11th May 2006, 17:04
Perhaps x264's ratecontrol could be adapted for XviD?
TheFluff
13th May 2006, 14:33
I'm fairly certain that "k" in XviD's "kpbs" means 1024, not 1000. In DivX 5, however, it's 1000, not 1024. I'm not sure which one x264 uses...
Manao
13th May 2006, 14:57
No. Both use the correct definition of kbps, i.e. 1000 bit/s.x264:encoder/ratecontrol.c :
rc->bitrate = h->param.rc.i_bitrate * 1000;
xvid:vfw/src/config.h :
#define CONFIG_KBPS 1000
xvid:vfw/src/codec.c :
single.bitrate = codec->config.bitrate * CONFIG_KBPS;
pass2.bitrate = codec->config.bitrate * CONFIG_KBPS;
TheFluff
13th May 2006, 15:06
There we have it. I stand corrected.
Nicholi
13th May 2006, 16:13
Quite funny that you post that Manao, because TheFluff, a few other individuals, and myself were discussing bitrate and such only a few weeks ago. Everyone had heard/read/believed that XviD bitrate was calculated as 1 kilo = 1024, and DivX as 1 kilo = 1000. No doubts in our minds whatsoever.
I recall myself that this was posted many many times on the Doom9 forums, and many bitrate calculators were changed to behave "correctly." I have never seen someone say otherwise until now which confuses me. Just as an example, even now you could search 'xvid bitrate 1024' click Last and see tons of these threads with no one saying anything otherwise. Though these posts are over 4 years old it is still quite confusing, as that is when many of us learned the basics of XviD.
So umm, please could you or someone else re-verify? Since no one hopefully really uses XviD single pass lets just leave that for another discussion. XviD 2pass has always used 1k = 1000 for bitrate calculation? This was just a badly circulated false idea that 1024 was ever used?
Doom9
13th May 2006, 16:39
The difference in bitrate calculation in XviD versus other codecs has another reason entirely:
Only 3ivx and divx3 use 1k = 1024.
But, in XviD the bitrate you enter is not the raw video bitrate, bit the bitrate with AVI container overhead.
Nicholi
13th May 2006, 16:43
Well XviD's own correction for what container is in use was not really what I was getting at. I just originally believed that in calculating the bitrate xvid used 1000 for kilo. I suppose thats all clear though now, good to know that 3ivx and divx3 use 1024 bits though.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.