GithubHelp home page GithubHelp logo

bonigarcia / dualsub Goto Github PK

View Code? Open in Web Editor NEW
196.0 196.0 33.0 53.21 MB

DualSub: bilingual subtitles maker

Home Page: http://bonigarcia.github.io/dualsub/

License: GNU General Public License v3.0

Java 100.00%
desktop-app java srt-subtitles

dualsub's Introduction

dualsub's People

Contributors

bonigarcia avatar darealshinji 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dualsub's Issues

NullPointerException in 1.1.0

Using DualSub 1.1.0, two subs as attached, English for above and Hungarian for below:
Atarian 22# - Zippy the Porcupine (Sonic 2600)-qM7UoymJzzM.zip

Clicking "Merge subtitles" causes the following exception:

class java.lang.NullPointerException:null
    io.github.bonigarcia.dualsub.srt.DualSrt.shiftSubs(DualSrt.java:531)
    io.github.bonigarcia.dualsub.srt.DualSrt.writeSrt(DualSrt.java:373)
    io.github.bonigarcia.dualsub.srt.Worker.doInBackground(Worker.java:142)
    io.github.bonigarcia.dualsub.srt.Worker.doInBackground(Worker.java:38)
    javax.swing.SwingWorker$1.call(Unknown Source)
    java.util.concurrent.FutureTask.run(Unknown Source)
    javax.swing.SwingWorker.run(Unknown Source)
    java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    java.lang.Thread.run(Unknown Source)

Fix Debian package

Your Debian package is not made in a very clean way. Running Lintian on it gives me many warnings and errors:

djcj Downloads $ lintian dualsub-1.0.0.deb 
E: dualsub: changelog-file-missing-in-native-package
W: dualsub: unknown-control-file control~
E: dualsub: no-copyright-file
E: dualsub: description-starts-with-package-name
W: dualsub: extended-description-line-too-long
E: dualsub: wrong-file-owner-uid-or-gid usr/ 1001/1001
W: dualsub: non-standard-dir-perm usr/ 0700 != 0755
E: dualsub: wrong-file-owner-uid-or-gid usr/bin/ 1001/1001
W: dualsub: non-standard-dir-perm usr/bin/ 0700 != 0755
E: dualsub: wrong-file-owner-uid-or-gid usr/bin/dualsub 1001/1001
E: dualsub: wrong-file-owner-uid-or-gid usr/lib/ 1001/1001
W: dualsub: non-standard-dir-perm usr/lib/ 0700 != 0755
E: dualsub: wrong-file-owner-uid-or-gid usr/lib/dualsub/ 1001/1001
W: dualsub: non-standard-dir-perm usr/lib/dualsub/ 0700 != 0755
E: dualsub: wrong-file-owner-uid-or-gid usr/lib/dualsub/README.md 1001/1001
E: dualsub: wrong-file-owner-uid-or-gid usr/lib/dualsub/dualsub.jar 1001/1001
E: dualsub: wrong-file-owner-uid-or-gid usr/share/ 1001/1001
W: dualsub: non-standard-dir-perm usr/share/ 0700 != 0755
E: dualsub: wrong-file-owner-uid-or-gid usr/share/applications/ 1001/1001
W: dualsub: non-standard-dir-perm usr/share/applications/ 0700 != 0755
E: dualsub: wrong-file-owner-uid-or-gid usr/share/applications/dulasub.desktop 1001/1001
E: dualsub: wrong-file-owner-uid-or-gid usr/share/dualsub/ 1001/1001
W: dualsub: non-standard-dir-perm usr/share/dualsub/ 0700 != 0755
E: dualsub: wrong-file-owner-uid-or-gid usr/share/dualsub/dualsub.png 1001/1001
W: dualsub: jar-not-in-usr-share usr/lib/dualsub/dualsub.jar
W: dualsub: binary-without-manpage usr/bin/dualsub
W: dualsub: desktop-entry-file-has-crs usr/share/applications/dulasub.desktop:1
W: dualsub: desktop-entry-invalid-category Other usr/share/applications/dulasub.desktop

I was able to get rid of all these issues.

To sum it up, I moved the jar file to /usr/share, fixed the file permissions (run dpkg-deb with fakeroot), and added a manpage, copyright and changelog file. The rest were just some formatting issues.

Additionally I replaced the icon with a full set of hicolor icons and added Java to the package dependencies. I've also changed the category to "video" and set the version in the changelog from "1.0" to "1.0.0".

Here's the fixed package: https://github.com/darealshinji/dualsub/blob/debian/Debian/dualsub_1.0.0_all.deb

Issue mergin files

