Code Monkey home page Code Monkey logo

meltsub's Introduction

meltsub

Takes a raw and an hardsub video, outputs subtitles extracted from the hardsub video.

Disclaimer

I take no legal responsibility for anything this code is used for. This is purely an educational proof of concept.

Usage

Dependencies:

  • opencv
  • tesseract
python meltsub.py

Settings

Change the variable subtitles_lang to set another language.

Use this command to check installed language:

tesseract --list-langs

License

MIT

meltsub's People

Contributors

clover2k avatar emersion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

meltsub's Issues

Broken pipe error on Python 3.8.1 Windows

Writing eng subtitles to subtitles.srt...
00:00:00,583 (0.64) - 00:00:00,625 (5.73) <skipped: too quick>
00:00:00,709 (0.33) - 00:00:00,750 (24.02) <skipped: too quick>
00:00:01,376 (2.54) - 00:00:01,584 (5.09) <skipped: too quick>
00:00:05,588 (4.73) - 00:00:07,257 (5.09) Traceback (most recent call last):
File "meltsub.py", line 263, in
extract_subs(f, softsub_video, hardsub_video, pos_diff_sec)
File "meltsub.py", line 228, in extract_subs
text = ocr(sub_frame)
File "meltsub.py", line 114, in ocr
p.stdin.write(buf)
BrokenPipeError: [Errno 32] Broken pipe

BrokenPipeError

It seems to work but when it detects the subtitle it generates an error:

clover@Aqours:~/sub-ocr/meltsub-master$ python3 meltsub.py
...
00:00:15,306 (4.44) - 00:00:15,390 (5.41) <skipped: too quick>
00:00:15,432 (4.44) - 00:00:16,057 (5.19) Traceback (most recent call last):
File "meltsub.py", line 261, in
extract_subs(f, softsub_video, hardsub_video, pos_diff_sec)
File "meltsub.py", line 227, in extract_subs
text = ocr(sub_frame)
File "meltsub.py", line 113, in ocr
p.stdin.write(buf)
BrokenPipeError: [Errno 32] Broken pipe

Other info:

clover@Aqours:$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
clover@Aqours:
$ python3 --version
Python 3.6.7
clover@Aqours:~$ tesseract -v
tesseract 4.0.0-beta.1
leptonica-1.75.3
libgif 5.1.4 : libjpeg 8d (libjpeg-turbo 1.5.2) : libpng 1.6.34 : libtiff 4.0.9 : zlib 1.2.11 : libwebp 0.6.1 : libopenjp2 2.3.0

Found AVX2
Found AVX
Found SSE

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.