[FFmpeg-devel] H.264 SEI handling vs. frame boundries

John Cox jc
Mon Mar 16 15:57:53 CET 2009


I think there is a problem with the way SEIs in H.264 are handled when
splitting the input into frames.  At the moment the frame breaker in
h264_parser.c seems to split on a new SPS, PPS or AU delimiter.  This means
that if an AU goes <SEI><PPS><coded slice data> the SEI turns up in the
previous 'frame'. The particular case where this is a problem is where the SEI
contains pic_struct.  In this case the pic struct gets applied to the frame
before the one it is meant to be applied to s.t. the repeat_pict count is
attached to the wrong frame.  Changing the 

            if(v==7 || v==8 || v==9){

in h264_parser.c:ff_h264_find_frame_end to 

            if(v==6 || v==7 || v==8 || v==9){

fixes the problem - but I'm assuming there is some reason why it wasn't written
this way?

I also don't understand why the values repeat_pict is set to in
h264_parser.c:parse_nal_units are one bigger than I would expect (and one
bigger than in the equivalent code in h264.c), but this doesn't seem to have
any effect so I guess it doesn't matter.


John Cox

More information about the ffmpeg-devel mailing list