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