Coder Social home page Coder Social logo

waterkip / vobsubocr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from elizagamedev/vobsubocr

0.0 0.0 0.0 119 KB

Blazingly fast and accurate DVD VobSub to SRT subtitle conversion

License: GNU General Public License v3.0

Rust 99.54% Nix 0.46%

vobsubocr's Introduction

vobsubocr

vobsubocr is a blazingly fast and accurate DVD VobSub to SRT subtitle conversion tool.

Background

DVD subtitles are unfortunately encoded essentially as a series of images. This presents problems when needing a text representation of the subtitle, e.g. for language learning. vobsubocr can alleviate this problem by generating SRT subtitles from an input VobSub file, leveraging the power of Tesseract.

Installation

Install the latest release with cargo:

cargo install vobsubocr

Or alternatively, install the development version from git:

cargo install --git https://github.com/elizagamedev/vobsubocr

You will need to have Tesseract's development libraries installed; see the leptess readme for more details. If you use Nix, the provided shell.nix provides an environment with all of the necessary dependencies.

Usage

# Convert simplified Chinese vobsub subtitles and print them to stdout.
vobsubocr -l chi_sim shrek_chi.idx

# Convert English vobsub subtitles and write them to a file named "shrek_eng.srt".
vobsubocr -l eng -o shrek_eng.srt shrek_eng.idx

We can also specify more advanced configuration options for Tesseract with -c.

# Convert subtitles and blacklist the specified characters from being (mistakenly) recognized.
vobsubocr -l eng -c tessedit_char_blacklist='|\/`_~' shrek_eng.idx

How does it work/compare to similar tools?

The most comparable tool to vobsubocr is VobSub2SRT, but vobsubocr has significantly better output, especially for non-English languages, mainly because VobSub2SRT does not do much preprocessing of the image at all before sending it to Tesseract. For example, Tesseract 4.0 expects black text on a white background, which VobSub2SRT does not guarantee, but vobsubocr does. Additionally, vobsubocr splits each line into separate images to take advantage of page segmentation method 7, which greatly improves accuracy of non-English languages in particular.

Official documentation on how to improve accuracy of Tesseract output can be viewed here.

Miscellaneous Notes

From my understanding, the chi_sim and chi_tra Tesseract models work on both simplified and traditional Chinese text, but automatically convert said text to their respective forms.

vobsubocr's People

Contributors

acampbell3000 avatar elizagamedev avatar gwen-lg avatar hannesbraun avatar waterkip 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.