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 25th April 2017, 11:19   #1341  |  Link
hubblec4
Matroska find' ich toll
 
Join Date: Apr 2008
Posts: 1,370
When I use the cli (BDSup2Sub 5.1.2) to convert a DVD-sup to IDX/Sub and I use the "--language de" switch or any other language code, always "English en" is set in the idx for the language.
Is this a known bug?
hubblec4 is offline   Reply With Quote
Old 25th April 2017, 11:47   #1342  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,469
It works fine for me, and I use the same version.

My command is:
Code:
java -Xmx256m -jar D:\work\BD3D2MK3D\toolset\BDSup2Sub.jar test.sup -o test\test.xml --language de
There are some bugs in BDSup2Sub, especially with the XML+PNG format. For example, the frame rate is systematically 25 fps when converting from XML+PNG to another format (with the CLI or the GUI), unless you specify explicitly another frame rate. But as far as I know, the language code is correctly handled.

Note also that BDSup2Sub supports only the ISO 639-1 codes (2 lower case letters). It doesn't support more recent ISO codes (with 3 or 4 letters). But since you have used "de", that should work. Are you sure that the --language argument is after the input and output file names?
__________________
r0lZ
PgcEdit homepage (hosted by VideoHelp)
BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV
r0lZ is offline   Reply With Quote
Old 25th April 2017, 15:19   #1343  |  Link
hubblec4
Matroska find' ich toll
 
Join Date: Apr 2008
Posts: 1,370
Quote:
Originally Posted by r0lZ View Post
My command is:
Code:
java -Xmx256m -jar D:\work\BD3D2MK3D\toolset\BDSup2Sub.jar test.sup -o test\test.xml --language de
Are you sure that the --language argument is after the input and output file names?
In the usage-description there are "options" before the in-out files.
I try it with --language at last position and it does not work.
With the Windows version it works but not with the java-version.

Code:
"C:\java.exe" -jar "D:\BDSup2Sub.jar" "F:\Subpictures_23.ifo" -o "F:\Sub Pic23.sub" --language aa
here a sample

Last edited by hubblec4; 25th April 2017 at 15:49.
hubblec4 is offline   Reply With Quote
Old 25th April 2017, 15:36   #1344  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,469
Oh, yes, with your sample, I can reproduce the bug. The difference is that in my previous tests, I've used a BD SUP file. You convert a DVD SUP file (+IFO).

I did not know that problem, but anyway, we have to live with it. Luckily, if you convert to XML+PNG, it is easy to edit the XML file to change the language code. I don't think there is another solution.

And take care with BDSup2Sub++.exe. It has a lot of bugs, even if it doesn't have this one! And it is abandoned too.
__________________
r0lZ
PgcEdit homepage (hosted by VideoHelp)
BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV
r0lZ is offline   Reply With Quote
Old 25th April 2017, 18:36   #1345  |  Link
hubblec4
Matroska find' ich toll
 
Join Date: Apr 2008
Posts: 1,370
Quote:
Originally Posted by r0lZ View Post
Oh, yes, with your sample, I can reproduce the bug. The difference is that in my previous tests, I've used a BD SUP file. You convert a DVD SUP file (+IFO).
Yes DVD-sup!

Quote:
Originally Posted by r0lZ View Post
I did not know that problem, but anyway, we have to live with it. Luckily, if you convert to XML+PNG, it is easy to edit the XML file to change the language code. I don't think there is another solution.
In my old DVD2mkv-editor I have created a workaround for this bug, but for german langauge only. Now I see every language fails and I will extend my work-around. It is a very simple procedure which change the "id: entry"(and "alt: entry") in the idx-file.

I hope this is enough to solve this issue.


Quote:
Originally Posted by r0lZ View Post
And take care with BDSup2Sub++.exe. It has a lot of bugs, even if it doesn't have this one! And it is abandoned too.
Is there a list of this known bugs?
Like in your PGC2mkv-plugin I would have the choice between this two versions.
hubblec4 is offline   Reply With Quote
Old 25th April 2017, 19:33   #1346  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,469
I don't think there is a complete list, but I know that in many cases, when it converts a BD SUP to XML+PNG, it creates several images for the same subtitle, and some are totally black. It cannot reload the XML it has produced itself! (I think that that bug occurs when there are fades in the subtitle stream. Something very rare, if not impossible, for the DVD SUP, so don't worry too much.)

