emersion / meltsub

Convert hardsub to softsub
MIT License
24 stars 10 forks source link

BrokenPipeError #3

Closed Clover2k closed 5 years ago

Clover2k commented 5 years ago

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) 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

emersion commented 5 years ago

Hmm, it looks like Tesseract exits early or something...

Clover2k commented 5 years ago

I checked how Tesseract is launched in the source and noticed that the language was passed with the -l option. I modified the variable “subtitles_lang” on one of the languages installed and now it works correctly.

Problem solved, thank you.

If I can give a suggestion... it’s better to report in the readme.md to set the variable according to the languages detected by the command “tesseract --list-langs”

emersion commented 5 years ago

Nice. Can you open a PR?