Brief description of AVFrame structure

AVFrame structure

Function description

AVFrame is a structure used by ffmpeg to store uncompressed audio and video raw data

Use matters

1. The AVFrame creation must use the av_frame_alloc() function to create the structure. The structure does not initialize the memory, but only initializes itself.
2. AVFrame is a typical structure that is created once and can be reused continuously. You need to call av_frame_unref() after each taking to release the references to other structures to ensure that they can be reused next time.
3. You can use av_frame_move_ref() to copy the references between AVFrames, and reset the reference data of src after copying.
4. To release AVFrame, av_frame_free() must be used.

Guess you like

Origin blog.csdn.net/jiabailong/article/details/103582677