# Chapter Support

**URL:** <https://forums.plex.tv/t/chapter-support/179015>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [February 7, 2017, 11:21am UTC](https://forums.plex.tv/t/chapter-support/179015 "2017-02-07T11:21:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![daeks](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/daeks/32/17467_2.png) [@daeks](https://forums.plex.tv/u/daeks)\
**Post date:** [February 7, 2017, 11:21am UTC](https://forums.plex.tv/t/chapter-support/179015/1 "2017-02-07T11:21:42Z")

</div>

Dear all,

I have a question regarding chapters and the syntax of it. I have a sample movie which has following tags defined by parsing a comskip generated XML:

```
2017-02-07 12:14:12,734 (21b0) : INFO (logkit:16) - Found commerical at 00:00:00 - 00:01:32
2017-02-07 12:14:12,734 (21b0) : INFO (logkit:16) - Found commerical at 00:06:16 - 00:07:18
2017-02-07 12:14:12,734 (21b0) : INFO (logkit:16) - Found commerical at 00:27:38 - 00:37:32
2017-02-07 12:14:12,734 (21b0) : INFO (logkit:16) - Found commerical at 00:52:32 - 00:58:48

```

If I load the metadata of that movie I can do the following code:

```
metadata.chapters.clear()

chapter = metadata.chapters.new()
chapter.title = 'Commercial'
chapter.start_time_offset = 0
chapter.end_time_offset = 0

```

Compared to my above example what would be the value for the time\_offset? seconds from start to the point?  
Something like:

```
<Chapter id="66599" tag="Commercial 1" index="1" startTimeOffset="0" endTimeOffset="92"/>
<Chapter id="66600" tag="Movie Chapter 1" index="2" startTimeOffset="92" endTimeOffset="376"/>
<Chapter id="66601" tag="Commercial 2" index="3" startTimeOffset="376" endTimeOffset="438"/>
<Chapter id="66602" tag="Movie Chapter 2" index="4" startTimeOffset="438" endTimeOffset="1658"/>
<Chapter id="66603" tag="Commercial 3" index="5" startTimeOffset="1658" endTimeOffset="2252"/>
<Chapter id="66604" tag="Movie Chapter 3" index="6" startTimeOffset="2252" endTimeOffset="3152"/>
<Chapter id="66605" tag="Commercial 4" index="7" startTimeOffset="3152" endTimeOffset="3528"/>
```

---

<div class="post-metadata">

**Author:** ![SwiftPanda16](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/swiftpanda16/32/81839_2.png) [@SwiftPanda16](https://forums.plex.tv/u/SwiftPanda16)\
**Post date:** [February 7, 2017, 6:07pm UTC](https://forums.plex.tv/t/chapter-support/179015/2 "2017-02-07T18:07:39Z")

</div>

Time offset is in seconds.

---

<div class="post-metadata">

**Author:** ![daeks](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/daeks/32/17467_2.png) [@daeks](https://forums.plex.tv/u/daeks)\
**Post date:** [February 7, 2017, 9:27pm UTC](https://forums.plex.tv/t/chapter-support/179015/3 "2017-02-07T21:27:13Z")

</div>

Thx for the replay. I already figured it out - the value is in milliseconds.

---

<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 8, 2020, 8:02pm UTC](https://forums.plex.tv/t/chapter-support/179015/4 "2020-01-08T20:02:11Z")

</div>


