1

My aim is to decode multiple frames of a video file, accumulate the decoded frames into a FIFO buffer and read them later on. I decode the packet to my AVFRame mFrame:

avcodec_decode_video2(mCodecContext,mFrame,&frameFinished,&mPacket);

Normally I can just copy the YUV frames from the mFrame->data[n][0] to my FIFO buffer but I am just trying to reduce the memcpy 's as much as possible. So instead of copying mFrame->data[n][0] I just want to store the mFrame (which is much smaller than the frames it points to) in the buffer and when it comes to reading I can just fetch it and reach the data.

I tried to do this but it did not work. The AVFrames are fetched from the buffer but when you show them on the screen the video is like frozen. You may think that I am using the same mFrame and overwriting it each time I decode a packet but I am not. I am creating a new AVFrame* each time in the decode loop.

Is this problem related to how avcodec works? Any ideas?

Thanks mike

user1175197
  • 379
  • 4
  • 7

0 Answers0