Home

AVDictionary

AVDictionary is a lightweight, string-based key-value store used in FFmpeg’s libavutil to hold metadata and option pairs. It is designed for simple transfer of attributes between components such as demuxers, muxers, and codecs.

Internally it is implemented as a hash table of AVDictionaryEntry entries, each with a char* key and

Common operations include av_dict_set() to insert or replace a pair, av_dict_get() to fetch a value by key,

Flags control behavior, including case sensitivity and whether to duplicate strings or append to existing values

In practice, a dictionary is initialized as NULL, populated as needed, and passed through FFmpeg components

a
char*
value.
The
API
governs
memory
management;
keys
and
values
can
be
duplicated
or
borrowed
depending
on
flags
used
when
inserting.
av_dict_count()
to
report
the
number
of
entries,
and
av_dict_free()
to
release
memory.
Parsing
helpers
such
as
av_dict_parse_string()
convert
between
text
and
dictionary
form.
(AV_DICT_APPEND).
There
are
utilities
to
copy
or
merge
dictionaries.
to
convey
metadata
(for
example,
title
or
artist)
or
to
convey
codec/container
options.
AVDictionary
thus
provides
a
flexible,
portable
mechanism
for
carrying
key-value
pairs
across
the
FFmpeg
ecosystem.