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.

 

Go Back   Doom9's Forum > General > Subtitles

Reply
 
Thread Tools Search this Thread Display Modes
Old 26th February 2009, 00:39   #1  |  Link
0xdeadbeef
Author of BDSup2Sub
 
Join Date: Jun 2003
Posts: 478
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
  • Blu-Ray SUP: Import (since 1.0) and Export (since 1.6)
  • Sony BDN XML: Import and Export (since 3.3.0)
  • HD-DVD SUP: Import (since 1.9)
  • VobSub (SUB/IDX): Import (since 3.5.0) and Export (since 1.0)
  • DVD-SUP (SUP/IFO): import and export (since 3.9.0)

Features
  • add a fixed delay to all timestamps (since 1.0)
  • perform a frame rate conversion e.g. for pal speedup (since 1.0)
  • synchronize time stamps to output frame rate (since 2.0)
  • edit times and position of each caption (since 2.3)
  • control all features (except editing) from the command line (since 1.7)
  • move all captions inside or outside a given area (since 2.7) or horizontally (since 3.9.6)
  • scale up/down with a variety of filters (from bilinear over bicubic to Lanczos3 and Mitchell) (since 3.4.0)
  • edit "forced" flags (since 3.6.0)
  • exclude single captions from export (since 3.6.0)
  • erase rectangular regions of a caption (since 3.6.0)
  • scale captions independently of screen size (since 3.7.0)
  • automatically remove fade in/out from imported subtitle streams
  • export the target palette in PGCEdit text format (RGB values 0..255) (since 3.9.0)
  • edit the imported DVD palette when input is either VobSub or SUP/IFO (since 3.9.1)
  • edit the frame palette and alpha values when input is either VobSub or SUP/IFO (since 3.9.3)
  • set/clear forced flags for all captions (since 3.9.9)

Documentation
The complete documentation is available from the help menu inside the application. You can also read it online.

Download

Current version: 4.0.0 (14.12.2009)
http://www.sendspace.com/file/j3df4s


Previous versions:
3.9.9:http://www.sendspace.com/file/4mcnk5
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
or in Windows if you don't want a open CMD box:

Code:
javaw -jar BDSup2Sub.jar

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 December 2009 at 14:06.
0xdeadbeef is offline   Reply With Quote
Old 26th February 2009, 05:04   #2  |  Link
BigCondor
Registered User
 
Join Date: Oct 2006
Location: Hong Kong
Posts: 224
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)
Attached Images
 
BigCondor is offline   Reply With Quote
Old 26th February 2009, 15:27   #3  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,263
any plans to open the source of the tool?
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 26th February 2009, 17:18   #4  |  Link
0xdeadbeef
Author of BDSup2Sub
 
Join Date: Jun 2003
Posts: 478
Quote:
Originally Posted by BigCondor View Post
I noticed that the results of idx+sub will vary with the size of the original sup (font size of the original).
Well, of course they do. The smaller the input picture, the smaller the output picture. For OCR purposes, the best choice would be the original picture from the Blu-Ray SUP. Therefore it doesn't make much sense to use the converted low-res picture for OCR. Besides, the subsampling used for antialiasing also contradicts the idea of OCR in a way.

Quote:
Originally Posted by Selur View Post
any plans to open the source of the tool?
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.
0xdeadbeef is offline   Reply With Quote
Old 26th February 2009, 19:11   #5  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,685
Quote:
Well, of course they do. The smaller the input picture, the smaller the output picture. For OCR purposes, the best choice would be the original picture from the Blu-Ray SUP. Therefore it doesn't make much sense to use the converted low-res picture for OCR. Besides, the subsampling used for antialiasing also contradicts the idea of OCR in a way.
Yes, but unfortunately, there doesn't exist a "perfect" solution yet for OCRing blu-ray subtitles. Suprip is pretty good, but suffers from a few major bugs here and there.
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo
Adub is offline   Reply With Quote
Old 26th February 2009, 20:30   #6  |  Link
0xdeadbeef
Author of BDSup2Sub
 
