2017 © Pedro Peláez
 

library subtitles

Modification and conversion of subtitle file formats

image

thijsr/subtitles

Modification and conversion of subtitle file formats

  • Monday, October 24, 2016
  • by ThijsRiezebeek
  • Repository
  • 1 Watchers
  • 5 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 18 % Grown

The README.md

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., (*1)

Functionality

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

Installation

The package can be installed using the following command:, (*2)

composer require thijsr/subtitles

Or by adding it to your composer.json manually:, (*3)

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

Examples

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

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., (*5)

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");

The Versions

24/10 2016

dev-master

9999999-dev

Modification and conversion of subtitle file formats

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Thijs Riezebeek

subtitles srt subrip

16/04 2016

v1.0.2-beta

1.0.2.0-beta

Modification and conversion of subtitle file formats

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Thijs Riezebeek

subtitles srt subrip

05/03 2016

dev-webvtt

dev-webvtt

Modification and conversion of subtitle file formats

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Thijs Riezebeek

subtitles srt subrip

28/02 2016

v1.0.1-beta

1.0.1.0-beta

Modification and conversion of subtitle file formats

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Thijs Riezebeek

subtitles srt subrip

27/02 2016

1.0.0-beta

1.0.0.0-beta

Modification and conversion of subtitle file formats

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Thijs Riezebeek

subtitles srt