# PMS recognizes only last chapter in MKV

**URL:** https://forums.plex.tv/t/pms-recognizes-only-last-chapter-in-mkv/323757
**Category:** General Discussions
**Tags:** server-linux
**Created:** [October 25, 2018, 2:21pm UTC](https://forums.plex.tv/t/pms-recognizes-only-last-chapter-in-mkv/323757 "2018-10-25T14:21:49Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![aibeira](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/aibeira/32/102603_2.png) [@aibeira](https://forums.plex.tv/u/aibeira)
#### Post date: [October 25, 2018, 2:21pm UTC](https://forums.plex.tv/t/pms-recognizes-only-last-chapter-in-mkv/323757/1 "2018-10-25T14:21:49Z")

</div>

Hi! I have recently started experimenting with using MKV containers rather than MP4. On one of my first attempts, I have encountered an issue with embedded chapters. Specifically, the other chapter that seems to be recognized is the last one. I have observed this on the web client, the iOS client, and the Apple TV client. If I open the .MKV file in VLC, it recognizes and uses all the chapters in the file.

I’ve tried removing the file from the server, scanning the library, then putting the file back, and scanning again, with no change.

I see some older threads about similar issues, but they are much older, or are related seemingly more to whether chapters are supported at all or not.

I’m just wondering how to resolve this issue? Or if there is another way to inject chapters into a video.

---

<div class="post-metadata">

### Author: ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)
#### Post date: [October 25, 2018, 2:28pm UTC](https://forums.plex.tv/t/pms-recognizes-only-last-chapter-in-mkv/323757/2 "2018-10-25T14:28:27Z")

</div>

How did you add the chapters into the file?  
MKV might support several chapter records. But Plex may be only able to read one.

Perform the full [Plex Dance](https://forums.plex.tv/t/plex-incorrectly-identifying-tv-episodes/100265/4 "Plex Dance")  
Then trigger an [Analysis run](https://support.plex.tv/articles/200289336-analyze-media/) on the file, just to be sure.

---

<div class="post-metadata">

### Author: ![aibeira](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/aibeira/32/102603_2.png) [@aibeira](https://forums.plex.tv/u/aibeira)
#### Post date: [October 25, 2018, 5:39pm UTC](https://forums.plex.tv/t/pms-recognizes-only-last-chapter-in-mkv/323757/3 "2018-10-25T17:39:24Z")

</div>

OttoKerner - Thanks for your response. I have done some more research since I posted…

Plex read the chapter marks correctly from the original .mkv file that came out of MakeMKV.  
It also read them correctly from the .mkv file that came out of HandBrake for transcoding.  
It fails to read them correctly after I used MetaX to update the NAMES of the chapters.

I used mkvextract to extract the chapter atom from the file both pre- and post-MetaX. There is only one significant seeming difference I can see, which is the ChapterUID element values in the post-MetaX are very large numbers, but at small numbers in the pre-MetaX file.

I then replaced the ChapterString elements from in the pre-MetaX file and replaced them with their counterparts in the post-MetaX file. I then used mkvpropedit to inject the new chapters into the post-MetaX .MKV file. Plex then read the chapters correctly.

Is there somehow I can attach the XML for the Chapters element to this thread for you (or others) to look at?

---

<div class="post-metadata">

### Author: ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)
#### Post date: [October 25, 2018, 5:42pm UTC](https://forums.plex.tv/t/pms-recognizes-only-last-chapter-in-mkv/323757/4 "2018-10-25T17:42:52Z")

</div>

I can only recommend you to use [MKVtoolnix](https://mkvtoolnix.download/ "MKVtoolnix") for all things MKV instead of MetaX.  
I have no issues with files coming out of there.  
It brings also command line tools for all features, if you need that.

---

<div class="post-metadata">

### Author: ![aibeira](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/aibeira/32/102603_2.png) [@aibeira](https://forums.plex.tv/u/aibeira)
#### Post date: [October 25, 2018, 5:44pm UTC](https://forums.plex.tv/t/pms-recognizes-only-last-chapter-in-mkv/323757/5 "2018-10-25T17:44:07Z")

</div>

Right - that’s where the mkvextract and mkvpropedit came from, I believe. I only used MetaX because it provides an easy way to edit the names. I’ll build something to do this myself using the other tools.

---

<div class="post-metadata">

### Author: ![gbooker02](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gbooker02/32/9726_2.png) [@gbooker02](https://forums.plex.tv/u/gbooker02)
#### Post date: [October 25, 2018, 7:18pm UTC](https://forums.plex.tv/t/pms-recognizes-only-last-chapter-in-mkv/323757/6 "2018-10-25T19:18:40Z")

</div>

I would recommend against using MetaX. I caught it writing chapters incorrectly for MP4 files and it took a few iterations back and forth with the developer before they corrected it. Some of the details have been posted here: [Local media asset issues](https://forums.plex.tv/t/local-media-asset-issues/148026/38). The tools based on mkvtoolnix do this job very well. I personally use the command-line but there are GUI based tools using the same backend libs that work well too.

---

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)
#### Post date: [January 23, 2019, 7:20pm UTC](https://forums.plex.tv/t/pms-recognizes-only-last-chapter-in-mkv/323757/7 "2019-01-23T19:20:17Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
