Log in

View Full Version : bdsup2sub++ - convert and tweak bitmap subtitles.


Pages : 1 2 3 [4] 5 6

paradoxical
16th April 2013, 17:21
Anyone noticed any showstopping bugs that would prevent me from tagging 1.0.2 and releasing it?

Also, is there anyone interested in 64-bit Windows builds? I've only not done so just because I was too lazy to compile another set of Qt libs.

sl1pkn07
16th April 2013, 21:09
http://wstaw.org/m/2013/04/16/plasma-desktopEv4322.png

edit: stop build: http://sl1pkn07.no-ip.com/paste/view/cc2615c1

paradoxical
16th April 2013, 21:24
What am I supposed to be seeing?

As I told you before, the code does not apply filtering unless you have specified a different target resolution than the source resolution.


// export 4 color palette
if (width == trgWidth && height == trgHeight)
{
// don't scale at all
if ((inMode == InputMode::VOBSUB || inMode == InputMode::SUPIFO) && paletteMode == PaletteMode::KEEP_EXISTING)
{
targetBitmap = substream->bitmap(); // no conversion
}
else
{
targetBitmap = substream->bitmap().convertLm(substream->palette(), alphaThreshold, luminanceThreshold); // reduce palette
}
}



if (width == trgWidth && height == trgHeight)
{
targetBitmap = substream->bitmap(); // no scaling, no conversion
}

sl1pkn07
16th April 2013, 21:34
no apply bilinear filter by default?

paradoxical
16th April 2013, 21:41
Did you read my previous post? I even posted the exact code where it checks to see if any scaling is done. I can keep repeating myself if you want.

sl1pkn07
16th April 2013, 22:06
no, no need (i'm not coder, only know bash, but bad). but then is possible in the GUI set "none" instead bicubic (first option)? (like http://wstaw.org/m/2013/04/16/choped.png) or describe method to back to unfiltered if select one of filters (without close and reopen sub)

greetings

paradoxical
16th April 2013, 22:19
There is no point of a "none" option. Filtering only gets applied if you select to convert resolution of the subtitles. What you're asking for would only complicate the GUI with a bunch of added logic in order to add an option that will do nothing.

paradoxical
16th April 2013, 22:44
To put this another way. Adding the "none" option means, that when you do select "convert resolution" the GUI has to either:

1) Choose a filter option automatically

or

2) Has to check on export that you have selected a filter.

If you then uncheck the "convert resolution" option it then has to then know to clear your filter selection. Which means that if you then choose "convert resolution" again if option 1) had been chosen as the previous behavior the GUI then has to remember what your old selection was in order to restore it.

Now that doesn't seem like a lot, but why add any of that extra logic when the current code does not apply the scaling filter unless the "convert resolution" option is checked and you picked a target resolution different from the source resolution?

Is adding this option going to actual fix some longstanding, unresolved issue? If so, please enlighten me because I don't see it.

Also, you seem to be confused by what happens when you change that option based on what you said here:

or describe method to back to unfiltered if select one of filters (without close and reopen sub)

You don't need to close and reopen the subtitle file. To get back to "unfiltered" only requires you to go to the conversion options and uncheck "convert resolution". Assuming you had also chosen a target resolution different than the source resolution. Because even if that option is checked but you hadn't changed the resolution it isn't scaling anyway as that would be pointless.

Also, every time you change between the different options it always scales from the source image. It does not then apply the same scaling filter to the previously scaled image if that's what you were thinking it does.

paradoxical
16th April 2013, 23:09
On another note, having compiled a test 64-bit version of the binary it has uncovered a bug in the palette logic for BD SUP files. Apparently the code that controls updating the palette was reading the wrong object for a boolean value for if the palette had been updated. It just so happens that when it that code path was reached the value from the constructed object just happened to be a value (the debugger showed that it was "40" which made no sense for a C++ boolean value as it should have read "true" or "false") that caused it to go through the path successfully. When compiled with the 64-bit version of MinGW this value was set to the correct default value of "false" and as such the palette did not get updated when it should have which caused issues with subtitles that had fades. Apparently this code path was only working through luck. Guess it was worth making a test 64-bit build after all.

If no one tells me they've seen any showstopping issues by tomorrow morning, I'll just tag 1.0.2 and add new builds for OS X and Windows that also incorporate the fix for that.

r0lZ
17th April 2013, 09:11
I haven't much time to test it right now, but I have roughly tested the move Y options (from CLI and GUI), and they seems to work well.

Just a cosmetic thing: when moving all subs of a file with many subtitles with the GUI, a little windows appears during the operation, but nothing is visible in that window. I presume that it's a progress window, or perhaps it should show the subtitle number that is currently processed. Not a big deal. IMO, you can release v1.0.2.

