PHPackages                             mihaeu/sub-modifier - 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. mihaeu/sub-modifier

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

mihaeu/sub-modifier
===================

SubModifier modifies subtitle files by increasing or decreasing and by re-indexing the subtitle entries.

v1.0.2(12y ago)020MITPHPPHP &gt;= 5.4

Since Feb 18Pushed 12y ago1 watchersCompare

[ Source](https://github.com/mihaeu/sub-modifier)[ Packagist](https://packagist.org/packages/mihaeu/sub-modifier)[ Docs](https://github.com/mihaeu/sub-modifier)[ RSS](/packages/mihaeu-sub-modifier/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Sub Modifier
============

[](#sub-modifier)

SubModifier modifies subtitle files by increasing or decreasing the subtitle files and by re-indexing the subtitles (in case a subtitle file has to be split up for multi-part movies).

*Currently only supports `.srt` files.*

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

[](#installation)

If you want to use this as a package for a separate project (assuming composer was installed globally):

```
composer require mihaeu/sub-modifier:1.*
```

In most cases however this is more useful installed globally along with other tools like phpunit, phing, etc. as a global script:

```
composer global require mihaeu/sub-modifier:1.*
```

Make sure the global composer path (usually `~/.composer/bin`) is in your `$PATH`.

```
echo $PATH
```

Usage
-----

[](#usage)

```
submod
```

Assuming I'm in a movie directory with a subtitle that I want to delay by 10 seconds, I would do the following (overwriting the old file):

```
submod Amour-2012.srt 00:10:00,000 > Amour-2012.srt
```

Tests
-----

[](#tests)

Run the PHPUnit tests from the project root like so:

```
vendor/bin/phpunit --testdox --coverage-text
```

To get readable output like this (requires for you to have code coverage in your php setup, otherwise, remove that option):

```
...

SubModifier
 [x] Converts ms to srt time format
 [x] Converts srt time format to ms
 [x] Validates srt time formats
 [x] Converts srt time to ms and back
 [x] Subtracts subtitles
 [x] Adds subtitles
 [x] Doesnt accept bad srt file
 [x] Doesnt accept bad srt format
 [x] Normalizes linefeeds of input srt file
 [x] Delays subtitles by given time

Generating code coverage report in HTML format ... done

Code Coverage Report
  2014-02-18 09:37:27

 Summary:
  Classes: 100.00% (1/1)
  Methods: 100.00% (5/5)
  Lines:   100.00% (45/45)

\Mihaeu\SubModifier::SubModifier
  Methods: 100.00% ( 5/ 5)   Lines: 100.00% ( 42/ 42)
```

License
-------

[](#license)

The MIT License (MIT)

Copyright (c) 2014 Michael Haeuslmann

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Epilogue
--------

[](#epilogue)

Goodbye and have a nice day.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~2 days

Total

3

Last Release

4510d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1cfd32112845e28319a56265bdcac255118e0fba4eb36ccfa6c718f5e52bc49?d=identicon)[mihaeu](/maintainers/mihaeu)

---

Top Contributors

[![mihaeu](https://avatars.githubusercontent.com/u/2168701?v=4)](https://github.com/mihaeu "mihaeu (13 commits)")

---

Tags

subtitlesrtsubs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mihaeu-sub-modifier/health.svg)

```
[![Health](https://phpackages.com/badges/mihaeu-sub-modifier/health.svg)](https://phpackages.com/packages/mihaeu-sub-modifier)
```

###  Alternatives

[captioning/captioning

A collection of tools to manipulate subtitles

2261.4M7](/packages/captioning-captioning)

PHPackages © 2026

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