Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|||||||
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | Link |
|
Author of BDSup2Sub
Join Date: Jun 2003
Posts: 410
|
BDSup2Sub - convert and tweak bitmap subtitle streams (VobSub,BD-SUP,BDN XML,HD-SUP)
BDSup2Sub is a tool I wrote initially to convert captions demuxed from a Blu-Ray transport stream (M2TS) into the DVD VobSub format (SUB/IDX) used by many DVD authoring tools - hence the name. Many more features were added over time as was support for other formats. So in the meantime the name seems a little inappropriate. In a nutshell, it's a subtitle conversion tool (for image based formats) with scaling capabilities and some other nice features.
Feedback is welcome - especially from the authors of other tools to discuss compatibility issues. To report problems with a subtitle stream, please either post the zipped stream (if it is compliant with the forum rules) or upload it to a "one click hoster" and send me a PM with the link. And don't forget a detailed error description. Supported Formats
Features
Download Current version: 3.9.9 (15.11.2009) http://www.sendspace.com/file/4mcnk5 Previous versions: 3.9.8:http://www.sendspace.com/file/epw7ng 3.9.7:http://www.sendspace.com/file/k8lcmo 3.9.6:http://www.sendspace.com/file/w5tfal The download is a JAR archive that needs an installed Java runtime (Java 6 JRE) to run. You can get it from Sun's website: http://java.sun.com/javase/downloads/index.jsp (e.g. JRE 6 Update 13) A complete revision history can be found at the end of the online help. Usage With the Java runtime installed, the JAR can be started by double clicking on it. Alternatively, you can start it from the command line via: Code:
java -jar BDSup2Sub.jar Code:
javaw -jar BDSup2Sub.jar CLI BDSup2Sub can be (almost) completely controlled from the command line. See online help for details. For a quick help on the command line call it with "/help" or "/?" as only parameter. Code:
java -jar BDSup2Sub.jar /help Code:
java -jar BDSup2Sub <in> <out> [options]
Options:
/res:<n> : set resolution to 480, 576, 720 or 1080 - default 576
Predefined values: keep, ntsc=480, pal=576, 1440x1080
/fps:<t> : synchronize target frame rate to <t> - default: auto
Predefined values; 24p=23.976, 25p=25, 30p=29.967
/fps:keep preserves the source fps (for BD&XML)
/fps:<s>,<t> : convert framerate from <s> to <t>
Predefined values; 24p=23.976, 25p=25, 30p=29.967
/fps:auto,<t> detects source frame rate automatically
/dly:<t> : set delay in ms - default: 0.0
/filter:<f> : set scaling filter - default: bilinear
Supported values: bilinear, triangle, bicubic, bell,
b-spline, hermite, lanczos3, mitchell
/palmode:<s> : palette mode: keep, create, dither - default: create
/tmin:<t> : set minimum display time in ms - default: 500
/tmerge:<t> : set max time diff for merging subs in ms - default: 200
/movin:<r>[,<o>] : move captions inside screen ratio <r>, +/- offset <o>
/movout:<r>[,<o>]: move captions inside screen ratio <r>, +/- offset <o>
/movex:<t>[,<o>] : move captions horizontally.<t> may be left,right,center.
+/- optional offset <o> (only if moving left or right)
/cropy:<n> : crop the upper/lower n lines - default: 0
/acrop:<n> : set alpha cropping threshold - default: 10
/scale:<x>,<y> : scale captions with free factors - default: 1.0,1.0
/exppal[+/-] : export target palette in PGCEdit format - default: off
/forced[+/-] : export only forced subtitles - default: off (export all)
/forceall[+/-] : set/clear forced flag for all subs - default: off (keep)
/swap[+/-] : swap Cr/Cb components - default: off (don't swap)
/fixinv[+/-] : fix zero alpha frame palette - default: off (don't fix)
/verbatim[+/-] : switch on verbatim console output mode - default: off
Options only for SUB/IDX or SUP/IFO as target:
/atr:<n> : set alpha threshold 0..255 - default 80
/ltr1:<n> : set lum lo/mid threshold 0..255 - default auto
/ltr2:<n> : set lum mid/hi threshold 0..255 - default auto
/lang:<s> : set language to string <s> - default: de (only SUB/IDX)
/pal:<s> : load palette file <s> - default: use builtin palette
Note:
Boolean parameters like "verbatim" are switched off with a trailing "-".
Wildcard support:
To use wildcards, enclose the whole parameter string in double quotes.
For filenames containing spaces, use single quotes around the file name.
Use "*" for any character and "?" for one character in the source name
Use exactly one "*" in the target file name.
Example:
java -jar BDSup2Sub.jar "'movie* 1?.sup' dvd_*.sub /res:720 /fps:25p"
Increasing the RAM size Java application only get a maximum of 64MB of RAM per default. This can lead to 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: Code:
java -Xmx256m -jar BDSUp2Sub.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!). Code:
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\"" 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. Drag'n'Drop Since version 2.8, 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. Disclaimer BDSup2Sub is provided "as is" without warranty of any kind. Use it at your own risk. BDSup2Sub is freeware in the sense of "free for all to use". Download it, give it to your friends or whatever. If you intend to put it as download on your site, please make a reference to this thread. If you plan to use BDSup2Sub in a commercial environment, please contact me before via PM. Currently, BDSup2Sub is not open source ("free software") yet, as it's work in progress and I need to clean up and document quite a few things to release the sources to the public. While I hope this might happen soon, chances are it never will. If it should happen, the license used will be most probably either the Apache license 2.0 or the LGPL 3.0. However, if you're interested in the sources to just have a look at the implementation or copy out minor parts for your own projects, you're welcome to. Just drop me a PM. I you wish to use the JAR as a library for converting subtitles, you're invited to. JavaDocs are included for all interesting public interfaces, so you just need to integrate the JAR in your project. For an example how to interface the core objects, just drop me a note. Besides, a part of the sources that is licensed under the LGPL or Apache license is already included in the JAR (rename to ZIP and extract the "src" folder). This includes also the following functionalities:
The other sources included (e.g. Props, FileBuffer, BitStream) are completely done by me, myself and I and are released under the Apache License 2.0. In a nutshell that means you can use them and modify them even for closed source projects, as long as you leave some copyright info in (see the included Apache License for details). Have fun. Screenshots Main screen (source in upper part, target in lower part) ![]() Conversion dialog with the basic conversion options ![]() Edit dialog ![]() Move dialog
Last edited by 0xdeadbeef; 15th November 2009 at 23:29. |
|
|
|
|
|
#2 | Link |
|
Registered User
Join Date: Oct 2006
Location: Hong Kong
Posts: 218
|
Thanks very much for your effort and sharing.
I have tried to convert two sups with your program and it works. I noticed that the results of idx+sub will vary with the size of the original sup (font size of the original). The first one in the figure is very nice. The second one, which engages smaller font, the edges are not all correctly marked.(upper image taken from suprip, lower one from .son file) |
|
|
|
|
|
#4 | Link | |
|
Author of BDSup2Sub
Join Date: Jun 2003
Posts: 410
|
Quote:
Not in the sense of a real open source software since it would be a major effort to clean up the sources to a state that they were worth to be publicly released. Then again, as always with my software, if someone kindly asks for the sourcecode, I will share it of course. Just be warned: the sources are quite a mess currently. Last edited by 0xdeadbeef; 26th February 2009 at 17:39. |
|
|
|
|
|
|
#5 | Link | |
|
Fighting spam with a fish
Join Date: Sep 2005
Posts: 2,305
|
Quote:
__________________
FAQs:Bond's AVC/H.264 FAQ,Bond's MPEG-4 ASP FAQ Sites:Adubvideo,MeGUIWiki,MeGUI Ipod Conversion Guide |
|
|
|
|
|
|
#6 | Link |
|
Author of BDSup2Sub
Join Date: Jun 2003
Posts: 410
|
Well I sure don't intend to add OCR to SupToSub, so all I could offer would be an export to an easy to implement format. E.g. a bunch of GIFs plus a text file similar to the IDX of VobSub. Then maybe someone could set up a scripting tools to convert this to SRT or whatever.
|
|
|
|
|
|
#7 | Link |
|
Author of BDSup2Sub
Join Date: Jun 2003
Posts: 410
|
A little update:
26/02/2009 1.0 -> 1.1 -Added progress dialog for import -Added check for existing target files and write protection -Added detection of forced subtitles and the possibility to export only forced subs -Removed some checks from RLE decoding to support some non-standard frames which write to the next line without EOL -Fixed two small bugs in run length decoding (fixes reading exports from SupRead) -Support for multi-packet pictures (well, exactly two packets are supported for the moment) I edited the first posting... Sorry, another micro update to 1.1b (not visible in GUI) since there was another bug with multi-packet support for SUPs. This should really work for all two-packet SUPs. I'll add unlimited packet support later though no SUP stream seems to use it. Last edited by 0xdeadbeef; 27th February 2009 at 02:05. |
|
|
|
|
|
#10 | Link |
|
Registered User
Join Date: Nov 2002
Posts: 69
|
Yes
, some Bluray titles don't have subtitles that the DVD versión does have, and sometimes de DVD version is better placed or have better font (Warner BR subtitles are placed in the black bars if the movie is 2.35, some of us hate that, and right now there's no way to change the position, the DVD subtitles can be placed inside the 2.35 image itself).Another petition, an option to resize BR subs from 1080p to 720p, currently it's not possible to have BD5 at 720 with subtitles because no program exist that converts the subs from 1080p to 720p.
|
|
|
|
|
|
#12 | Link |
|
Author of BDSup2Sub
Join Date: Jun 2003
Posts: 410
|
The resizing to 720p itself, although a little different compared to the approach used for VobSub, would be easy to implement. Then again, I don't have any SUP writing functionality yet (as well as SUB/IDX Reading). While one might think that it should be easy to implement a writer when you already know the format to implement a reader, the problem is that I can skip a lot of unknown stuff when reading, but have to write it when writing.
Chances are that with all the guessing about these unknown fields I have to do, the written SUP file creates all kind of problems when used with different players. |
|
|
|
|
|
#13 | Link |
|
Registered User
Join Date: Oct 2003
Posts: 404
|
for me it was just that my WD TV HD Media Player plays MKV/SUB/IDX and i encode my blurays down to 720p MKV's for storage on it. i use subrip right now to ocr to srt and this app would save those steps thats all
![]() either way your app does a great job thx .. edit: actually they look pretty good as they are on my tv playing on the WD player so thats very cool and saves me alot of work thx
Last edited by woah!; 2nd March 2009 at 01:56. |
|
|
|
|
|
#14 | Link |
|
Author of BDSup2Sub
Join Date: Jun 2003
Posts: 410
|
Hm, my only option would be to export 720p SUPs since SUB/IDX doesn't officially support 720p (and I would be surprised if any player could handle it). Then again, I would be surprised to hear that MKV streams can contain SUPs.
So the 720p SUP would only make sense for the use case that SquallMX suggested (converting a 1080p BD to 720p BD5 to save space). Last edited by 0xdeadbeef; 2nd March 2009 at 02:21. |
|
|
|
|
|
#15 | Link |
|
Registered User
Join Date: Nov 2002
Posts: 69
|
Hi, i found a little bug, the program crash when i load this Sup file (From Matrix R1 Bluray):
http://rapidshare.com/files/20426218...track_4609.sup
|
|
|
|
|
|
#16 | Link |
|
Author of BDSup2Sub
Join Date: Jun 2003
Posts: 410
|
Hm, this seems to be from an NTSC stream? The screen size is 720x480, therefore the "downsizing" to PAL (which is the default target resolution) fails with a division by zero.
I'm thinking of a workaround - yet this is not really a planned scenario. |
|
|
|
|
|
#17 | Link |
|
Author of BDSup2Sub
Join Date: Jun 2003
Posts: 410
|
A little update (edited the first post for download)
02.03.2009 1.1 -> 1.2
|
|
|
|
|
|
#18 | Link |
|
н∂-αиαтι˘
Join Date: May 2006
Location: Bedfordshire, UK
Posts: 986
|
request: is it possible to remember last folder?
also i noticed after loading the above file for matrix, it says, source fps 23.976 dest fps 25? is that correct? and yes, that was using the latest version. |
|
|
|
|
|
#19 | Link |
|
Author of BDSup2Sub
Join Date: Jun 2003
Posts: 410
|
While the program is running, it remembers the last folder. However, it doesn't save any ini file yet. This is on my list however.
Regarding the SRC/TRG frame rates: AFAIK the SUP file doesn't contain any info about the frame rate. Therefore, if you want to convert the frame rate, you have to select the source and target frame rates manually. The 23.976 as source and 25fps as target is just the default setting as this is my typical scenario (PAL speedup from 24p). Indeed the source and target frame rates are only used to calculate a speedup/slowdown factor that's used to manipulate the time stamps. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|