Giter Site home page Giter Site logo

xinghuo4096 / srtmergebox Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 2.0 191 KB

SrtMergeBox.Srt合并盒子。合并2个srt格式字幕为srt或ass格式字幕。目的是制作双语字幕。Merge 2 srt format subtitles into srt or ass format subtitles. The purpose is to create dual language subtitles.

License: GNU Affero General Public License v3.0

Python 100.00%
srt ass subtitle movie-subtitle

srtmergebox's Introduction

SrtMergeBox Srt合并盒子

简介

SSMB(Srt Subtitle Merge Box )SRT合并盒子

合并2个srt格式字幕为srt或ass格式字幕。目的是制作双语字幕。

例如:中文字幕和英文字幕合并到同一个srt格式的字幕中,或一个ass格式字幕中。

要求是同一部电影的两种语言的srt格式字幕。

使用

  1. 做好准备工作。
  2. 运行movie_srt_merge.py会把文件夹indata下两个字幕test_cn.srttest_en.srt, 合并为srt格式字幕movie_new_srt.srt和ass格式字幕moviet_new_ass.ass,存储到outdata文件夹。
    • srt格式字幕源字幕没有对齐的部分存储到outdata文件夹,文件名:movie_new_srt.unalign.txt
    • ass格式字幕源字幕没有对齐的部分存储到outdata文件夹,文件名:movie_new_ass.unalgin.txt
  3. 可以调整mini_time来减少字幕没有对齐的部分。

准备工作

字幕里的时间内容要对齐

同一部电影的两种语言的srt格式字幕,时间要对齐。

需要库chardet

导入命令 命令:pip install chardet

需要建立文件夹 outdata

默认输出到outdata文件夹

ass字幕模板

test_ass_template_cn_en.txt是ass的模板文件,可以修改。

  • ass格式字幕的模板默认是indata文件夹下的test_ass_template_cn_en.txt
  • ass格式的字幕模板可以修改。
    • 比如修改默认字幕模板
      test_ass_template_cn_en.txt

      1. Style: Default,方正黑体_GBK,20,&H00FFFFFF,&HF0000000,&H00000000,&H32000000这行,可以修改字体名称,默认是方正黑体_GBK,大小,默认20,颜色,默认颜色&H00FFFFFF。

        注意,这里颜色是aabbggrr的格式,倒rgb格式,加上aa,alpha channel。

      2. 修改{\fn微软雅黑}{\b0}{\fs14}{\3c&H202020&},这行就可以修改第二语言字幕的字体名称,默认是微软雅黑,大小默认14,颜色,默认颜色\3c&H202020&

        注意,这种是{\3c&H202020&}形式,颜色是rrggbb格式。因为\3c&H修饰的结果

srtmergebox's People

Contributors

xinghuo4096 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.