Giter Site home page Giter Site logo

kome's Introduction

Kome

Japanese subtitle cleaner and automatic synchronization of subtitles with video, so that subtitles are aligned to the correct starting point within the video.

Turn this: Into this:

Install

First, install Python 3.

Then, make sure ffmpeg is installed. On MacOS, this looks like:

brew install ffmpeg

(Windows users: make sure ffmpeg is on your path and can be referenced from the command line! If ffmpeg is not found, make sure it is installed from its site)

Download kome from releases page, extract the zip file. Run pip install -r requirements.txt from terminal in Kome directory to install it.

Usage

Run in terminal on kome directory:

kome.py src_video.mkv dest_video.mkv

Kome will extract subtitle from source video, clean it, synchronise the subtitle timing with the destination video and generate the subtitle file in the destination directory.

There are additional parameter such as selecting different subtitle track from source video, selecting external subtitle file, etc.

For more options, see kome.py -help

Use case

A use case for Kome is if you have a Japanese video with built-in subtitle but want to use the subtitle in another video (for example, use the subtitle from TV series to BD).

This script will extract subtitle from source video, reshift the timing to destination video, clean hearing impaired subtitle and apply clean style to subtitle automatically for viewing.

Script steps

  1. Extract subtitle from source video.
  2. Shift subtitle timing to destination video.
  3. Clean subtitle to remove sound effect, character parantheses and misc symbol.
  4. Apply cleaner style.
  5. Output subtitle to destination video folder.

Caveat

  • This script cannot improve bad timing. If original lines are mistimed, they will be mistimed in the output file too.
  • This script cannot completely remove sound effect. Some sound effect line do not have discernible pattern that this script can match and remove.
  • Make sure to check the subtitle before uploading it for other to use. A Kanji to check is '音' in for example '走る音' as it does not have regular pattern to match to.

Todo

  1. Shift subtitle to destination video only
  2. Add option to disable styling
  3. Add option to clean subtitle only

Credits

This project uses the following libraries:

License

Code in this project is MIT licensed.

kome's People

Contributors

wanhuz avatar

Watchers

 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.