PDA

View Full Version : Bitrate calculation


FredThompson
3rd June 2003, 06:25
I'm looking for a calculator which will return a max bitrate when given the length of source, fps, and space alloted for the compressed file.

Everything I've found is either oriented towards CDRs or reducing a DVD rip in which case the destination size range available in the calculator is too low or too high.

For example: given 49m2s, 30fps, and 1.15G, what's the max bitrate?

There's obviously something I'm missing because:

1,150,000,000 bytes / ((49x60)+2) / 30 = 13029.7 bytes/frame

However, 49m2s 30fps encoded with a CCE bitrate of 3128 (3000 video, 128 audio) = 1.07G

Something isn't matching up.

29.97 fps and 1024^3 aren't enough to explain the calculation difference, I chose the easier numbers, this calculation doesn't have to be absolute perfect.

---update---

Bearson's calculator (in the downloads) does this.

Why is it still impossible to delete your own posts? Grrr....

ulfschack
12th June 2003, 10:28
Man, are you off :)

Firstly bitrate is measured in bits (not bytes) per second (not frame). Secondly even if it was bytes per frame you have an error of a factor ten by equalling 13029 to 3128 in CCE. But it's funny that you even came that close. I guess that lots of big errors make an almost right :)

(thirdly ... before you make that misstake) bitrate in encoders are almost always measured in thousands of bits not computer-kilo 1024.

Here's what I'd do if I had 1.15 GB (captal for Bytes and lowercase for bits) for video only:

1.15*1024^3*8/((49*60)+2)*1000)~ 3358 kbps (which is the number CCE is looking for). If you wanna cram in audio as well subtract the audio bitrate from this number and an overhead margin of maybe 2% for multiplexing A and V, just to be safe.


cheers

PS I know you found a calculator that does this for ya, but it doesn't hurt to have a comprehension of how it's done :)

FredThompson
12th June 2003, 15:46
Yeah, I knew parts of the math were sloppy and was really puzzled. Bearson's wasn't doing such a good job with the higer rates so I switched to the latest Java one from DVDRHelp. Knew I'd truncated 1024 to 1000 in the first part but didn't know about the "true" k=k for the bitrate.

I guess it was kind of dumb to think of bitrate per frame, huh? It's really just a data stream and the rates are used to define the heardware. How that stream is interpretted is another matter...

It's still a little puzzling to me that the calculators don't always give a proper result. I'm doing a lot of XSVCD encoding at around 2x SVCD standard max bitrate and find that multi-pass CCE sometimes returns a file significantly smaller than the calculated target size. Last night I was targetting 760M and the encode came out 730M.

ulfschack
13th June 2003, 10:41
That shouldn't be. CCE is extremely accurate. Try working it backwards from my formula above.

cheers

FredThompson
13th June 2003, 10:48
Think I've found the problem.

DVD2SVCD doesn't have an "idiot check" and you can have a maximum average bitrate that's greater than the maximum bitrate. CCE will run with it, also. The result isn't pretty. Looks like I changed the average and incorrectly thought I'd changed the max as well.

Tried adding that to the bugtracker for DVD2SVCD but the site wasn't working properly.