If you can get the x64 version working, I agree that it could be useful, although imo it is not really necessary.

paradoxical
17th April 2013, 17:13
Hmm, the move dialog issue seems to only appear in the latest builds using Qt 5, but I'm not sure why it only happens for that one progress dialog and not the others. That may be a reason to just stick with Qt 4.8.4 for a while still. And yeah, the x64 version really isn't necessary because the RAM usage is so low. Also, I benchmarked between it and the 32-bit version and it was really no faster.

r0lZ
17th April 2013, 17:42
The blank dialog is not really an issue. It's just a cosmetic glitch. Anyway, do what you think is the best.
There is no real need for the x64 version. Thanks for having tried.

paradoxical
17th April 2013, 17:43
Ok new builds. The Windows build going back to Qt 4.8.4 which doesn't have that weird progress dialog issue when moving.

Windows (https://www.dropbox.com/s/jiw6r9qphcugs1r/bdsup2sub%2B%2B1.0.2_Win32.7z) and OS X (https://www.dropbox.com/s/f8p9fgsxv9p6hej/bdsup2sub%2B%2B1.0.2_OSX.zip). First post has also been updated.

The blank dialog is not really an issue. It's just a cosmetic glitch. Anyway, do what you think is the best.
There is no real need for the x64 version. Thanks for having tried.

True, but I wasn't really seeing anything dramatically better going to Qt 5 anyway either speed or otherwise so I'll just stick with what doesn't cause random glitches. I will probably post a Windows x64 version later once I make sure there are no more subtle bugs hiding around that it might expose.

Selur
18th April 2013, 19:31
btw. some infos from one of the problem users:
301.42-desktop-win7-winvista-64bit-international-whql.exe -->OK

306.23-desktop-win8-win7-winvista-64bit-international-whql.exe -->crash
306.97-desktop-win8-win7-winvista-64bit-international-whql.exe -->crash
310.70-desktop-win8-win7-winvista-64bit-international-whql.exe -->crash
310.90-desktop-win8-win7-winvista-64bit-international-whql.exe -->crash
314.07-desktop-win8-win7-winvista-64bit-international-whql.exe -->crash
314.22-desktop-win8-win7-winvista-64bit-international-whql.exe -->crash

he's using an Intel Core i7-2600K CPU

paradoxical
18th April 2013, 20:00
There's nothing I can do. I don't control what NVIDIA's drivers do. They are the culprits here. I wish there was a better answer. I simply compile Qt as is and link it in.

Also, as I said before I run 314.07 on one of my dev systems and it runs the binary with no crashes.

Selur
18th April 2013, 20:03
Just, thought I post the info so it doesn't get lost :)

paradoxical
18th April 2013, 20:04
Just, thought I post the info so it doesn't get lost :)

I definitely appreciate it as I wasn't trying to be dismissive of your post. I just wish I had a better answer. :(

paradoxical
18th April 2013, 20:13
Seems even an ImgBurn user (http://forum.imgburn.com/index.php?showtopic=20585) has been hit by this issue before as well.

AGKnotUser
1st May 2013, 21:28
Just tried 1.0.2 with Avatar exporting only forced subtitles. All subtitles appear in the extreme upper left corner of the screen. Tried with MPC-HC and XMBC. What other information do you need?

paradoxical
1st May 2013, 22:09
Give me your input file and the output so I can check them. Also, outline any settings you set, etc. when processing.

AGKnotUser
1st May 2013, 22:53
Give me your input file and the output so I can check them. Also, outline any settings you set, etc. when processing.

They are way over the upload limit, even zipped or rared. The only settings I used was to use SUP(BD) Output Format And Export only forced. How can I give you a sample?

AGKnotUser
1st May 2013, 23:19
I am able to give you a sample of the exported file. Just for information I tried the old BDSup2Sub.jar version 5.0.0. It was the last version to work with this Blu-ray. 5.1.1 and 5.2 Snapshot didn't work either. Unfortunatedly i don't have 1.0.1 anymore to test with.

paradoxical
2nd May 2013, 15:05
Upload the files to something like sendspace. Just giving me the output file doesn't really help. I need to debug what happens when it processes the source.

AGKnotUser
2nd May 2013, 19:47
Upload the files to something like sendspace. Just giving me the output file doesn't really help. I need to debug what happens when it processes the source.

OK, Here is the URL for Avatar Subtitles.zip both input and output files: http://www.sendspace.com/file/rt6ke7

paradoxical
2nd May 2013, 20:34
Thanks.

rack04
7th May 2013, 02:26
I have a subtitle file from Silver Linings Playbook Blu-ray that I'm having some issues with. BDSup2Sub v4.0.0 reports 2079 captions and BDSup2Sub++ v1.0.2 reports 2080 captions and I don't know which one is right. Below is a download link for the subtitle that I extracted using eac3to.

http://www.sendspace.com/file/zt73m7

paradoxical
7th May 2013, 14:45
Thanks for the file, checking it now.

paradoxical
7th May 2013, 14:59
So I see what is going on. Apparently BDSup2Sub is combining 2 PCS together starting from subtitle 1568 because the composition number didn't change, whereas bdsup2sub++ is keeping each PCS separate. That's the cause of the 1 subpicture discrepancy. It's a harmless difference.

AGKnotUser
8th May 2013, 17:51
OK, Here is the URL for Avatar Subtitles.zip both input and output files: http://www.sendspace.com/file/rt6ke7

Just wondering if you found the files to be helpful.

paradoxical
8th May 2013, 17:54
Just wondering if you found the files to be helpful.

Yes, they are. I've looked at them a bit but haven't had enough free time lately to dig too deep. Have another project I'm trying to finish up. Will do so soon, though, I promise. :)

AGKnotUser
8th May 2013, 18:25
Yes, they are. I've looked at them a bit but haven't had enough free time lately to dig too deep. Have another project I'm trying to finish up. Will do so soon, though, I promise. :)

No problem, thanks for all your efforts.

Selur
19th May 2013, 13:18
btw. anyone compiling BDSup2Sub++ (ideally static) for Ubuntu? (Qt4.8 is needed for qtxcore and gcc 4.7+ is needed for BDSup2Sub++ itself)

sl1pkn07
19th May 2013, 13:28
need libqxt (I ignore the name of this library in ubuntu)

Selur
19th May 2013, 13:42
libqxt -> "sudo apt-get install libqxt-dev", sadly not available for Ubuntu 10.04 (probably since 10.04 uses Qt4.6), but on 12.04 (which uses 4.8) :D
»-std=c++11« requires gcc 4.7+, iirc Ubuntu 13.04 is the first Ubuntu version using gcc 4.7+, sadly it also uses Qt5 as default which breaks some of my projects due to some bugs that might get fixed by 5.0.3.

sl1pkn07
19th May 2013, 14:13
for expample in archlinux is possible use 3 versions of Qt: Qt3, Qt4 and Qt5. the version of Qt to use is selected by the app qtchooser (from Qt project). the version of gcc is 4.8, but can install other version through AUR (user repository, no binary, need build)

https://launchpad.net/ubuntu/+source/libqxt

update your ubuntu or change distro XD

paradoxical
20th May 2013, 19:24
Selur, here (https://launchpad.net/~george-edison55/+archive/gcc4.7-precise) is a ppa for GCC 4.7 on Ubuntu 12.04. It gives you a starting point at least. Also, I have a Kubuntu 12.10 in a VM that I use to compile and test the program. There isn't a need for 13.04 to compile this.

Selur
20th May 2013, 19:25
thanks :)

paradoxical
20th May 2013, 19:30
thanks :)

You're welcome. Like I said, though, 12.10 has everything you need. You get GCC 4.7.2 and you can grab the Qt and libqxt from the repos. No need to compile anything but the program itself.

eTiMaGo
29th May 2013, 03:45
Heya,

I posted an issue on the github page but maybe someone has an answer here... I'm trying to process multi-language idx/subs into xml/png using the CLI, but it outputs only the first language. So, is there a command to either output ALL language streams to different individual outputs, or to select a different language ID from the source file?

paradoxical
29th May 2013, 16:24
There is no support for outputting all languages at once. It also doesn't look like the CLI supports choosing which language to export even though the GUI does which is easy to rectify.

eTiMaGo
30th May 2013, 02:43
OK cool, then I'll use individual idx/subs for now.

Music Fan
30th May 2013, 09:00
Hi paradoxical,
are you still working on DVB-SUB support ?

r0lZ
30th May 2013, 14:09
I've tried to convert this SUP file (http://download.videohelp.com/r0lZ/tmp/7%20Subtitle%20%28PGS%29%2C%20French.7z) to XML/PNG from the command line, and I've discovered several bugs.

First bug:
Many subtitles are made of 2 PNG images. The first one is the correct subtitle, converted to PNG without problem, but the second image is totally black (without transparency). I wonder from where they are coming from. (I'm not sure it's really a bug, but it's strange, and it's the first time I see that black pictures.)

Second bug:
Many subtitles are made of 2 exactly identical PNG images, apparently correctly converted. IMO, when the images are identical, they should not be saved twice. But that's not the problem. In the XML file, the same subtitle is supposed to use more than 2 PNG images (usually 5). But only 2 images exist in the directory, and therefore the XML file references non-existing PNG images. Of course, that causes many problems.

Third bug:
Since I have discovered that the bugs 1 and 2 do not happen if I convert all subtitles to IDX/SUB and then the IDX/SUB to XML/PNG, I have converted successfully the subtitles that way. But the original subtitle stream has 3 forced captions, so I have decided to convert them also, with the same method. The first conversion (from SUP to IDX/SUB) works fine, and I have the 3 forced captions in the SUB file. But when I try to convert that SUB file to XML/PNG, BDSup2Sub++ crashes immediately. The crash happens ONLY when using the command line. The same conversion works fine from the GUI.

Note that the subtitle stream comes from the Ice Age 3 3D BD given when you buy a Panasonic TV. That BD is well known to have some bugs in the MVC video stream, and maybe it has also somewhat bad subtitle streams. Anyway, these 3 bugs are strange, and I suppose you will be interested in examining the SUP file.

BTW, any chance to have the option to convert the SUP to 3D SUB soon? Currently, due to the 3 bugs above, I can't convert them reliably. Thanks in advance.

paradoxical
30th May 2013, 18:22
OK cool, then I'll use individual idx/subs for now.

Yeah, it will be fixed in the next version.

Hi paradoxical,
are you still working on DVB-SUB support ?

Yeah, it's still something that will be added.

I've tried to convert this SUP file (http://download.videohelp.com/r0lZ/tmp/7%20Subtitle%20%28PGS%29%2C%20French.7z) to XML/PNG from the command line, and I've discovered several bugs.

First bug:
Many subtitles are made of 2 PNG images. The first one is the correct subtitle, converted to PNG without problem, but the second image is totally black (without transparency). I wonder from where they are coming from. (I'm not sure it's really a bug, but it's strange, and it's the first time I see that black pictures.)

Second bug:
Many subtitles are made of 2 exactly identical PNG images, apparently correctly converted. IMO, when the images are identical, they should not be saved twice. But that's not the problem. In the XML file, the same subtitle is supposed to use more than 2 PNG images (usually 5). But only 2 images exist in the directory, and therefore the XML file references non-existing PNG images. Of course, that causes many problems.

Third bug:
Since I have discovered that the bugs 1 and 2 do not happen if I convert all subtitles to IDX/SUB and then the IDX/SUB to XML/PNG, I have converted successfully the subtitles that way. But the original subtitle stream has 3 forced captions, so I have decided to convert them also, with the same method. The first conversion (from SUP to IDX/SUB) works fine, and I have the 3 forced captions in the SUB file. But when I try to convert that SUB file to XML/PNG, BDSup2Sub++ crashes immediately. The crash happens ONLY when using the command line. The same conversion works fine from the GUI.

Note that the subtitle stream comes from the Ice Age 3 3D BD given when you buy a Panasonic TV. That BD is well known to have some bugs in the MVC video stream, and maybe it has also somewhat bad subtitle streams. Anyway, these 3 bugs are strange, and I suppose you will be interested in examining the SUP file.

That's very weird with the blank PNG. I've downloaded the file and will look into it.

BTW, any chance to have the option to convert the SUP to 3D SUB soon? Currently, due to the 3 bugs above, I can't convert them reliably. Thanks in advance.

It will probably come in the version after next. When that will be I can't say. I'm still busy working on a side project I committed to for another person that is taking longer than expected and haven't had tons of time to start work on the next version yet. I'm definitely working on things, it's just coming along slow. Hopefully by mid June I can get back into committing more time to working on it.

Music Fan
31st May 2013, 09:16
Yeah, it's still something that will be added.
Great ;)

mini-moose
15th June 2013, 13:00
got a small sup file of only 5 lines. bdsup2sub++1.0.2_Win32.exe creates a vobsub file with those split into 48 lines, most with a 0,171 duration. It's the same 5 lines but they repeat themselves several times.

Warning for every line:

WARNING: duration of frame 1 is shorter than 520ms

tried also with java versions (older and newer) and they seem to keep them at 5 lines.

http://www.sendspace.com/file/vtd3ae

paradoxical
16th June 2013, 17:26
Ok, looking into it.

Chetwood
21st August 2013, 08:40
This sub (http://www.sendspace.com/file/57x0b1) (password is your nick) is ripped straight from DVD with VSrip and locks up BDSUP2SUB++ (and even BDSUP2SUB 5.11) when switching to the second language and browsing items. Can you take a look? Thx.

mini-moose
8th September 2013, 11:37
"ERROR: Palette ID out of bounds."

Sup here:

http://www.sendspace.com/file/fi3pu3

only creates .sub file, works fine with java versions

Music Fan
23rd November 2013, 11:35
I see that paradoxical is not member of this forum anymore, so I guess this project has been stopped.
Does anybody know a tool able to convert DVB-SUB to sup ?