Skip to content

Merge and clean up multi-line and multi-language subtitle files. Updated with language-based subtitle split. 将带有多行英文的SRT字幕合并成单行,同时合并中文翻译。新增中英拆分功能。

License

Notifications You must be signed in to change notification settings

sundaymouse/srtmerge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.srt will be created.

用途

merge.py 将带有多行英文的SRT字幕合并成单行。如果同时有中文翻译行,中文翻译单独合并成单行,并置于对应的英文行上方。
split.py 将带有多行英文的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

About

Merge and clean up multi-line and multi-language subtitle files. Updated with language-based subtitle split. 将带有多行英文的SRT字幕合并成单行,同时合并中文翻译。新增中英拆分功能。

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages