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

Michael Niedermayer michaelni
Mon Mar 16 17:44:05 CET 2009

On Mon, Mar 16, 2009 at 02:57:53PM +0000, John Cox wrote:
> Hi
> 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?

hmm i suspect your suggested change is correct, can you send a patch?

also a file to test this is welcome to verify that it does fix a bug

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090316/15bf859e/attachment.pgp>

More information about the ffmpeg-devel mailing list