metadata.texi 1.8 KB

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