[Ffmpeg-devel] Handling decode delay

Mean fixounet
Sat Dec 30 17:44:52 CET 2006


       I want to have frame accuracy, and for that i need to fight^H^H^H 
handle the decoder delay.

       My current approach so far was to know the frame type and to use 
the LOW_DELAY flag, the PTS/DTS order being handled externally.

       It has been  working nicely so far.
       But it is a nightmare as far as h264 is concerned due to its 
complicated reordering. Too complicated to attempt to double guess
       what the actual decoder is doing/is wanting.

       My second guess would be to tag the "frame to be decoded" so that 
i can identity the corresponding decoded frame by looking for this tag.
       (the tag being for example the frame number in bitstream order).

       I've looked into coded_picture_number & display_picture_number, 
but i cannot use them.
       They are ok in a sequential way of decoding files, but if you go 
back or repeat a section they are not longer relevant (same story if you
          jump to another place in the stream, you will want to discard 
the delayed frames that were from the previous  part).

       My feeling would be to add an uint32_t field to avframe which is 
copied into current picture when calling the decoder.
       It is the simplest way i've thought of, but i probably missed 

       Any hint/suggestion ?


More information about the ffmpeg-devel mailing list