Skip to content

Application Hints

Miklos Juhasz edited this page Dec 22, 2012 · 3 revisions

Increasing the RAM size

You can run into memory problems when loading SUPs with thousands of warnings or if importing XML/PNG with very large images. The java runtime supports command line switches to increase the RAM size though:

java -Xmx256m -jar BDSUp2Sub.jar

This will increase the maximum heap to 256MB of RAM which should be enough in all cases. Since this is a parameter to the virtual machine, it must be used before the "-jar" and it has no influence on BDSup2Sub's command line switches.

Disabling Direct3D support in case of problems

When running in Windows, the Java runtime environment tries to make use of Direct3D for hardware accelerated blitting and storing images in the RAM of the video card. However due to implementation bugs in the JRE and or the video card drivers, this can lead to problems with certain combinations of hardware, video card drivers and JRE versions which start with visual artefacts (redraw problems, flickering, displaced graphics) and can end with system crashes. If this happens, the use of Direct3D can be disabled by adding the command line switch "-Dsun.java2d.d3d=false" when starting a Java application.
To affect any Java application, it's usually a good idea to disable the use of Direct3D globally by creating an environment variable called "_JAVA_OPTIONS" with the value "-Dsun.java2d.d3d=false". This can be done in the System control of the Windows control panel.
Just in case that you're using Eclipse, I'd like to mention that setting this environment variable makes it impossible to start current versions of Eclipse with the default launcher (Eclipse.exe). This is obviously a weird bug in the launcher - then again, you can still start Eclipse directly via the correct Jar.

Integration in the Windows Explorer

Unfortunately it's impossible to change the Windows registry in Java without sacrificing platform independence. So to register BDSup2Sub as default application for SUP files, some manual work is needed. Cut out this text and save it with a plain text editor (e.g. NotePad) as BDSup2Sub.reg (the extension ".reg" is important!).

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.sup]
@="SUP BD/HD-DVD caption stream"

[HKEY_CLASSES_ROOT\.sup\shell]

[HKEY_CLASSES_ROOT\.sup\shell\open]

[HKEY_CLASSES_ROOT\.sup\shell\open\command]
@="E:\\dev\\java\\jre_6_0\\bin\\javaw.exe -jar d:\\src\\java\\BDSup2Sub\\BDSup2Sub.jar \"%1\""

Then replace "E:\dev\java\jre_6_0\bin" with the path to your Java runtime and "d:\src\java\BDSup2Sub" with your installation directory of BDSup2Sub. Remember to use double backlashes ("\" instead of "")!!!
Now save the file and double click it from the Explorer. Chose "yes" in the following two dialogs. If you (and I) did everything right, BDSup2Sub should be used now to open SUP files when you double click on them.
You can use the same approach of course to open VobSubs. Just replace "sup" with "idx" and "SUP BD/HD-DVD caption stream" with "SUB/IDX caption stream" or whatever you like as name.

Desktop Integration (Icons)

If you install BDSup2Sub from the *.deb package on Linux or from the *.dmg on Mac OSX then the desktop integration is taken care of. If you're running the application from the *.jar file directly then you have to create a desktop or launcher icon to start BDSup2Sub. While BDSup2Sub has an application icon, unfortunately, the default coffee cup of the Java Virtual Machine is used in this case. This is because a JAR is always opened with the installed JVM so you get the icon of the JVM, not the one of the application inside the JAR. Still it's possible to change the icon manually. For your convenience the PNG pictures used by the application, an ICO file for Windows and an ICNS file for MacOS X are also provided. To download these icons from this url

Drag'n'Drop

BDSup2Sub is able to open files via Drag'n'Drop. Just drag a SUP, XML, IFO or IDX file on the application window and release the mouse button. As BDSup2Sub is not able to open more than one subtitle stream at a time, only one file will be opened if you drag&drop multiple files. Internally, always the first file in the passed list is opened - this might however not be the file that is displayed first in your selection. Anyway, this feature is meant for one file only anyway.
Note: as explained in the SUP/IFO section, Drag'n'Drop of a DVD-SUP will lead to wrong detection as HD-DVD-SUP and the import will fail with error messages. Drag'n'Drop of the IFO works though.

The INI file (persistence)

BDSup2Sub stores some settings in an INI file. This bdsup2sub.ini file is

  • on Mac OSX in the user's home folder in Library/Application Support/bdsup2sub
  • on Linux in the user's home folder in $XDG_CONFIG_HOME/bdsup2sub (usually .config/bdsup2sub)
  • on Windows in the user's home folder in bdsup2sub/

You should usually not need to edit or delete this file yet both is possible. If the INI file (or entries within it) is missing, BDSup2Sub will use some default settings.

#BDSup2Sub 5.0 settings - don't modify manually
#Wed Oct 31 21:55:08 CET 2012
filter=MITCHELL
loadPath=/home/mjuhasz/Downloads/testfiles/20.ifo
mergePTSdiff=1620000
recent_0=/home/mjuhasz/Downloads/testfiles/20.ifo
frameHeight=600
verbose=true
framePosY=81
framePosX=974
alphaCrop=14
frameWidth=800
paletteMode=KEEP_EXISTING

As you can see, some (yet not nearly all) program settings are stored in the INI file. E.g. the default filter (in this case: "Mitchell") or the verbose output setting. Note that also "alphaCrop" and "mergePTSdiff" are stored which can be (currently) only selected via the command line (by using the parameters "--alpha-crop" and "--merge-time"). This means that you don't need to set e.g. "--merge-time" every time you call BDSup2Sub. This however also means that this setting is kept until you actively change it again (or delete the INI file).