[mythtv-users] Bitrate oddity

f-myth-users@media.mit.edu f-myth-users at media.mit.edu
Thu Jan 19 09:25:27 UTC 2006


I've just noticed that the claimed bitrates for MPEG-2 encoding seem
at least 10% lower than what's actually being written.  [And there's
question about how to reencode these way at the bottom of this...]
I don't see discussion about this in the archives anywhere.

I'm using PVR-250's/350's, w/bitrate of 4500 and max bitrate of 6000
(e.g., the defaults).  I typically record 64 minutes per 1h show
(e.g., I pre- and post-roll by 2m).  The resulting files are all
within 1% of 2,500,000,000 bytes (written this way so you know I
mean decimal bytes, e.g., 2.5 gigabytes and -not- 2.5 gibibytes.)

But if you actually do the math...

    > dc
    4500 1024 60 64 *** 8 / f
    2211840000

... it's pretty clear that 4500 kilobits/sec -should- be generating
only 2.2 gigabytes in 64 minutes.  (And that's assuming that the use
of "kilobits" in the UI really means 1024 bits, and not 1000 bits,
or the discrepancy is even larger.)

Is there some protocol overhead in the resulting files that's not
being accounted-for in the claimed bitrate?  And what exactly does
"max bitrate" mean?  I presume it means it allows bursts above 4500,
but how often?  Is there a limit to how often or for what length of
time this burst is allowed, or is in entirely dependent upon exactly
what's being encoded?  (This 2.5-gigabytes-within-1% behavior is
consistent across something like 50 hours of video.)

This tripped me up because I naively assumed that two 64-minute
recordings would easily fit on one 4.7 gigabyte DVD, but when I
looked at the file sizes just now, I discovered that they won't---
since each is actually 2.5 gigabytes.  (If I cut the pre & postrolls
off---currently painful in 18.1 because there's no easy way of
editing MPEG2->MPEG2, or am I mistaken?---then they'd -just- fit,
because 2.5 times 60/64 is 2.34 and twice that is 4.68---a squeaker.
Note that I'm planning on recording them as raw data files, not as
something playable directly in a DVD player.)

Obviously I can adjust my bitrate down slightly for future recordings 
(is there any particular reason that 4500 was chosen as the default?
does it match some other bitrate in something else, for example?),
but it's peculiar that this doesn't match.  (At least, since I know
how much bigger than I than I was expecting, I can calculate the
correct so-called "bitrate" in the UI, which works out to be about
4200 or less---but it's weird that it works this way.)

P.S.  Suppose I'd like to adjust the bitrate of the existing 50 hours
of recording down slightly, so I can easily get them on DVD's without
spanning.  I've seen lots of various tools fly by on the lists, but
it's still not clear to me what the easiest way of doing this is.
Does anyone have any suggestions for some easy, preferably scriptable
(e.g., command-line only) Linux-based tool that I can use to generate
slightly lower-bitrate versions of these files?  Thanks!  (I'd rather
not transcode them to MPEG4 until I figure out why that's giving me
audio at very low levels, and I'm -hoping- that whatever tool can
readjust the bitrate on these can -preserve- the closed-captioning
data currently in these (VBI sliced NTSC from the Hauppauge cards),
but don't know if that's too much to ask...  Or an easy tool that
I can use to cut, say, one commercial segment out of each, hopefully
again without destroying the CC info, but I'll take what I can get...)


More information about the mythtv-users mailing list