[FFmpeg-devel] PES packet length

Trent Piepho xyzzy
Sun Dec 2 22:39:12 CET 2007

On Sun, 2 Dec 2007, [iso-8859-1] M?ns Rullg?rd wrote:
> "Werner Altewischer" <werner.altewischer at gmail.com> writes:
> > I notice that muxing an MPEG program stream sometimes gives a large overhead
> > (up to 5% of total stream size). I looked in the mpegenc.c file and it uses
> > a constant packet_size of 2048 bytes for any kind of stream. I assume that
> > increasing the packet size would lower this overhead.
> >
> > - Is this assumption true
> It's maths.
> > - Is it possible to increase this packet_size without consequences and if so
> It depends.  Such files would not be DVD-compatible, and could very
> well cause trouble for hardware decoders with small buffers.
> > what would be the maximum value?
> 65535

A video elementary stream, if in a transport stream, is allowed to have
variable length PES packets (the size field is 0) that are longer than
65535 bytes.  It's very common for HD broadcast tv.  One frame per packet
and the frames can be >> than 64k.

More information about the ffmpeg-devel mailing list