It has also the bugs of the java version, including the problem of the wrong time codes when it loads an XML/PNG stream. It forces 25 fps anyway.
__________________
r0lZ
PgcEdit homepage (hosted by VideoHelp)
BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV
r0lZ is offline   Reply With Quote
Old 25th April 2017, 19:50   #1347  |  Link
hubblec4
Matroska find' ich toll
 
Join Date: Apr 2008
Posts: 1,370
Why convert you to XML/PNG? This step I have never used.

I have no problems with converting dircet to idx/sub.

Last edited by hubblec4; 25th April 2017 at 19:59.
hubblec4 is offline   Reply With Quote
Old 25th April 2017, 22:47   #1348  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,469
For most users, the main advantage of XML/PNG is that it is easy to edit, for example to darken too bright subtitles. Personally, I need that format for BD3D2MK3D, to convert the subtitles to 3D (SBS or T&B). It's also a format needed to import the subtitles in some authoring programs.
__________________
r0lZ
PgcEdit homepage (hosted by VideoHelp)
BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV
r0lZ is offline   Reply With Quote
Old 28th April 2017, 20:54   #1349  |  Link
Bandits
Registered User
 
Join Date: Feb 2015
Posts: 43
Quote:
Originally Posted by hubblec4 View Post
Is there a list of this known bugs?
I know I have had issues with 5.1.2 with detecting all subtitle events (Avatar). I have reverted back to 4.0.0 and it seems to be the best for my needs.

If I could understand the subtitle events a little better inside the extracted stream I would write my own editor. I tried to follow the information in this thread and SUPread but it seems to be incomplete. I can get the event information but extracting the png does not make sense to me.

Last edited by Bandits; 29th April 2017 at 01:52.
Bandits is offline   Reply With Quote
Old 16th July 2017, 00:13   #1350  |  Link
Scorpius666
Registered User
 
Join Date: Jul 2017
Posts: 7
Thanks to this wonderful thread I have found that versions of BDSup2Sup higher than 5.0.0 will lose 15% of the subtitles (totally unusable), but versions 5.0.0 and lower will only lose 1% if any.

Since it still loses a couple of subtitles, I have decided to implement one of the two things missing in BDSub2Sup that makes it lose subtitles.

Basically BDSup2Sub didn't implement two things:
  • Complex compositions. This is when two or more subtitles are shown at the same time. A warning is shown that multiple ODS are defined and only one subtitle will be recognized.
  • Cropping. BluRay subtitles support showing a piece of the image each time, so a line like "Ok! Let's do it" can be shown like "Ok!" first and then "Ok! Let's do it".

The second item is not that terrible. You will only lose the "animation" of the subtitle being shown few words at a time.

But the first item is a big problem. This usually happens when a subtitle is being shown and then another one has to appear, for example a foreign sign have appeared in the screen and the person hasn't finished talking. Since compositions are very common they must be implemented.

So that's what I did here: https://github.com/naikel/BDSup2Sub/tree/enhanced

Also I tried to give a better explanation how PGS works here: http://blog.thescorpius.com/index.ph...btitle-format/
Scorpius666 is offline   Reply With Quote
Old 16th July 2017, 00:48   #1351  |  Link
Bandits
Registered User
 
Join Date: Feb 2015
Posts: 43
Thanks for working on this. Do you have any examples besides Avatar I can test your version on? I use BDSup2Sub heavily when dealing with forced subtitles and would like to know I can trust your version to be as good as 4.0.0. I got burned using 5.1.2 and had to re-rip many movies.

Thanks also for providing some more information to make my head hurt trying to understand the segments in the stream.
__________________
Blu-Ray Ripper 0.112c/0.21a
Bandits is offline   Reply With Quote
Old 16th July 2017, 03:39   #1352  |  Link
Scorpius666
Registered User
 
