1@chapter Metadata
2@c man begin METADATA
3
4Libav is able to dump metadata from media files into a simple UTF-8-encoded
5INI-like text file and then load it back using the metadata muxer/demuxer.
6
7The file format is as follows:
8@enumerate
9
10@item
11A file consists of a header and a number of metadata tags divided into sections,
12each on its own line.
13
14@item
15The header is a ';FFMETADATA' string, followed by a version number (now 1).
16
17@item
18Metadata tags are of the form 'key=value'
19
20@item
21Immediately after header follows global metadata
22
23@item
24After global metadata there may be sections with per-stream/per-chapter
25metadata.
26
27@item
28A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
29brackets ('[', ']') and ends with next section or end of file.
30
31@item
32At the beginning of a chapter section there may be an optional timebase to be
33used for start/end values. It must be in form 'TIMEBASE=num/den', where num and
34den are integers. If the timebase is missing then start/end times are assumed to
35be in milliseconds.
36Next a chapter section must contain chapter start and end times in form
37'START=num', 'END=num', where num is a positive integer.
38
39@item
40Empty lines and lines starting with ';' or '#' are ignored.
41
42@item
43Metadata keys or values containing special characters ('=', ';', '#', '\' and a
44newline) must be escaped with a backslash '\'.
45
46@item
47Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of
48the tag (in the example above key is 'foo ', value is ' bar').
49@end enumerate
50
51A ffmetadata file might look like this:
52@example
53;FFMETADATA1
54title=bike\\shed
55;this is a comment
56artist=Libav troll team
57
58[CHAPTER]
59TIMEBASE=1/1000
60START=0
61#chapter ends at 0:01:00
62END=60000
63title=chapter \#1
64[STREAM]
65title=multi\
66line
67@end example
68@c man end METADATA
69