[Libav-user] Custom data in AVPacket or AVFrame

Nicolas George george at nsup.org
Tue Feb 15 15:53:27 EET 2022


laddoe (12022-02-15):
> 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
container level.

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.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20220215/457168c7/attachment.sig>


More information about the Libav-user mailing list