[Libav-user] Custom data in AVPacket or AVFrame
george at nsup.org
Tue Feb 15 15:53:27 EET 2022
> I want to add a custom number to either an AVFame or an AVPacket
> before I encode it and I want to retrieve it back when I decode it. I
> have tried using the AVFrame/AVPacket metadata or side_data but I
> guess I don't understand how to get it to work.
Since you want your data to be carried from encoder to decoder, it needs
to be present in the encoded output, either in the bitstream code or at
Therefore, you must first choose a codec or a format that allows to
store arbitrary user data on a per-frame basis. This is not specific to
FFmpeg. You will need one that meets your other constraints, which you
have not stated.
Then you must make sure FFmpeg supports the per-frame data for this
container or codec.
You gave very little information on what you want to achieve. Odds are
you do not really need this at all.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: not available
More information about the Libav-user