[FFmpeg-devel] How to pass metadata between filters

James Almer jamrial at gmail.com
Sun Feb 11 15:20:39 EET 2018


On 2/11/2018 9:31 AM, wm4 wrote:
> On Fri, 9 Feb 2018 18:43:11 +0000
> Mujib Haider <mujibh at xilinx.com> wrote:
> 
>> Dear ffmpeg-devel,
>>
>> I have a general question about the capabilities of avfilter.
>>
>> Is it possible to send meta-data between avfilters? Specifically, I want to create a filter to take a single input image, and produce a single output image along with metadata which encodes information about the image.
> 
> Currently only via the fields AVFrames provides. There's
> AVFrame.metadata, and also new side data types could be added for
> important enough things.

There's also AVFrame.side_data if the metadata he has in mind is not an
AVDictionary. This is apparently what vf_mestimate does to propagate
motion vectors.
New AVFrameSideDataType entries can be added if reasonable and useful,
assuming what he needs is not already defined.

Maybe even AVFrame.private_ref to store a pointer to some buffer, i
think, but using it requires some changes so the field is guaranteed to
be NULL before ownership of the frame leaves avfilter.


More information about the ffmpeg-devel mailing list