Log in

View Full Version : BDSup2Sub - convert and tweak bitmap subtitle streams (VobSub,BD-SUP,BDN XML,HD-SUP)


Pages : 1 2 3 4 5 6 7 8 9 10 [11] 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

OptimusX
24th July 2009, 04:00
0x,

You're program is awesome, and your level of support admirable. Anyway, enough sucking up (I've waited a long time for a program like yours....really).

Now for the question:

I have been using MaestroSBT for a long time to make DVD subs. The subs that I make are for anime, which may include many types of overlapping subs (dialouge, music, karaoke, translations of a sign, etc.) that are going on all at the same time.

When using MaestroSBT as is, the subs cause an annoying flicker during an overlap, where subs have identical start/end times.

Example:

1. Subtitle A is onscreen. [A]
2. Subtitle B appears, with A. [AB] *flicker occurs
3. B ends with A still remaining. [A] *flicker occurs

Anyway, someone created a script to modify the sonic SST file to give infinite duration to the first sub. I am then given flicker free, overlapping subs.

However, when I generate subs via MaestroSBT (with "infinite timecode" script applied) and get them into BDSup2Sub, the program "fixes" the timecodes to give subs matching start/end times. When I playback the subs, the original "flicker bug" is back.

workflow is:
(MaestroSBT --> muxman with dummy video ---> extract w/ VobSub ---> import to BDSup2Sub).

(Using Subtitle Creator to convert an extracted DVD-SUP to SUB/IDX reintroduces the "flicker bug," since Subtitle Creator seems to "fix" the infinite timecodes as well).

Anyway, my question: is it possible to have BDSup2Sub *not* correct the infinite timecodes? It would be nice to have this functionality to preserve the "flicker fix" when going from sub/idx <--> DVD-SUP, although I am hoping the "flicker fix" will work for a BD-SUP as well.