Join Date: Jul 2017
Posts: 7
Do you want a SUP file that will give you problems in 4.0.0 and work with this version?

Any anime BluRay will cause that since it has to compose several subtitles at the same time trying to translate everything that is on screen.

But anyway here's a 20 kB SUP file with a simple composition: two subtitles, one is shown first, then both, then only the second. This is from a real BluRay. Load this with my version first and double click the little screen or use Edit -> Edit Frame and take a look at the three frames so you can see how they are supposed to look in the movie.

Then load it in 4.0.0 and do the same.

If the attachment is not approved download it from here: https://www.dropbox.com/s/meensn9ow4...ample.sup?dl=0
Attached Files
File Type: zip Sample.zip (6.4 KB, 70 views)

Last edited by Scorpius666; 16th July 2017 at 03:44.
Scorpius666 is offline   Reply With Quote
Old 16th July 2017, 08:45   #1353  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,469
Thanks Scorpius666, and welcome to the D9 forums! I'm glad to see that BDSup2Sub is not dead.

Can you also have a look at a bug? When BDSup2Sub converts a DVD or BD subtitle stream to XML/PNG format, it writes 25 fps anyway in the XML file, regardless of the frame rate of the original stream, and when an XML is read, the frame rate is ignored, and BDSup2Sub assumes always 25 fps (unless you force manually another input frame rate with the dialog that is shown when the XML file is opened). In other words, by default, BDSup2Sub assumes that an XML/PNG file is always at 25fps. It's obviously a bug, as by default, it should never change the frame rate when loading or converting a stream. (I don't remember if loading other formats has the same problem, but that should be verified too.)

There are probably other small bugs, but I don't remember right now.

Thanks in advance!
__________________
r0lZ
PgcEdit homepage (hosted by VideoHelp)
BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV

Last edited by r0lZ; 16th July 2017 at 12:05.
r0lZ is offline   Reply With Quote
Old 16th July 2017, 10:36   #1354  |  Link
LeXXuz
21 years and counting...
 
LeXXuz's Avatar
 
Join Date: Oct 2002
Location: Germany
Posts: 716
Quote:
Originally Posted by Scorpius666 View Post
Thanks to this wonderful thread I have found that versions of BDSup2Sup higher than 5.0.0 will lose 15% of the subtitles (totally unusable), but versions 5.0.0 and lower will only lose 1% if any.
Thank you very much for your efforts.

I have used 5.1.2 for quite a long time and always had the feeling something is off. Now I know I have a lot of faulty backups. Should have read through this thread earlier...

Anyhow I will test your version with quite a few files I know for sure version 5.x and 4.x handled wrong. Thx again.
LeXXuz is offline   Reply With Quote
Old 16th July 2017, 17:19   #1355  |  Link
Scorpius666
Registered User
 
Join Date: Jul 2017
Posts: 7
Quote:
Originally Posted by r0lZ View Post
Thanks Scorpius666, and welcome to the D9 forums! I'm glad to see that BDSup2Sub is not dead.

Can you also have a look at a bug? When BDSup2Sub converts a DVD or BD subtitle stream to XML/PNG format, it writes 25 fps anyway in the XML file, regardless of the frame rate of the original stream, and when an XML is read, the frame rate is ignored, and BDSup2Sub assumes always 25 fps (unless you force manually another input frame rate with the dialog that is shown when the XML file is opened). In other words, by default, BDSup2Sub assumes that an XML/PNG file is always at 25fps. It's obviously a bug, as by default, it should never change the frame rate when loading or converting a stream. (I don't remember if loading other formats has the same problem, but that should be verified too.)

There are probably other small bugs, but I don't remember right now.

Thanks in advance!
That is not a bug. Sadly, there is no frame rate information in a SUP file, and the user always have to introduce that information manually before exporting.
Scorpius666 is offline   Reply With Quote
Old 16th July 2017, 17:44   #1356  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Are subtitle timings on DVD or Blu-ray always bound to frame timings? Then - since DVD and Blu-ray only allow certain constant frame rates - we could deduct fps by looking if the subtitle timings would fit into a matching pattern.
sneaker_ger is offline   Reply With Quote
Old 16th July 2017, 18:15   #1357  |  Link
Scorpius666
Registered User
 