class java.io.FileNotFoundException:C:\Users\K\AppData\Local\Temp\7zE4F6EBD66\roma.2018.1080p.nf.web-dl.ddp5.1.x264-sigla.en.srt (The system cannot find the path specified)
java.io.FileInputStream.open0(Native Method)
java.io.FileInputStream.open(Unknown Source)
java.io.FileInputStream.(Unknown Source)
java.io.FileInputStream.(Unknown Source)
io.github.bonigarcia.dualsub.srt.Srt.readSrtInputStream(Srt.java:140)
io.github.bonigarcia.dualsub.srt.Srt.readSrt(Srt.java:94)
io.github.bonigarcia.dualsub.srt.Srt.(Srt.java:55)
io.github.bonigarcia.dualsub.srt.Worker.doInBackground(Worker.java:112)
io.github.bonigarcia.dualsub.srt.Worker.doInBackground(Worker.java:38)
javax.swing.SwingWorker$1.call(Unknown Source)
java.util.concurrent.FutureTask.run(Unknown Source)
javax.swing.SwingWorker.run(Unknown Source)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)

Spanish.zip

Exception happened

I use your application to merge my subtitles .
and I add them but this exception happened .
io.github.bonigarcia.dualsub.srt.DualSrt.signature(DualSrt.java:480)
io.github.bonigarcia.dualsub.srt.DualSrt.writeSrt(DualSrt.java:458)
io.github.bonigarcia.dualsub.srt.Worker.doInBackground(Worker.java:142)
io.github.bonigarcia.dualsub.srt.Worker.doInBackground(Worker.java:38)
javax.swing.SwingWorker$1.call(SwingWorker.java:295)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
javax.swing.SwingWorker.run(SwingWorker.java:334)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)

Questionare bugged the software

I completed already more than 10 times. But your forced questionnaire don't let me use the software.
Downgrading to 1.0 until you remove this nonsense.

Cannot install on Manjaro Linux (Archbased):

==> Entering fakeroot environment...
==> Starting package()...
install: cannot stat './target/dualsub-1.1.0-SNAPSHOT-jar-with-dependencies.jar': No such file or directory
==> ERROR: A failure occurred in package().
Aborting...
==> ERROR: Makepkg was unable to build dualsub-git.

Font size support

It would be very nice if dualsub has support for setting font size for each of subtitle part.
It can be implemented by adding <font size="10pt"></font> tag. This way it would be possible to make subtitles in the second language smaller to put accent to subtitles in the first language.

Exception while merging two subtitles

Tried to merge subtitles and got an exception.
There is a stack trace:
class java.lang.NullPointerException:null
io.github.bonigarcia.dualsub.srt.DualSrt.processDesync(DualSrt.java:254)
io.github.bonigarcia.dualsub.srt.Merger.mergeSubs(Merger.java:99)
io.github.bonigarcia.dualsub.srt.Worker.doInBackground(Worker.java:140)
io.github.bonigarcia.dualsub.srt.Worker.doInBackground(Worker.java:38)
java.desktop/javax.swing.SwingWorker$1.call(SwingWorker.java:304)
java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
java.desktop/javax.swing.SwingWorker.run(SwingWorker.java:343)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
java.base/java.lang.Thread.run(Thread.java:834)
Star.Trek.First.Contact.1996.zip

Empty lines overlapping

Hi Boni Garcia, nice interface!

Let's assume source has the same number but contains empty lines
this is not handled correctly making the merge overlapping.
Example:

1
00:00:01,280 --> 00:00:02,796
. Bonjour à toutes et à tous, .. Hello everyone, .

2
00:00:02,816 --> 00:00:04,076
. Hello everyone, .. 3 00:00:04,096 --> .
. .. 00:00:06,256 Sorry i can't .
. .. be yours live .

3
00:00:04,096 --> 00:00:06,236
. Désolé de ne pouvoir être .. .
. des vôtres en direct ..

I suggest also the feature to merge simply left srt files when none is provided on the right column.
Remembering the previous path would be also nice instead of starting on the home directory (linux)
to add multiple files.

Multiple selection files can be a painful task with the increasing number of files but I solved this issue with drag and drop but one by one. (dropped directory which contains srt files only is not supported )

Auto translation error

Seems google changed the URL for translation:

class java.io.IOException:Server returned HTTP response code: 503 for URL: http://ipv4.google.com/sorry/IndexRedirect?continue=http://translate.google.com/translate_a/t%3Fclient%3Dp%26text%3D%25C3%2589sta%2Bes%2Bla%2Bhistoria%2Bde%2BLola%2By%2BAna%252C%2B%26sl%3Des%26tl%3Den&q=CGMSBGx0uBgY6fyIrgUiGQDxp4NL5i4O5wE8F4dPXjZrQSYuD97wW54
sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1839)
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
com.github.dualsub.translate.Translator.connect(Translator.java:80)
com.github.dualsub.translate.Translator.translate(Translator.java:61)
com.github.dualsub.srt.Srt.(Srt.java:67)
com.github.dualsub.srt.Worker.doInBackground(Worker.java:128)
com.github.dualsub.srt.Worker.doInBackground(Worker.java:37)
javax.swing.SwingWorker$1.call(SwingWorker.java:295)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
javax.swing.SwingWorker.run(SwingWorker.java:334)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)

