PHPackages                             thijsr/subtitles - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. thijsr/subtitles

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

thijsr/subtitles
================

Modification and conversion of subtitle file formats

v1.0.2-beta(10y ago)6191MITPHPPHP &gt;=5.4.0

Since Feb 27Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Thijs-Riezebeek/subtitles)[ Packagist](https://packagist.org/packages/thijsr/subtitles)[ RSS](/packages/thijsr-subtitles/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

Subtitle File Modification
==========================

[](#subtitle-file-modification)

This package contains the functionality to modify subtitle files. It is currently in a beta state and therefore names as well as APIs can and probably will change.

Functionality
-------------

[](#functionality)

- Delaying all subtitles in a file
- Fixing a 'broken' subtitle file by restoring the numbering.

Installation
------------

[](#installation)

The package can be installed using the following command:

```
composer require thijsr/subtitles
```

Or by adding it to your `composer.json` manually:

```
"require": {
  "thijsr/subtitles": ">=1.0.0-beta
}
```

Examples
--------

[](#examples)

Below is a simple example of reading in a `.srt` file, delaying it by 3200 milliseconds and writing it to a new file.

```
use \ThijsR\Subtitles\SubRip;

$subrip_file _= SubRip\Reader::readFile("path/to/srt/file.srt");
SubRip\Modifier::addDelayInMs($srt_file, 3200);
SubRip\Writer::writeFile($srt_file, "new/path/to/delayed/srt/file.srt");
```

Sometimes `srt` files cannot be opened in Media Players because the numbering is not correct. This example shows a fix for this.

```
use \ThijsR\Subtitles\SubRip;

$subrip_file _= SubRip\Reader::readFile("path/to/srt/file.srt");
SubRip\Modifier::restoreNumbering($subrip_file);
SubRip\Writer::writeFile($srt_file, "new/path/to/delayed/srt/file.srt");
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~24 days

Total

3

Last Release

3675d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/30b81f4b266ca708927065c75ee0f27f7c4f7154dfd225a0c183096e12b99909?d=identicon)[ThijsRiezebeek](/maintainers/ThijsRiezebeek)

---

Top Contributors

[![Thijs-Riezebeek](https://avatars.githubusercontent.com/u/14027813?v=4)](https://github.com/Thijs-Riezebeek "Thijs-Riezebeek (6 commits)")

---

Tags

subtitlessrtsubrip

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thijsr-subtitles/health.svg)

```
[![Health](https://phpackages.com/badges/thijsr-subtitles/health.svg)](https://phpackages.com/packages/thijsr-subtitles)
```

###  Alternatives

[captioning/captioning

A collection of tools to manipulate subtitles

2261.3M7](/packages/captioning-captioning)[scheb/tombstone

Dead code detection with tombstones for PHP

282578.2k2](/packages/scheb-tombstone)[benlipp/srt-parser

Easily Parse SRT Subtitle Files

22126.9k](/packages/benlipp-srt-parser)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