Join Date: Jul 2017
Posts: 7
Quote:
Originally Posted by sneaker_ger View Post
Are subtitle timings on DVD or Blu-ray always bound to frame timings? Then - since DVD and Blu-ray only allow certain constant frame rates - we could deduct fps by looking if the subtitle timings would fit into a matching pattern.
There are two ways to time a subtitle:

1.- Absolute time: Like the SUP files have, or text SRT files have. That is from 00:00:51.128 to 00:00:55.762. That's absolute. You don't need a frame rate for that since you know exactly when to show the subtitle.

2.- Relative time: A frame rate + frame number. For example from frame #2510 to frame #2650. If your frame rate is wrong, then your subtitle will show at the wrong time.

Since SUP files have absolute time, they don't need a frame rate, and this value is simply not included since it's not necessary. Also, normal text SRT files don't include this value either: it's not needed. Now the weird thing here is that those XML files also have absolute time, and they have a frame rate value I don't know why. I would assume the players would ignore the frame rate value in the XML file. I haven't tested that (I don't use that format).

Now since SUP files from BDs and DVDs don't have a frame rate value, BDSup2Sub takes the default value you have for frame rate. If you haven't changed it, it's 25. But you can change it and press the "Store" button to set a new default. But BDSup2Sub can't possibly know the frame rate of the movie since that information is not inside the SUP file.
Scorpius666 is offline   Reply With Quote
Old 16th July 2017, 18:20   #1358  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,469
I've just tried again, and there is obviously a problem, but it's not exactly what I have described above. Currently, if I load a BD Sup in BDSup2Sub v5.1.2, it shows (correctly) 23.976fps in the first dialog as the FPS Source. The "Change frame rate" option is NOT ticked, and the user can therefore assume that it will use 23.976 when exporting the stream to another format, but it's NOT the case! It will use 25fps. In fact, it uses the Target FPS specified in that dialog anyway, even if the Change Frame Rate option is not ticked. So, to keep the original (good) fps, you MUST change the FPS Target option. The "Change Frame Rate" option is only used to force a different FPS Source, not to maintain the original frame rate during the conversion. If it's not a bug, it's totally misleading.

I suggest therefore to set by default the FPS Target to the same value as the FPS Source. If the user wants to change the frame rate, he should do it, but it's not the role of the program to assume that he want to convert to 25fps. (And why 25fps BTW?) Imo, it's really something to fix.

If the source frame rate cannot be determined, then I suggest to print a red warning in this first dialog to ask the user to change the FPS Source and target as necessary. And the text of the "Change frame rate" option should be replaced with "Change FPS Source", to be more clear.
__________________
r0lZ
PgcEdit homepage (hosted by VideoHelp)
BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV

Last edited by r0lZ; 16th July 2017 at 18:26.
r0lZ is offline   Reply With Quote
Old 16th July 2017, 18:32   #1359  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by Scorpius666 View Post
There are two ways to time a subtitle:

1.- Absolute time: Like the SUP files have, or text SRT files have. That is from 00:00:51.128 to 00:00:55.762. That's absolute. You don't need a frame rate for that since you know exactly when to show the subtitle.

2.- Relative time: A frame rate + frame number. For example from frame #2510 to frame #2650. If your frame rate is wrong, then your subtitle will show at the wrong time.

Since SUP files have absolute time, they don't need a frame rate, and this value is simply not included since it's not necessary. Also, normal text SRT files don't include this value either: it's not needed. Now the weird thing here is that those XML files also have absolute time, and they have a frame rate value I don't know why. I would assume the players would ignore the frame rate value in the XML file. I haven't tested that (I don't use that format).

Now since SUP files from BDs and DVDs don't have a frame rate value, BDSup2Sub takes the default value you have for frame rate. If you haven't changed it, it's 25. But you can change it and press the "Store" button to set a new default. But BDSup2Sub can't possibly know the frame rate of the movie since that information is not inside the SUP file.
What I meant by "bound to frame timings" is: will subtitles only start/end if a video frame starts? That could be true even with absolute subtitle times (in e.g. seconds). If you have an absolute time of 00:00:00.040 you know it must be from 25 fps video:
1000ms/25 = 40ms
1000ms/23.976 = 42ms
1000ms/29.97 = 33ms
(may have to gather statistics over whole file to safely differ between 24 and 23.976 or 25 and 50 but you get the idea)

About why XML has both: I'm too lazy to look now but could it be because of "drop" and "non-drop" timings?
https://documentation.apple.com/en/f...6%26tasks=true

Last edited by sneaker_ger; 16th July 2017 at 18:35.
sneaker_ger is offline   Reply With Quote
Old 16th July 2017, 18:42   #1360  |  Link
Scorpius666
Registered User
 
Join Date: Jul 2017
Posts: 7
Quote:
Originally Posted by r0lZ View Post
I've just tried again, and there is obviously a problem, but it's not exactly what I have described above. Currently, if I load a BD Sup in BDSup2Sub v5.1.2, it shows (correctly) 23.976fps in the first dialog as the FPS Source. The "Change frame rate" option is NOT ticked, and the user can therefore assume that it will use 23.976 when exporting the stream to another format, but it's NOT the case! It will use 25fps. In fact, it uses the Target FPS specified in that dialog anyway, even if the Change Frame Rate option is not ticked. So, to keep the original (good) fps, you MUST change the FPS Target option. The "Change Frame Rate" option is only used to force a different FPS Source, not to maintain the original frame rate during the conversion. If it's not a bug, it's totally misleading.

I suggest therefore to set by default the FPS Target to the same value as the FPS Source. If the user wants to change the frame rate, he should do it, but it's not the role of the program to assume that he want to convert to 25fps. (And why 25fps BTW?) Imo, it's really something to fix.

If the source frame rate cannot be determined, then I suggest to print a red warning in this first dialog to ask the user to change the FPS Source and target as necessary. And the text of the "Change frame rate" option should be replaced with "Change FPS Source", to be more clear.
It is exactly that.

If you select the "Change Frame" option then you will need to enter a source frame rate and the program will translate the times for you. If you don't, the Target FPS is still used only for the formats that will use it.

But if you export to IDX/SUB for example that is totally ignored since it is not needed.

The question remains: Why is there a frame rate setting in the first place for formats that have absolute time? I'm pretty sure if you delete the frame rate line from the XML file it will always work. I would test it, but that format is so messy creating thousands of files that I really want to stay away from it.

Also, the ONLY format that BDSup2Sub that needs a frame rate is XML/PNG. What I would do is test an XML file without the frame rate option, and if it works, then delete the output of that line in BDSup2Sub. I'm sure it will work!!

Quote:
Originally Posted by sneaker_ger View Post
What I meant by "bound to frame timings" is: will subtitles only start/end if a video frame starts? That could be true even with absolute subtitle times (in e.g. seconds). If you have an absolute time of 00:00:00.040 you know it must be from 25 fps video:
1000ms/25 = 40ms
1000ms/23.976 = 42ms
1000ms/29.97 = 33ms
(may have to gather statistics over whole file to safely differ between 24 and 23.976 or 25 and 50 but you get the idea)

About why XML has both: I'm too lazy to look now but could it be because of "drop" and "non-drop" timings?
https://documentation.apple.com/en/f...6%26tasks=true
It depends on the format. SUP files are not bound by frames, they will show when the time is right. I don't remember which formats use the frame number instead of an absolute time right now but they are long gone. Popular bitmap formats like PGS (SUP), VobSub(IDX/SUB) and text formats like SRT, SSA, ASS, etc they all use absolute time values. None of them use a frame rate value in their files at all.

EDIT: Reading the wiki at https://github.com/mjuhasz/BDSup2Sub...ported-Formats seems like not only the frame rate value is needed, but the values are not absolute values but things that are really weird, like the time codes are related an integer frame rate (24 instead of 23.976). I would really stay away from this format.

Last edited by Scorpius666; 16th July 2017 at 19:13.
Scorpius666 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 05:47.


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