All Projects → riobard → srt.py

riobard / srt.py

Licence: other
A Python script to manipulate .srt subtitles

Programming Languages

python
139335 projects - #7 most used programming language

srt.py

srt.py is a simple Python script to manipulate soft subtitles in .srt format. Most of the basic stuff of parsing the .srt format is done, so it will be relatively easy to implement high-level manipulation commands. Currently only split command is implemented.

For more information about the .srt format, see here and here.

Usage

python srt.py split subtitle.srt 42:30 45:10

This will split subtitle.srt into three parts, named subtitle.srt.000, subtitle.srt.001, subtitle.srt.002, with the subtitle.srt.000 being 42 minutes and 30 seconds in length, subtitle.srt.001 being 45 minutes and 10 seconds in length, and subtitle.srt.002 the rest of the original file.

python srt.py shift subtitle.srt -,500 > new.subtitle.srt

This will move the subtitle 500 milliseconds towards the beginning. Output is redirected to the file named new.subtitle.srt. Use this to sync subtitle with video.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].