If this is a concern you've heard before, I appreciate your input. If this is the first time you've heard about the "flicker bug," please compare these two SUB/IDX files. (http://rapidshare.de/files/47932682/To_Blink_or_Not_to_Blink.zip.html)

One is a flickering version, the other not. Either one processed to BD-SUP reintroduces the flicker. The subtitle that serves as a great example is around #10, right at the line "July 1999."

0xdeadbeef
24th July 2009, 20:06
Well, I kinda understand the request and indeed I played with the idea before to keep missing end times untouched. Yet this is not as easy as it may seem. When exporting subtitle streams, BDSUp2Sub uses a very simple packet structure to make things a little less complicated.

E.g. the RLE buffers for VobSubs and BD-Sups have to be split into several fragments if they exceed certain sizes and there are several inter- and intra-packet offsets that have to be adjusted across these fragments if the packet length of one packet differs.

Getting this to work was not really much fun and as I introduced a varying packet length (by only one byte) to support the forced flag in VobSubs, this became even worse. The idea to rework all this code for all (binary) export formats doesn't make me happy to say the least.

OptimusX
25th July 2009, 00:26
Thanks for taking the time to reply. I'm sorry to hear that the solution isn't as simple as I had hoped.

If coding for binaries is the major hurdle, I guess the simplest way this can be solved in the future (and I mean by the community as a whole, not at the expense of your personal time) is to see if a fix can be applied to an xml/png export. (I'm working on an AVCHD and authoring with BD-SUPs, which is the motivation for my initial post)

I'm no programmer, but I would guess a script that edits xml timestamps would be an easier solution than changing code for binary export. This would be essentially the same thing as the script that fixes MaestroSBT .sst output.

But I guess I'll have to wait for an authoring program that accepts xml/png input first.

Anyway, I'm just thinking out loud, I know I'm talking outside of the scope of your program

Anyway, great program, it's useful and really fun to use.

MattLx70
26th July 2009, 21:04
I apologize if these questions are answered. I read the thread and as a newbie to subs I have a couple questions:

Will it work to demux with tsmuxer or are there problems to be expected that way? I can certainly use eac3to and just want to avoid ripping the subs again if tsmuxer should work.

Bigger question: I'm not sure what output options I'm supposed to use. I have a h.264 m2ts file that contains video at 1920:1080p. I also have the .sup of the forced subtitles. I want to create a DVD and don't know if I should be creating .sub/.idx to match the video input file at 1920:1080p or ????

Oh... And will the color, size, and positioning tend to mirror the originals or do I have to get creative with those options?

Thanks in advance for any help.

0xdeadbeef
26th July 2009, 22:27
Will it work to demux with tsmuxer or are there problems to be expected that way? I can certainly use eac3to and just want to avoid ripping the subs again if tsmuxer should work.
The SUP files should be basically the same. Most of my personal examples are demuxed with EAC3TO, but I tested some demuxed with TsMuxer as well. The only difference should be some PTS/DTS time stamps inside the packets.

Bigger question: I'm not sure what output options I'm supposed to use. I have a h.264 m2ts file that contains video at 1920:1080p. I also have the .sup of the forced subtitles. I want to create a DVD and don't know if I should be creating .sub/.idx to match the video input file at 1920:1080p or ????
If you convert to DVD, you should chose either PAL or NTSC as output resolution. If you convert to PAL and use PAL speedup, you should convert frame rate in BDSup2Sub as well. Dunno of TsMuxer can do that, but EAC3TO can't.

Oh... And will the color, size, and positioning tend to mirror the originals or do I have to get creative with those options?
BDSup2Sub is a bitmap based conversion tool. If you scale down from 1080p to e.g. PAL, the size of the subtitles will be reduced according to the factor the screen resolution is reduced. So relative size of the captions won't change.
However sometimes it's a good idea to increase the (relative) scale of the subtitles by factor e.g. 1.2 to make them "prettier" and more readable. Then it also makes sense to use the "move outside" option.

About the colors: since DVD subtitles are limited to 4 colors out of 16 colors, a 100% reproduction of the original colors is usually not possible. The build in help describes the whole issue in detail.

BTW: what tool are you using to create the DVD? ConvertXtoDVD?

MattLx70
26th July 2009, 23:33
Thanks... So since I'm authoring a DVD using an m2ts at NTSC 1920:1080P, should I pick the same with the .sup conversion? It's really the resolution I'm confused on. Should the resulting .sub match the m2ts before I start the authoring?

Yes... I'll use ConvertX2DVD only because that's what I'm comfortable with.

It makes sense that the colors may/will often have to convert because the original file had more options. I'll read the help to try to learn more. Since I'm only dealing with forced subs (not many in the film), I don't want to get creative. If I choose NTSC and 1920:1080P and leave the rest alone, I'm thinking maybe it will be good enough.

0xdeadbeef
26th July 2009, 23:52
Thanks... So since I'm authoring a DVD using an m2ts at NTSC 1920:1080P, should I pick the same with the .sup conversion? It's really the resolution I'm confused on. Should the resulting .sub match the m2ts before I start the authoring?
A Video-DVD can only be NTSC (720x480) or PAL (720x576). So if your DVD will be NTSC, you need to select NTSC (720x480) as output resolution in BDSup2Sub.

Yes... I'll use ConvertX2DVD only because that's what I'm comfortable with.
ConvertXtoDVD has several issues, but I guess at this point I would confuse you more than I'd help you by telling you.

It makes sense that the colors may/will often have to convert because the original file had more options. I'll read the help to try to learn more. Since I'm only dealing with forced subs (not many in the film), I don't want to get creative. If I choose NTSC and 1920:1080P and leave the rest alone, I'm thinking maybe it will be good enough.
Well, NTSC and 1080p is not possible of course. NTSC should do. Anyway, the default options usually work quite well already.

As I said, when scaling down from Full HD to DVD SD, it usually looks a little better to select X/Y scaling factors of 1.2 and move the captions outside the cinemascope window. Mitchell is typically a pretty good choice for the scaling filter. For the rest of the options, the default values should usually work ok.

MattLx70
27th July 2009, 02:06
Thanks again for the help. Hopefully my last question... Is it normal that the sup ripped from a USA BD would default to PAL output? I changed it to NTSC and expect that will work for me.

0xdeadbeef
27th July 2009, 11:24
There's no way that BDSup2Sub could decide whether you want to convert 1080p to PAL or NTSC. All the info about region codes or languages is gone in the demuxed SUP stream.
Anyway, PAL is just the default setting as it's my default use case.

Nikos
3rd August 2009, 12:55
I ripped my original BluRay (1080p) and encoded to 720p .mkv.
For a test i created 2 vobsubs from .sup file, one without scale down and another with scale down from 1080p to 720p.
With media player classic and external directvobsub filter (vsfilter.dll) the subs have exactly the same size and almost the same position, but the quality without scale down is a little better.

Any explain for this?
Is there any problem if i don't scale down?

Thanks for your awesome program and support.

0xdeadbeef
3rd August 2009, 16:55
Well, if you don't scale down, the subtitles are a little too large and a little misplaced. In some cases, this can be still ok, in others parts of the subtitles will be cut off.
Generally, if you scale down the video, you should also scale down the subtitles accordingly to get the correct scale and position. With the appropriate settings, the visual differences of the characters should be pretty insignificant.

Nikos
3rd August 2009, 19:27
Thanks for the quick reply, i will post some screeenshots later.

Now a feature request:
Sometimes the BluRay movies have black bars left and right, i believe it's a good idea to add Crop Offset X option in the move all captions tab.

For example the "DR Strangelove" movie, have about 66 pixels left and 66 pixels right black bars. Also all 4:3 movies have big black bars left and right.

:thanks:

0xdeadbeef
3rd August 2009, 21:02
Sometimes the BluRay movies have black bars left and right, i believe it's a good idea to add Crop Offset X option in the move all captions tab.

For example the "DR Strangelove" movie, have about 66 pixels left and 66 pixels right black bars. Also all 4:3 movies have big black bars left and right.
It's not the movie that has black bars but the 16:9 TV uses black bars to show the 4:3 image without zooming or other tricks. There is nothing that could be cropped here. Cropping only makes sense if the cinemascope bars are encoded into the stream which is the case for some divx movies or TV captures.

Nikos
4th August 2009, 00:10
Here a screenshot from Great Expectations movie (1080p).
http://users.chan.sch.gr/nikos_ch/files/pictures/Great.Expectations.jpg

The whole screen is 1920x1080 pixels, but movie's "real" resolution is about 1472x1080 pixels.

Here if i don't crop the black bars before encoding the TV don't add black bars because the whole screen is 16:9

If i crop the black bars "Crop(224, 0, -224, -0)" before encoding then the TV add black bars right(224) and left(224).

Gokumon
6th August 2009, 19:35
It's not the movie that has black bars but the 16:9 TV uses black bars to show the 4:3 image without zooming or other tricks. There is nothing that could be cropped here. Cropping only makes sense if the cinemascope bars are encoded into the stream which is the case for some divx movies or TV captures.

All content on Blu-Rays that are not perfectly 16x9 (such as 4:3, 5:4, and anything 1.85 and wider) will have black bars encoded into the stream in order to fit it into the 16x9 frame. In an ideal world they would use all the available resolution but mark it with a flag saying 4:3 or 16x9, etc so that upon playback it would be resized and the TV would then add the bars as needed, but that doesn't happen.

thewebchat
6th August 2009, 23:28
In an ideal world, they would use a dynamic resolution (maybe define a max pixels/frame) and not fixed resolution hacks like anamorphic video (eww) and letterboxes (wasteful).

Gokumon
7th August 2009, 01:16
In an ideal world, they would use a dynamic resolution (maybe define a max pixels/frame) and not fixed resolution hacks like anamorphic video (eww) and letterboxes (wasteful).

What's wrong with anamorphic video? You can use all available resolution the medium and then resize as needed to fit the display's resolution which will provide maximum quality across all TVs. Your dynamic resolution isn't going to give you any better quality and would just add more complexity than a simple flag would.

mrr19121970
8th August 2009, 11:09
I've written a little app for converting SRT to XML/PNGs for importing into BDSup2Sub. You can see some details here:

http://forum.slysoft.com/showthread.php?t=32826


http://clownbd.com/Clown_SRT2XMLSUB_1.jpg




.

hubblec4
8th August 2009, 23:47
mrr19121970 well done. very nice work.

Zelos
11th August 2009, 15:18
great tools !
nice work , thanks guys :goodpost:

hamletiii
12th August 2009, 19:27
I choose the same framerate as input and output, both 29.97, how come the output timecode is slightly different than the input?
One example:
Input:
start: 00:55:28.070 end: 00:55:32.100

Ouput:
start: 00:55:28.058 end: 00:55:32.095


Also is there a way to not convert the images? I just want to extract the subpictures generated from PunkGraphicStream to png+xml.

0xdeadbeef
12th August 2009, 20:41
I choose the same framerate as input and output, both 29.97, how come the output timecode is slightly different than the input?
One example:
Input:
start: 00:55:28.070 end: 00:55:32.100

Ouput:
start: 00:55:28.058 end: 00:55:32.095

As described in the online help etc., BDSUp2Sub always synchronizes to the target frame rate.

Also is there a way to not convert the images? I just want to extract the subpictures generated from PunkGraphicStream to png+xml.
Yes and no. If you select the same resolution and frame rate and choose "keep palette", a plain subpicture is not altered.
Then again, if there are palette animations etc., BDSup2Sub will remove them. Then again, stuff like this is not supported by the BDN XML format anyway.

hamletiii
12th August 2009, 21:41
As described in the online help etc., BDSUp2Sub always synchronizes to the target frame rate.


So what is the benefit to "always synchronizes to the target frame rate"?


Is there a way to keep the timecodes as is? I noticed that this feature didn't get introduced prior to ver2.0.

0xdeadbeef
12th August 2009, 22:11
So what is the benefit to "always synchronizes to the target frame rate"?
To improve compatibility of course.
Besides: what possible benefit could it have to start or end a subtitle in between frames? Most obviously nothing can be displayed between two frames anyway.

Is there a way to keep the timecodes as is? I noticed that this feature didn't get introduced prior to ver2.0.
No, as this would make absolutely no sense.

rica
17th August 2009, 21:21
Hi,
to perform a frame rate conversion e.g. for pal speedup, will it be enough just to select "FPS Target" as 25 ?

(sorry i've been away for some time)

0xdeadbeef
18th August 2009, 01:36
No, you also need to check the "Change frame rate" checkbox and select/confirm the source frame rate.

micha019
18th August 2009, 16:33
Hello,

does anyone know which standalone player already supports vobsubs in mkv?
I already know that the wd-media player support it.
But I'm looking for a standalone player with network support.
So I tested the new player: Asus O!Play HDP-R1 and Xtreamer.
Both doesn't play vobsubtitles.

GZZ
18th August 2009, 17:55
micha019 please post this under Hardware players and not in here.

rica
18th August 2009, 21:10
No, you also need to check the "Change frame rate" checkbox and select/confirm the source frame rate.

Thx, it means it works and no need anymore any manual adjustment like on SubtitleWorkshop?

0xdeadbeef
18th August 2009, 21:26
Thx, it means it works and no need anymore any manual adjustment like on SubtitleWorkshop?
I use it all the time with 24p material that I speed up to 25p with EAC3TO (which simply patches the fps info field in the video stream). Works great for me.

rica
19th August 2009, 01:27
Thanks, i'll give it a go.

sneaker_ger
19th August 2009, 17:46
In the AVS2BDNXML (http://forum.doom9.org/showthread.php?p=1316234#post1316234) thread we discovered a problem that seems to be an error in BDSup2Sub.

The problem is that when doing a BDN XML to BR Sup conversion the subtitles sometimes appear and/or disappear 1 frame too late.
In this sample (http://www.mediafire.com/?mdwkiigiu4n) you'll see that while the subtitle should appear on frame 24 (timecode "00:00:01:00" in bdn xml notation, first frame being frame #0) it appears on frame 25 in the resulting .sup file. When re-converting the file you'll get the correct timing (timecode "00:00:01:00") in the resulting xml though.

Zachs
25th August 2009, 07:22
I'd like to run some effect filters over my subs (PGS sup files), such as drop shadow, brightness / contrast adjust etc.
BDSup2Sub probably doesn't do this yet but I'd like to see it implemented.
Ideally, I'd like to use the plugin filters written for Paint.NET.

mrr19121970
25th August 2009, 08:55
why not export them to XML/PNG and then whizz over your PNG files applying any affects you want. when you're done convert back to PGS.



,

Zachs
25th August 2009, 09:35
Hmm that's a good idea. Didn't think of that.
Thanks!

minerva.thegift
28th August 2009, 00:03
I just wanted to drop by and say thank you so much for this project/utility! My general philosophy on DVD and now Blu Ray archiving is that if the original disc has it, I want to archive it - including all the subtitles in languages that I don't even know how to read :P I had started looking at some .sup to .srt (text) tools that use OCR but that doesn't really work for me with languages like Arabic and Thai which don't use the Roman alphabet. I have successfully archived two blu ray movies so far (with all their subtitles in tact) to .mkv files and I used BDSuptoSub for the subtitles (and mkvmerge GUI in the mkvtoolnix to mux them back in to the mkv file.) I think I might even work on writing a guide and I'll be sure to include a link to this thread.

Thanks so much!:thanks:

Note: I have written a guide detailing how to create a digital archive copy of a Blu Ray movie and I included a section on using BDSup2Sub. It can be found here (http://forum.videohelp.com/topic372380.html#BDSup).

hamletiii
28th August 2009, 21:09
How to preserve the color when converting from BDSup to DVD idx/sub?

Here (http://i219.photobucket.com/albums/cc183/linkai8424/PS3%20MEDIA/bdsupcolor.png) is the picture:

The original sub has two colors, if I choose output as idx/sub, the preview only gives one color for both lines?

0xdeadbeef
30th August 2009, 16:15
How to preserve the color when converting from BDSup to DVD idx/sub?
The integrated help file answer this all. Expecially the chapter
"Some technical background / Palette Modes".
In an nutshell: multicolored text is lost when converting from 255 to 3 opaque colors.

sneaker_ger
30th August 2009, 20:43
In the AVS2BDNXML (http://forum.doom9.org/showthread.php?p=1316234#post1316234) thread we discovered a problem that seems to be an error in BDSup2Sub.

The problem is that when doing a BDN XML to BR Sup conversion the subtitles sometimes appear and/or disappear 1 frame too late.
In this sample (http://www.mediafire.com/?mdwkiigiu4n) you'll see that while the subtitle should appear on frame 24 (timecode "00:00:01:00" in bdn xml notation, first frame being frame #0) it appears on frame 25 in the resulting .sup file. When re-converting the file you'll get the correct timing (timecode "00:00:01:00") in the resulting xml though.

This error turned out to be an error in the AviSynth SupTitle plugin and not in BDSup2Sub.

deank
2nd September 2009, 07:33
@0xdeadbeef: Can you take a look at these (http://multiforum.deanbg.com/viewtopic.php?f=11&t=310&start=5) posts? The user will be able to post here @ doom9 in few days.

Dean

0xdeadbeef
2nd September 2009, 16:26
I answered over there.
Anyway, as usual, I need the sample to give a more useful reply.

deank
3rd September 2009, 00:27
Thank you!


Daniel_Lechu:

Hi, hereŽs 4 samples of subtitles ripped from Garfield and garfield 2 DVD.
http://www.megaupload.com/?d=WZRI5T09

Can u help me to learn how to fix the IDX, im new in subtitles and the only i know is extract from DVD to IDX/SUB or rip to STR with SubRip.

Thanks in advance :)


Edit with lastest responses: my subtitles are separated, only 1 subtitle/file.

Dean, Next Monday iŽll try to post in doom9 ;)

avivahl
3rd September 2009, 00:39
@0xdeadbeef: I have another IFO/SUP (dvd) that doesn't work w/ the latest version (3.9.6). DVDSubEdit opens it and shows the subs. BDSup2Sub opens it and gives a "buffer offset error" when "seeking" to another frame. Will send it over PM.

0xdeadbeef
6th September 2009, 21:09
@deank:
I answered in your forum. In a nutshell: the IDX files in these samples are broken in several ways and I don't feel like adding workarounds for this.

@avivahl:
Ok, I analyzed that sample and I guess the problem is that in some of the frames, the odd lines are located first in the RLE buffer instead of 2nd as usual. Admittedly, BDSup2Sub currently can't cope with that inverted field order.
It should be easy to add a workaround though. Hope to fix this within the next few days. I'm just too tired to do it right now and dunno if I will have time tomorrow.

0xdeadbeef
6th September 2009, 23:52
Ok, I defeated my weaker self.

07.09.2009: 3.9.6 -> 3.9.7

Fixed: Vobsub+SUP/IFO: files with swapped odd/even field order in the RLE buffer were not handled correctly.

avivahl
7th September 2009, 01:02
Wow. I couldn't expect a better answer than that. :)

hubblec4
9th September 2009, 16:37
Ok, I defeated my weaker self.

07.09.2009: 3.9.6 -> 3.9.7

Fixed: Vobsub+SUP/IFO: files with swapped odd/even field order in the RLE buffer were not handled correctly.


thanks for your work again

Atak_Snajpera
9th September 2009, 19:57
Could you add support for none standard resolutions? (sup -> sub/IDX) For example 1920x800. It would be great if we could crop top margin.

0xdeadbeef
9th September 2009, 20:29
Could you add support for none standard resolutions? (sup -> sub/IDX) For example 1920x800. It would be great if we could crop top margin.

Most probably I don't get the request but how is that different from using the existing cropping feature?

Atak_Snajpera
9th September 2009, 20:38
Most probably I don't get the request but how is that different from using the existing cropping feature?
What is command to crop top margin then?