[MPlayer-users] h.264 packetization and decoding

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Feb 9 00:22:02 CET 2016


I kind of don't think discussing mpv and libavcodec belongs on this
list, so I think you'll have to look for help elsewhere beyond
a few hints.

On Sun, Feb 07, 2016 at 09:15:54AM -0800, Ratin wrote:
> I send complete (non-FU-A) SPS, PPS, SEI
> frames in their individual chunks and I combine all Fragmented IDR and P
> frames (FU-A) into one chunk after re-constructing them per h.264 spec.

Not sure how you mean that, but if you put the SPS/PPS/SEI in packets
separately from the frames that won't work.

> My question again is why it dumps  first 879322 in one chunk in the
> beginning, what logic does it use to determine the boundary? How does
> libavcoded handle a huge packet of this size 879322 bytes while I am
> getting some kind of buffer overflow (green overlay is an indication of
> that)?

The packetization rules are in libavcodec/h264_parser.c.
And it has nothing to do with overflow, you're just confusing
the decoder (particularly the reference frame tracking) with the
input it gets, probably triggering error concealment (which
normally should result in grey, not green though, unless you
overwrite some buffers with 0s when you shouldn't).


More information about the MPlayer-users mailing list