[FFmpeg-devel] [PATCH 2/2] Wrong bit rate in MPEG2 video file (Ticket #1862)

Michael Niedermayer michaelni at gmx.at
Tue Oct 30 02:40:33 CET 2012

On Tue, Oct 30, 2012 at 09:10:42AM +0900, Heesuk Jung wrote:
> Hi,
> I don't think that 0x3FFFF value is valid bit rate.

The mpeg2 draft i have says this:
D.9.11      bit_rate and vbv_delay

MPEG-1  -  bit_rate  and  vbv_delay  are  set  to  3FFFF  and   FFFF   (hex)
respectively to indicate variable bitrate. Other  values  are  for  constant
MPEG-2 - The  semantics  for  bit_rate  are  changed.  In  variable  bitrate
operation, vbv_delay may be set to FFFF (hex), but a  different  value  does
not  necessarily  mean  that  the  bitrate  is  constant.  Constant  bitrate
operation is simply a special case of variable bitrate operation.  There  is
no way to tell that a bitstream is constant bitrate  without  examining  all
of the vbv_delay values and making complicated computations.
Even if the bitrate is constant the value of bit_rate may not be the  actual
bitrate since bit_rate need only be an upper bound to the actual bitrate.

In practice on actual streams, independant of it being mpeg1 or 2
0x3FFFF is not a value for the average bitrate for any file i tested
so your patch is fine (it improves the correctness of the set bitrate)
and i have integrated it but i dont think we can
rely on the bitrate value to be the average even if its not 0x3FFFF


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121030/32a885ca/attachment.asc>

More information about the ffmpeg-devel mailing list