---
title: "METS Encoding"
manual: "Kitodo.Presentation"
version: "dev-demo"
source: "Features/MediaPlayer/METS.rst"
rendered: "2026-09-27T16:21:24+00:00"
---

# METS Encoding {#mets-encoding}

## Chapter Markers {#chapter-markers}

To set chapter markers, use `<mets:area>` with type `TIME` on the physical structure node and link it from a leaf logical structure node.
Only the begin is used.

```xml
<mets:div ID="PHYS_0002" ORDER="2" TYPE="track">
  <mets:fptr>
    <mets:area FILEID="FILE_0000_DEFAULT" BEGIN="00:06:04" BETYPE="TIME" />
  </mets:fptr>
</mets:div>
```

Fractional timecodes (e.g., `00:06:04.5`) may be used.

## Waveform {#mets-waveform}

To link preprocessed audio waveform data, use the `WAVEFORM` use groups (configurable in `useGroupsWaveform`).
See [the section on the waveform component](Waveform.html#audiowaveform) for information on how to generate the data.

```xml
<mets:fileGrp USE="WAVEFORM">
  <mets:file ID="FILE_0000_WAVEFORM" MIMETYPE="application/vnd.kitodo.audiowaveform">
    <mets:FLocat LOCTYPE="URL" xlink:href="https://www.example.com/waveform.dat"/>
  </mets:file>
</mets:fileGrp>
```

Note that the custom MIME type must be specified.
Currently, data generated by the `audiowaveform` tool is supported.
Other formats may become supported in the future.

## Multiple Sources {#multiple-sources}

Multiple alternative sources may be referenced by linking more than one file to a `<mets:div>`.
They are tried in the order of the `<mets:fptr>`.

```xml
<mets:div ID="PHYS_0001" ORDER="1" TYPE="track">
  <mets:fptr>
    <mets:area FILEID="FILE_0000_DEFAULT_MPD" BEGIN="00:00:00" BETYPE="TIME" />
  </mets:fptr>
  <mets:fptr>
    <mets:area FILEID="FILE_0000_DEFAULT_HLS" BEGIN="00:00:00" BETYPE="TIME" />
  </mets:fptr>
  <mets:fptr>
    <mets:area FILEID="FILE_0000_DEFAULT_MP4" BEGIN="00:00:00" BETYPE="TIME" />
  </mets:fptr>
</mets:div>
```