Join Date: Jun 2003
Posts: 478
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.
0xdeadbeef is offline   Reply With Quote
Old 27th February 2009, 01:10   #7  |  Link
0xdeadbeef
Author of BDSup2Sub
 
Join Date: Jun 2003
Posts: 478
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.
0xdeadbeef is offline   Reply With Quote
Old 27th February 2009, 08:20   #8  |  Link
shon3i
BluRay Maniac
 
shon3i's Avatar
 
Join Date: Dec 2005
Posts: 2,426
Do you think about reverse process? DVD->BluRay?
shon3i is offline   Reply With Quote
Old 27th February 2009, 12:27   #9  |  Link
0xdeadbeef
Author of BDSup2Sub
 
Join Date: Jun 2003
Posts: 478
Not really. Would this make sense?
0xdeadbeef is offline   Reply With Quote
Old 27th February 2009, 18:34   #10  |  Link
SquallMX
Special SeeD
 
Join Date: Nov 2002
Location: Mexico
Posts: 248
Quote:
Originally Posted by 0xdeadbeef View Post
Not really. Would this make sense?
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.

SquallMX is offline   Reply With Quote
Old 28th February 2009, 02:24   #11  |  Link
woah!
Registered User
 
Join Date: Oct 2003
Posts: 435
1080 to 720 resizing would be very cool if possible, otherwise it works very well thx
woah! is offline   Reply With Quote
Old 1st March 2009, 16:23   #12  |  Link
0xdeadbeef
Author of BDSup2Sub
 
Join Date: Jun 2003
Posts: 478
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.
0xdeadbeef is offline   Reply With Quote
Old 2nd March 2009, 01:42   #13  |  Link
woah!
Registered User
 
Join Date: Oct 2003
Posts: 435
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.
woah! is offline   Reply With Quote
Old 2nd March 2009, 02:18   #14  |  Link
0xdeadbeef
Author of BDSup2Sub
 
Join Date: Jun 2003
Posts: 478
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.
0xdeadbeef is offline   Reply With Quote
Old 2nd March 2009, 05:47   #15  |  Link
SquallMX
Special SeeD
 
Join Date: Nov 2002
Location: Mexico
Posts: 248
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

SquallMX is offline   Reply With Quote
Old 2nd March 2009, 17:54   #16  |  Link
0xdeadbeef
Author of BDSup2Sub
 
Join Date: Jun 2003
Posts: 478
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.
0xdeadbeef is offline   Reply With Quote
Old 2nd March 2009, 20:14   #17  |  Link
0xdeadbeef
Author of BDSup2Sub
 
Join Date: Jun 2003
Posts: 478
A little update (edited the first post for download)

02.03.2009 1.1 -> 1.2
  • Reworked SUP multipacket parsing to support unlimited packets (kinda untested though for > 2 packets).
  • Fixed bug in detection of primary color & luminance thresholds.
  • Added workaround to prevent crash when loading SUPs in NTSC/PAL resolution.
    Note that "upscaling" NTSC to PAL will not change the size of the bitmap, only the offsets.
    Also downsizing from PAL to NTSC might fail - I'll have to reconsider this issue later.
  • Info was not updated when switching output format
  • Added fixed line feed after even and off RLE buffer since VobSub sometimes skipped the last line
0xdeadbeef is offline   Reply With Quote
Old 3rd March 2009, 03:12   #18  |  Link
~bT~
н∂-ƒαиαтι˘
 
Join Date: May 2006
Location: Bedfordshire, UK
Posts: 1,005
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.
~bT~ is offline   Reply With Quote
Old 3rd March 2009, 12:18   #19  |  Link
0xdeadbeef
Author of BDSup2Sub
 
Join Date: Jun 2003
Posts: 478
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.
0xdeadbeef is offline   Reply With Quote
Old 3rd March 2009, 16:13   #20  |  Link
~bT~
н∂-ƒαиαтι˘
 
Join Date: May 2006
Location: Bedfordshire, UK
Posts: 1,005
^ sorry. my bad. it was late last night when i posted that and didn't realise the option above which u must tick to enable changing.
~bT~ is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:02.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.