# Handling malformed SRT timestamps

**URL:** https://discussion.mcebuddy2x.com/t/handling-malformed-srt-timestamps/4332
**Category:** New Features
**Tags:** subtitles
**Created:** [June 2, 2021, 1:22pm UTC](https://discussion.mcebuddy2x.com/t/handling-malformed-srt-timestamps/4332 "2021-06-02T13:22:27Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![SystemIdleProcess](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/systemidleprocess/32/2560_2.png) [@SystemIdleProcess](https://discussion.mcebuddy2x.com/u/SystemIdleProcess)
#### Post date: [June 2, 2021, 1:22pm UTC](https://discussion.mcebuddy2x.com/t/handling-malformed-srt-timestamps/4332/1 "2021-06-02T13:22:28Z")

</div>

**Request Type:**  
NEW FEATURE

**Summary of the problem or suggestion:**  
I have been using more and more SRT files with my source videos. I’ve noticed that these get processed and in some cases content is removed from them. I’ve tested playback with the new processed SRT and the original SRT with the processed video file and have not seen any issue using the original SRT. I’d like an option to not process the SRT if it is included in the source location.

---

<div class="post-metadata">

### Author: ![Goose](https://discussion.mcebuddy2x.com/letter_avatar_proxy/v4/letter/g/5f9b8f/32.png) [@Goose](https://discussion.mcebuddy2x.com/u/Goose)
#### Post date: [June 2, 2021, 4:51pm UTC](https://discussion.mcebuddy2x.com/t/handling-malformed-srt-timestamps/4332/2 "2021-06-02T16:51:32Z")

</div>

I didn’t quite understand. The only time an SRT is adjusted is when commercial removal is enabled, it will “cut” the SRT to keep it in sync with the commercial removal otherwise the SRT will be out of sync with the converted file which doesn’t have commercials.

---

<div class="post-metadata">

### Author: ![SystemIdleProcess](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/systemidleprocess/32/2560_2.png) [@SystemIdleProcess](https://discussion.mcebuddy2x.com/u/SystemIdleProcess)
#### Post date: [June 2, 2021, 5:00pm UTC](https://discussion.mcebuddy2x.com/t/handling-malformed-srt-timestamps/4332/3 "2021-06-02T17:00:07Z")

</div>

I have Ad remover set to Yes (Use markers) just incase I have my own EDL created with custom cuts but in these recent cases I have had no EDL file.  
Here is a conversion log.  
[Rick and Morty - S02E08 - Interdimensional Cable 2- Tempting Fate.mp4-HEVC-MKV-00-Default-Stream-2021-06-02T08-40-28.log](https://discussion.mcebuddy2x.com/uploads/short-url/c0HML9tgacuWgWIR9Hki0wWHhNj.log) (1.4 MB)  
SRT files:  
[Rick and Morty - S02E08 - Interdimensional Cable 2 - Tempting Fate.eng.processed.srt](https://discussion.mcebuddy2x.com/uploads/short-url/qV5rqSmicych9is6zUWeJgW5IDP.srt) (34.1 KB)  
[Rick and Morty - S02E08 - Interdimensional Cable 2 - Tempting Fate.eng.orig.srt](https://discussion.mcebuddy2x.com/uploads/short-url/15bUTIQNRoWsFyJ2DmycFxWbrIg.srt) (39.3 KB)

---

<div class="post-metadata">

### Author: ![Goose](https://discussion.mcebuddy2x.com/letter_avatar_proxy/v4/letter/g/5f9b8f/32.png) [@Goose](https://discussion.mcebuddy2x.com/u/Goose)
#### Post date: [June 4, 2021, 2:36pm UTC](https://discussion.mcebuddy2x.com/t/handling-malformed-srt-timestamps/4332/4 "2021-06-04T14:36:11Z")

</div>

I check out your log and SRT files, it’s not related to EDL files. Your SRT files are the issue.  
MCEBuddy validates and cleans up SRT files to remove invalid data.

Your SRT files are creating timestamps which aren’t in the required format so MCEBuddy is dropping them:

> INFORMATION\> 2021-06-02T08:41:14 MCEBuddy.Transcode.CCandSubtitles → Validating and cleaning SRT file  
> 2021-06-02T08:41:14 MCEBuddy.Transcode.CCandSubtitles → SRT File D:\Temp\working0\Rick and Morty - S02E08 - Interdimensional Cable 2- Tempting Fate.eng.srt  
> WARNING\> 2021-06-02T08:41:14 MCEBuddy.Transcode.CCandSubtitles → Invalid timestamps, skipping entry : 00:00:4,405 00:00:6,006  
> WARNING\> 2021-06-02T08:41:14 MCEBuddy.Transcode.CCandSubtitles → Invalid timestamps, skipping entry : 00:00:6,006 00:00:8,509  
> WARNING\> 2021-06-02T08:41:14 MCEBuddy.Transcode.CCandSubtitles → Invalid timestamps, skipping entry : 00:00:8,509 00:00:10,778  
> WARNING\> 2021-06-02T08:41:14 MCEBuddy.Transcode.CCandSubtitles → Invalid timestamps, skipping entry : 00:00:59,093 00:01:1,762  
> WARNING\> 2021-06-02T08:41:14 MCEBuddy.Transcode.CCandSubtitles → Invalid timestamps, skipping entry : 00:01:1,762 00:01:4,632  
> WARNING\> 2021-06-02T08:41:14 MCEBuddy.Transcode.CCandSubtitles → Invalid timestamps, skipping entry : 00:01:4,632 00:01:9,103

The issue is that your SRT file timestamps are invalid:

> 00:00:4,405 → 00:00:6,006

The seconds needs to be a 2 digit padded numbers as defined in the specifications:

> **[SRT (SubRip Text) | Speechpad](https://www.speechpad.com/captions/srt)**
>
> The SubRip text file format is a very common caption/subtitle format. SubRip files are named with the extension .srt, and are therefore also referred to

> **[SubRip](https://en.wikipedia.org/wiki/SubRip)**
>
> SubRip is a free software program for Microsoft Windows which extracts subtitles and their timings from various video formats to a text file. It is released under the GNU GPL. Its subtitle format's file extension is .srt and is widely supported. Each .srt file is a human-readable file format where the subtitles are stored sequentially along with the timing information. Most subtitles distributed on the Internet are in this format.
> Using optical character recognition, SubRip can extract from live...

Where as your SRT file has only one digit so it’s being dropped. Which software is generating these SRT files?

---

<div class="post-metadata">

### Author: ![SystemIdleProcess](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/systemidleprocess/32/2560_2.png) [@SystemIdleProcess](https://discussion.mcebuddy2x.com/u/SystemIdleProcess)
#### Post date: [June 4, 2021, 3:07pm UTC](https://discussion.mcebuddy2x.com/t/handling-malformed-srt-timestamps/4332/5 "2021-06-04T15:07:03Z")

</div>

Thanks for taking a look. I completely overlooked the single digit seconds value.

Plex doesn’t seem to care about it as it still works.

I’ll report the issue to the vendor of the software that generated the file.

Is my request still valid to have an option to bypass processing (validating and cleaning) of SRTs? If you feel that it is not necessary as it would only be needed in the rarest of occasions, I’m fine with that and we can mark this as resolved.

---

<div class="post-metadata">

### Author: ![Goose](https://discussion.mcebuddy2x.com/letter_avatar_proxy/v4/letter/g/5f9b8f/32.png) [@Goose](https://discussion.mcebuddy2x.com/u/Goose)
#### Post date: [June 4, 2021, 3:54pm UTC](https://discussion.mcebuddy2x.com/t/handling-malformed-srt-timestamps/4332/6 "2021-06-04T15:54:52Z")

</div>

We’ve put in a patch to handle these malformed timestamps to recover them to make them valid where possible. You can’t try out today’s 2.5.7 BETA build.

We can’t ignore bad SRT files but instead log it for users reference. There have been instances of third party playback software crashing or not playing file due to malformed SRT files that were copied or extracted from the source as is by MCEBuddy (which lead to us implementing validation of SRT files).

---

<div class="post-metadata">

### Author: ![SystemIdleProcess](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/systemidleprocess/32/2560_2.png) [@SystemIdleProcess](https://discussion.mcebuddy2x.com/u/SystemIdleProcess)
#### Post date: [June 4, 2021, 6:08pm UTC](https://discussion.mcebuddy2x.com/t/handling-malformed-srt-timestamps/4332/7 "2021-06-04T18:08:44Z")

</div>

Thanks for the quick turnaround.

I tested out 2.5.7 on a new file and all but 1 exception it worked great. Take a look at what it did for 22 (line 98). Not sure if this is due to the extra linefeed in the original or what.

> 22  
> 00:00:53,966 → 00:00:54,924
> 
> MYKA.

> 22  
> 00:00:00,000 → 00:00:00,000  
> MYKA.

[Warehouse 13 - S02E12 - Reset.eng.orig.srt](https://discussion.mcebuddy2x.com/uploads/short-url/qMM228q6r0oE4snOUveY7gVTjzO.srt) (62.1 KB)  
[Warehouse 13 - S02E12 - Reset.eng.output.srt](https://discussion.mcebuddy2x.com/uploads/short-url/ecPlnDqgcq7yCcdIO6jT8r3jtLa.srt) (66.9 KB)  
[Warehouse 13 - S02E12 - Reset.mp4-Orig-MKV-00-Default-Stream-2021-06-04T13-57-30.log](https://discussion.mcebuddy2x.com/uploads/short-url/ba0A4diutLA217ZDYvOZHdhm0ln.log) (498.6 KB)

---

<div class="post-metadata">

### Author: ![Spikemixture](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/spikemixture/32/735_2.png) [@Spikemixture](https://discussion.mcebuddy2x.com/u/Spikemixture)
#### Post date: [June 9, 2021, 4:23am UTC](https://discussion.mcebuddy2x.com/t/handling-malformed-srt-timestamps/4332/8 "2021-06-09T04:23:00Z")

</div>

To add to this post which might be related !

I am getting many /most extracted SRT files are 1 KB and do not work. Usually they are 10-30kb.

FYI I use buddy to remux mkv under 500mb and  
Convert MKV over 500mb to hevc mp4.

cheers

---

<div class="post-metadata">

### Author: ![Goose](https://discussion.mcebuddy2x.com/letter_avatar_proxy/v4/letter/g/5f9b8f/32.png) [@Goose](https://discussion.mcebuddy2x.com/u/Goose)
#### Post date: [June 9, 2021, 1:29pm UTC](https://discussion.mcebuddy2x.com/t/handling-malformed-srt-timestamps/4332/9 "2021-06-09T13:29:45Z")

</div>

Please upload a sample source video where you’re seeing this behavior and the logs so we can see what’s going on.

---

<div class="post-metadata">

### Author: ![Goose](https://discussion.mcebuddy2x.com/letter_avatar_proxy/v4/letter/g/5f9b8f/32.png) [@Goose](https://discussion.mcebuddy2x.com/u/Goose)
#### Post date: [June 9, 2021, 2:54pm UTC](https://discussion.mcebuddy2x.com/t/handling-malformed-srt-timestamps/4332/10 "2021-06-09T14:54:17Z")

</div>

> [@SystemIdleProcess](#):
>
> 22  
> 00:00:53,966 → 00:00:54,924
> 
> MYKA.

The issue here is that the SRT file isn’t compliant with the specs. There shouldn’t be an empty line in between the subtitle text. An empty line indicates the end of a subtitle block, so this becomes an invalid block.

If blank lines are left in there it causes other programs to choke so MCEBuddy ignores empty lines.

_UPDATE_: MCEBuddy now handles empty lines gracefully by logging a warning message and dropping the invalid block/content. You can try out today’s 2.5.7 BETA build.

---

<div class="post-metadata">

### Author: ![SystemIdleProcess](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/systemidleprocess/32/2560_2.png) [@SystemIdleProcess](https://discussion.mcebuddy2x.com/u/SystemIdleProcess)
#### Post date: [June 9, 2021, 5:39pm UTC](https://discussion.mcebuddy2x.com/t/handling-malformed-srt-timestamps/4332/11 "2021-06-09T17:39:09Z")

</div>

Thanks @Goose!

---

<div class="post-metadata">

### Author: ![Spikemixture](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/spikemixture/32/735_2.png) [@Spikemixture](https://discussion.mcebuddy2x.com/u/Spikemixture)
#### Post date: [June 10, 2021, 2:36am UTC](https://discussion.mcebuddy2x.com/t/handling-malformed-srt-timestamps/4332/12 "2021-06-10T02:36:16Z")

</div>

[Good Witch - S07E04 - The Exchange.mkv-REMUX TV 500 to 264-1900-01-01T00-00-00.log](https://discussion.mcebuddy2x.com/uploads/short-url/7FOQbHnTlPNy6r4PLKjKu5PByY5.log) (11.6 KB)  
[Good Witch - S07E04 - The Exchange.mkv-convert tv 500 to HEVC-1900-01-01T00-00-00.log](https://discussion.mcebuddy2x.com/uploads/short-url/yG0OSnaEMlz0CenUYrrIvIXwuOA.log) (13.9 KB)  
[Good Witch - S07E04 - The Exchange.mkv-convert tv 500 to HEVC-2021-06-08T19-03-44.log](https://discussion.mcebuddy2x.com/uploads/short-url/aqkMDPuTwUoAzPZ55hISSLPf6KT.log) (15.0 KB)  
This title created 1KB SRT files  
ACtual MKV file is too big  
[Good Witch - S07E04 - The Exchange.srt](https://discussion.mcebuddy2x.com/uploads/short-url/vdMWEYjE0j58tsawlTN0y6f1Amy.srt) (527 Bytes)

---

<div class="post-metadata">

### Author: ![Goose](https://discussion.mcebuddy2x.com/letter_avatar_proxy/v4/letter/g/5f9b8f/32.png) [@Goose](https://discussion.mcebuddy2x.com/u/Goose)
#### Post date: [June 10, 2021, 2:55pm UTC](https://discussion.mcebuddy2x.com/t/handling-malformed-srt-timestamps/4332/13 "2021-06-10T14:55:45Z")

</div>

Please set your logs to debug, there isn’t much in these logs to analyze.

You can upload the original MKV to our upload server here: [Welcome to MCEBuddy - README BEFORE POSTING](https://discussion.mcebuddy2x.com/t/welcome-to-mcebuddy-readme-before-posting/8)

---

<div class="post-metadata">

### Author: ![Spikemixture](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/spikemixture/32/735_2.png) [@Spikemixture](https://discussion.mcebuddy2x.com/u/Spikemixture)
#### Post date: [June 13, 2021, 4:27am UTC](https://discussion.mcebuddy2x.com/t/handling-malformed-srt-timestamps/4332/14 "2021-06-13T04:27:41Z")

</div>

[mcebuddy.log](https://discussion.mcebuddy2x.com/uploads/short-url/u0CB6RFY8figlFBmUhs8aJgrMAY.log) (494.3 KB)  
I have started another post of my own related to this so forget this one …

[ERROR : Illegal characters in path - General Support / Questions / Profiles - MCEBuddy (mcebuddy2x.com)](https://discussion.mcebuddy2x.com/t/error-illegal-characters-in-path/4343)
