[FFmpeg-devel] Passing Data from AVFrame to AVPacket

berkaydereli at yahoo.com berkaydereli at yahoo.com
Mon Jan 30 00:24:12 EET 2017

Hello devs, 

I have a quick question about passing data from AVFrame to AVPacket. Assume that we are encoding video and we have a custom metadata that needs to be handled in a frame accurate manner. The AVFrame can refer to this using the opaque pointer. However, due to the nature of video coding, the video packet that we get back when we encode video is not the frame that we have just pushed to a codec. In this case the packet and the AVFrame gets decoupled. 

What is the best practice to have a reliable flow of metadata from AVFrame to AVPacket?

More information about the ffmpeg-devel mailing list