FYI -- ubuntu 14.04 :: install via software center

hi -- thanks for your effort --
during install i get the following error (but using dpkg -i dualsub*.deb everything is fine)

The package is of bad quality

The installation of a package which violates the quality standards isn't allowed. This could cause serious problems on your computer. Please contact the person or organisation who provided this package file and include the details beneath.

Lintian check results for /home/bakro/Downloads/dualsub-1.0.0.deb:
E: dualsub: wrong-file-owner-uid-or-gid usr/ 1001/1001
E: dualsub: wrong-file-owner-uid-or-gid usr/bin/ 1001/1001
E: dualsub: wrong-file-owner-uid-or-gid usr/bin/dualsub 1001/1001
E: dualsub: wrong-file-owner-uid-or-gid usr/lib/ 1001/1001
E: dualsub: wrong-file-owner-uid-or-gid usr/lib/dualsub/ 1001/1001
E: dualsub: wrong-file-owner-uid-or-gid usr/lib/dualsub/README.md 1001/1001
E: dualsub: wrong-file-owner-uid-or-gid usr/lib/dualsub/dualsub.jar 1001/1001
E: dualsub: wrong-file-owner-uid-or-gid usr/share/ 1001/1001
E: dualsub: wrong-file-owner-uid-or-gid usr/share/applications/ 1001/1001
E: dualsub: wrong-file-owner-uid-or-gid usr/share/applications/dulasub.desktop 1001/1001
E: dualsub: wrong-file-owner-uid-or-gid usr/share/dualsub/ 1001/1001
E: dualsub: wrong-file-owner-uid-or-gid usr/share/dualsub/dualsub.png 1001/1001

Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library

Os: Kubuntu 21.04

Java version:
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2, mixed mode, sharing)

When I try to open the app with terminal I get this error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2630)
        at java.base/java.lang.Runtime.load0(Runtime.java:768)
        at java.base/java.lang.System.load(System.java:1837)
        at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
        at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
        at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
        at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2648)
        at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
        at java.base/java.lang.System.loadLibrary(System.java:1873)
        at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1399)
        at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1397)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1396)
        at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1429)
        at com.jgoodies.plaf.LookUtils.isLowResolution(LookUtils.java:405)
        at com.jgoodies.plaf.LookUtils.<clinit>(LookUtils.java:174)
        at com.jgoodies.plaf.plastic.PlasticLookAndFeel.<clinit>(PlasticLookAndFeel.java:122)
        at io.github.bonigarcia.dualsub.gui.DualSub.<init>(DualSub.java:125)
        at io.github.bonigarcia.dualsub.gui.DualSub.main(DualSub.java:550)

Crash : bug report requested

processed.zip

io.github.bonigarcia.dualsub.srt.Merger.mergeSubs(Merger.java:99)
io.github.bonigarcia.dualsub.srt.Worker.doInBackground(Worker.java:140)
io.github.bonigarcia.dualsub.srt.Worker.doInBackground(Worker.java:38)
javax.swing.SwingWorker$1.call(SwingWorker.java:295)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
javax.swing.SwingWorker.run(SwingWorker.java:334)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)

Problem is with the EN subtitle. I will also investigate why the crash

Gif files make the app's filesize pointlessly huge

The src/main/resources/img/cosmos*.gif files make the jar file pointlessly huge. Maybe the pictures should be replaced with links or something like that? Without those gif files, the jar file will only be about 1 mb in size.
A few kb could also be saved if the VLC snapshot picture is replaced with a jpeg.

New Release?

I was going to write about the debian package issues, but I see they are fixed. Can you do a new release so the fixes are distributed to everyone? Thanks!

Too many open files

INFO: I/O exception (java.net.SocketException) caught when processing request to {}->http://ipv4.google.com:80: Too many open files
Nov 12, 2023 10:30:36 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {}->http://ipv4.google.com:80

Will the request be retried or will there be some missed subtitles?

Is this still supported? Anyone have a docker container image / docker-compose for this?

My wifes was an immigrant and we used to watch stuff to learn languages. This was really helpful educational tool. One thing I discovered was some utilities that would create a merger / unifty multiple language subs and display them concurrently at the same time.
I know theres some web tools out there which as seemingly innocuous as a sub file could be....rather self host......also rather bulk / automate then ad hoc generate on demand.

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.