Lik wrote:
On Wed, 31 Jan 2007 19:33:32 +0100, Andrea Giuliano <[EMAIL PROTECTED]> wrote:

Dear all,

I hope this is not a trivial question!

I'm creating xvid movies from several sources, but i would like to know, at least approximately, how big the resulting files will be, given the bitrate, the frame size, and so on.

I usually do two pass encoding, which I guess makes more difficult to calculate this size, but maybe there is a way.

Any hint will be very appreciated.

Best regards.


Hi Andrea,
ok i'll share some experiment results i obtained making some tests compressing several movies with divx5 2-pass (i think xvid is quite the same). I've made these tests many years ago and at that time the formula worked fine. :)

the final formula i got is this one:

videobitrate = (1024*1024*finaldim - synchbitrate*length - audiobitrate*128*length*0.9765625 + base) / ( kscarto + length*128 );

Quite a tough formula, indeed! Complimenti!


where:
videobitrate is the video bitrate in kbps you have to pass to the codec;
finaldim is the final file (the one you want to create) dimension in MB;
length is the movie length in seconds;
audiobitrate is the audio stream bit rate in kbps;

and where the constants values are:
const long double kscarto = 18153.4591194968553459119496855346;

Hmmm, I'm in doubt as far as the 18th decimal of kscarto is concerned... Are you sure it's correct? :-)

const int base = 3703801;
const int synchbitrate = 604;

Of course in this result there is no theory at all, it was achieved just trying some compressions. Let me know if it works.

Seriously, it seems not to be so trivial as I thought. I discovered this very evening that "-w'-700000'" could be used with transcode to get a file of exactly 700.000 bytes, for which transcode determines the right bitrate, both with one or two pass encoding. Unfortunately, transcode does not tell me what actual bitrate nor bpp it used during encoding, so your formula could be a way to figure out how good is the result before playing back it to see how it seems.

Thanks anyway for the formula, I'll make some experiments and let you know if it works.

Ciao!


ciao,
lik
--Non sono fiero di molte cose terribili che ho fatto... e quelle di cui vado fiero sono molto peggio!
            - Boe



--
Andrea

Reply via email to