Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 1.48 KB

README.md

File metadata and controls

34 lines (24 loc) · 1.48 KB

srtmerge

Merge and clean up multi-line and multi-language subtitle files.


Purpose

Some closed caption subtitle files contain multiple lines of subtitle in a single subtitle timing block.

This script merges multiple lines into a single line. If Non-English translation lines are also present, they will be seperately merged into another line, on top of the English line.

We use Chinese as the intended translated language. This script may not apply to some languages with the same charset to English.

Usage

To merge a subtitle file containing multiple lines of English and/or translated lines:
python merge.py /path/to/original/subtitle.srt /path/to/output/subtitle.srt

To split a subtitle file containing multiple lines of English and/or translated lines, into two separate subtitle files -- one for English, and one for translated:
python split.py /path/to/original/subtitle.srt /path/to/output/subtitle

Note that /path/to/output/subtitle.en.srt and /path/to/output/subtitle.ch.srtwill be created.

用途

将带有多行英文的SRT字幕合并成单行。如果同时有中文翻译行,中文翻译单独合并成单行,并置于对应的英文行上方。

用法如上方。

License
Copyright (c) sundaymouse 2014
License: GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007.
For full license details, see: http://www.gnu.org/copyleft/gpl.html