Skip to content
EPUBCheck · Images, audio and media overlays

EPUBCheck MED_012: media-overlay id mismatch

Updated:

EPUBCheck MED_012 is an error message: “The "media-overlay" attribute does not match the ID of the Media Overlay that refers to this document.” The media-overlay attribute of a chapter names a different overlay from the one that refers to it. The SMIL file that narrates a chapter and the chapter's manifest item must point at each other.

The official message

The "media-overlay" attribute does not match the ID of the Media Overlay that refers to this document.

Default severity
Error. The EPUB breaks a rule of the specification and is invalid. Stores and Send to Kindle may reject it, and EPUBCheck exits with status 1.
EPUBCheck version
5.4.0

EPUBCheck prints this ID with an underscore instead of a hyphen; this page uses the ID exactly as EPUBCheck reports it.

Typical causes

  • Overlay ids renamed or swapped in the manifest.
  • A chapter copied with its manifest item, keeping the original's media-overlay value.

How to fix it

  1. Find the SMIL file whose text elements point to the chapter EPUBCheck names.
  2. Set the chapter's media-overlay attribute to the manifest id of that SMIL file.
  3. Check the other chapters the same way: these errors usually come in groups.
  4. Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.

When it's not this

If the attribute is missing altogether, the error is MED_010.

Terms used here

Other MED messages

  • MED_011 EPUB Content Document referenced from multiple Media Overlay Documents.
  • MED_013 Media Overlay Document referenced from the "media-overlay" attribute does not contain a reference to this Content Document.
  • MED_010 EPUB Content Documents referenced from a Media Overlay must specify the "media-overlay" attribute.
  • MED_014 Media overlay audio file URLs must not have a fragment, but found '#…'.
  • MED-009 The time specified in the clipBegin attribute must not be the same as clipEnd.
  • MED_015 Media overlay text references must be in reading order. Text target "…" is before the previous link target in … order.

Sources

Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.

FAQ

What does EPUBCheck MED_012 mean?

EPUBCheck MED_012 is an error message: “The "media-overlay" attribute does not match the ID of the Media Overlay that refers to this document.” The media-overlay attribute of a chapter names a different overlay from the one that refers to it. The SMIL file that narrates a chapter and the chapter's manifest item must point at each other.

Is MED_012 an error?

MED_012 is reported as error by default. The EPUB breaks a rule of the specification and is invalid. Stores and Send to Kindle may reject it, and EPUBCheck exits with status 1.