Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: when outputting png files, also output srtx file #56

Open
kaefert opened this issue Nov 26, 2015 · 1 comment
Open

Comments

@kaefert
Copy link

kaefert commented Nov 26, 2015

Hey there! I use your software as part of a process to get subtitles into srt text format. It would make that process easier if you could extend your xml+png output by also (or maybe depending on a switch) output a srtx file that can be used by srttool to join together the OCRed text snippets into one srt file.

The format of this srtx file should be like so:

1
00:01:01,15 --> 00:01:02,16
eng1_0001.png.txt

2
00:01:02,18 --> 00:01:06,03
eng1_0002.png.txt

3
00:01:06,05 --> 00:01:07,07
eng1_0003.png.txt

As a workaround for now I have written myself a little java processer for your xml format that outputs this srtx format (see attachment)

BDNXmlToSrtx.java.txt

@optimiz
Copy link

optimiz commented Feb 4, 2016

I appreciate BDSup2Sub's current capabilities and second @kaefert's request, SRTX output would be beneficial. My workaround is to export with BDSup2Sub (to get XML+PNG) and subtitle2pgm (to get the SRTX), then manipulate as necessary.

#! /bin/bash
subtitle2vobsub -p file.ps1 -o file
# Unfortunately, subtitle2pgm skips, doubles or blanks some frames.
subtitle2pgm -P -i file.ps1 -o file
# Thankfully, BDSup2Sub exports all frames correctly.
java -jar BDSup2Sub.jar -o file.xml file.idx
rename file_ file *png
sed -i 's/pgm/png/g' file.srtx
for subs in *.png; do tesseract $subs $subs; done
srttool -s -i file.srtx -o file_ready_for_editing.srt
rm file*{png,pgm,idx,xml,srtx,txt,sub}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants