[Ffmpeg-devel] difference between av_read_packet() decoding and av_read_frame()

egf05 at doc.ic.ac.uk egf05
Tue Jun 20 20:13:04 CEST 2006


I see a different behaviour when decoding frames with the old and deprecated
av_read_packet() function and av_read_frame().
I need to decode mpeg frames from a video file. Using av_read_packet() to
reconstruct a frame, I can get the video frames correctly. I can retrieve in
AVFrame->data[0], data[1] and data[2] the three Y U and V buffers respectively,
and can save them as a jpeg image.
However, when I use the new av_read_frame() function, the AVFrame frames I get
are sometimes garbled, with squares. Actually, it seems they look like P frames,
with  blocks that correspond to changes compared to the last keyframe. Is it
normal? How to use av_read_frame() so that I could get "normal" decoded frames,
one by one ?


More information about the ffmpeg-devel mailing list