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 > (HD) DVD, Blu-ray & (S)VCD > IFO/VOB Editors

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th May 2009, 15:41   #61  |  Link
goonix
Registered User
 
Join Date: Feb 2005
Posts: 272
Wow, although I use PgcEdit since the beginning, there are still undiscovered jewels inside this great tool.
You have thought at almost everything...

Thanks, r0lZ!
goonix is offline   Reply With Quote
Old 28th May 2009, 19:47   #62  |  Link
turbojet
Registered User
 
Join Date: May 2008
Posts: 1,840
Is there any chance the sub color palette can import from vobsub idx files?

It would take out the guessing game when it comes to colors when doing BD to DVD subs.
turbojet is offline   Reply With Quote
Old 28th May 2009, 22:46   #63  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,210
Honestly, I don't know the idx format and I don't use VobSub. Apparently, the idx file contains the indexes to each subtitle of the sub file, but I don't know if it holds a CLUT. If it's the case, I can try to implement a function to import its color palette in PgcEdit, but I need more info. I haven't been able to find a doc about the file format. Can you help me? Can you send me an example?
__________________
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 May 2009, 23:35   #64  |  Link
turbojet
Registered User
 
Join Date: May 2008
Posts: 1,840
Sure here's a sample.

I'm guessing this line is all that needs to be read: palette: 000000, cbcbcb, 000000, 000000, 000000, d6ec38, 000000, 000000, 000000, cbcbcb, 000000, 000000, 000000, cbcbcb, 000000, 000000

Thanks for looking into it.
turbojet is offline   Reply With Quote
Old 29th May 2009, 00:33   #65  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,210
Yep, thanks. I guess the colors are expressed in RGB values. Most of the colors are black, plus 3 light greys and a yellow. Can you confirm that?
__________________
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 29th May 2009, 12:04   #66  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,210
OK, done. You will be able to import the palette from a VobSub index file with the next version of PgcEdit.

In attachment is the example palette you gave me, converted to the PgcEdit YCrCb raw format (VTS_05_0.clb). Please confirm that it is correct. Thanks.
Attached Files
File Type: zip VTS_05_0.zip (143 Bytes, 5 views)
__________________
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; 29th May 2009 at 16:48.
r0lZ is offline   Reply With Quote
Old 29th May 2009, 16:22   #67  |  Link
turbojet
Registered User
 
Join Date: May 2008
Posts: 1,840
Thanks, here's the results

new on top
original on bottom

turbojet is offline   Reply With Quote
Old 29th May 2009, 16:44   #68  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,210
Oops, my bad. I forgot to accept the changes after having imported the IDX and before exporting the CLB, and, of course, PgcEdit has saved the original palette of my test DVD. I've updated the ZIP two posts above with the right CLB, but given your screenshot, I can confirm that it works well.
__________________
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 29th May 2009, 17:26   #69  |  Link
turbojet
Registered User
 
Join Date: May 2008
Posts: 1,840
Thanks, just waiting on approval of that file and I'll double check. Do you know when you might be releasing the next version with this added?
turbojet is offline   Reply With Quote
Old 29th May 2009, 19:11   #70  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,210
Currently, I haven't much time, but I should release it soon...
__________________
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 30th May 2009, 14:41   #71  |  Link
turbojet
Registered User
 
Join Date: May 2008
Posts: 1,840
I found 2 little discrepancies

color 5


colors 1, 9, 13


the other color, solid black, is correct
turbojet is offline   Reply With Quote
Old 30th May 2009, 15:35   #72  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,210
Some little errors are due to rounding problems when converting the YCrCb format to or from RGB. The conversion algorythms used by PgcEdit are correct, and they have already been verified several times. Of course, a little difference is still possible, and inevitable by nature, but it should never be superior to 1 (or -1).

Anyway PgcEdit is right:
Code:
palette: 000000, cbcbcb, 000000, 000000, 000000, d6ec38, [...]
The yellow is 0xD6EC38, in other words red = 214, green = 236 and blue = 56. Similarly, the grey is 0xCB for each component, and 0xCB is 203 in decimal. So, the NEW screenshots reflect (almost) perfectly the content of the IDX file, and it's either your ORIGINAL screenshots that are wrong, or the conversion to RGB made by VobSub.

The little difference in the red and blue component of the yellow slot are due to the rounding errors when the RGB values are converted back to YCrCb, and cannot be avoided.

BTW, how have you produced your ORIGINAL screenshots of the color picker? Obviously, they do not match the IDX file.
__________________
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; 30th May 2009 at 15:50.
r0lZ is offline   Reply With Quote
Old 30th May 2009, 16:16   #73  |  Link
turbojet
Registered User
 
Join Date: May 2008
Posts: 1,840
Original comes from original DVD.

I used vobsub 2.33 to create the idx. I also tried vsrip and the original DVD palette line was identical. However the custom colors line changed but does this have any effect in this situation?

I'm only using DVD to DVD for testing purposes now, if that was all I ever wanted to do I'd use pgcedit color copy/paste. My goal is to be able to do BD to DVD conversions with the most original looking subtitles as possible. My only option currently is BD sup -> vobsub -> DVD sup.

This result is plenty good enough for this particular DVD, it only uses grey and I have trouble telling the difference. However in a situation with colored subs I wonder if there's situations where it could look pretty ugly.

Last edited by turbojet; 30th May 2009 at 16:29.
turbojet is offline   Reply With Quote
Old 30th May 2009, 19:40   #74  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,210
Quote:
Originally Posted by turbojet View Post
Original comes from original DVD.
And displayed by PgcEdit? Right? Then it's the proof that VS doesn't generate its IDX file with the right values, or at least that it uses another formula than PgcEdit to do the conversion. Unfortunately, they store the values in the IDX file in already-converted RGB instead of the original YCrCb, therefore I can't use my own formula to convert and display them. I just take the RGB values from the IDX files, and display them unmodified. They are converted back to YCrCb when you click OK in the PGC Editor window. Of course, since the formula used by SubRip is not the same, that operation introduces an error.

There are many different formulas to convert from YCrCb to RGB and vice-versa, and I cannot be totally sure that PgcEdit uses the right one, but as I said previously, the PgcEdit formulas have been checked by several users and they seem to be accurate. Anyway, I'm not going to change them, unless someone can prove that they are wrong, and give me the right formulas.

BTW, can you send me the original palette, extracted by PgcEdit in raw .CLB format? They are the original YCrCb colors, directly extracted from the DVD, without any conversion. I would like to have a look.
__________________
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; 30th May 2009 at 19:49.
r0lZ is offline   Reply With Quote
Old 31st May 2009, 10:26   #75  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,210
I've double-checked again the conversion formulas, and I use (almost) exactly the formulas recommended in Keith Jack's Video Demystified to convert between 8-bit digital RGB (full 0-255 range) and YCrCb (SDTV 601). If you are interested, here are the formulas:
Code:
Y  =  0.257*R + 0.504*G + 0.098*B + 16    (rounded, and clipped to valid range 16-235)
Cr =  0.439*R - 0.368*G - 0.071*B + 128   (rounded, and clipped to valid range 16-240)
Cb = -0.148*R - 0.291*G + 0.439*B + 128   (rounded, and clipped to valid range 16-240)

R = 1.164*(Y-16) + 1.596*(Cr-128)
G = 1.164*(Y-16) - 0.813*(Cr-128) - 0.391*(Cb-128)
B = 1.164*(Y-16) + 2.018*(Cb-128)
(All RGB values are rounded and clipped to valid range 0-255)
The last two formulas were slightly different in PgcEdit:
Code:
G = 1.164*(Y-16) - 0.813*(Cr-128) - 0.392*(Cb-128)
B = 1.164*(Y-16) + 2.017*(Cb-128)
Those little errors can explain a slight difference with the correct values, but they are certainly not important enough to explain the differences with the values stored in the VobSub IDX files.
Anyway, I have fixed those errors now, as Video Demystified is cited as THE reference book by many specialists, and I trust it.

Additional note: Do NOT trust the converters at DVD Replica (YCrCb to RGB and RGB to YCrCb), as they are wrong (and there is a bug in the RGB to YCrCb applet preventing to specify a R value > 0).
__________________
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; 31st May 2009 at 10:41.
r0lZ is offline   Reply With Quote
Old 1st June 2009, 18:49   #76  |  Link
turbojet
Registered User
 
Join Date: May 2008
Posts: 1,840
Quote:
Originally Posted by r0lZ View Post
BTW, can you send me the original palette, extracted by PgcEdit in raw .CLB format? They are the original YCrCb colors, directly extracted from the DVD, without any conversion. I would like to have a look.
Sure here it is

Quote:
Originally Posted by r0lZ View Post
Anyway, I have fixed those errors now, as Video Demystified is cited as THE reference book by many specialists, and I trust it.
Did it have any effect on the output?
turbojet is offline   Reply With Quote
Old 1st June 2009, 19:06   #77  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,210
Thanks!
Quote:
Originally Posted by turbojet View Post
Did it have any effect on the output?
Perhaps some minimal effects on the rounding of the divisions, but certainly no more than a difference of 1 in each RGB component. As I said before, those rounding errors are inevitable. The new formulas are perhaps more accurate, and may avoid some rounding errors, but probably not all.
Anyway, it's not a solution for the IDX problem.

[EDIT] I've just imported the original palette in a DVD to verify the values. Of course, PgcEdit shows the colors like in your ORIGINAL screenshots above. (And BTW the difference in the formulas have no effects on the result.)
So, IMO, VobSub should store 218, 204, 38 (DACC26) for the yellow and 204, 204, 204 (CCCCCC) for the greys in the IDX files (or store the original YCrCb values instead of already converted RGB values), but it stores the wrong values D6EC38 and CBCBCB. Black is correctly converted to 000000. The greys are close enough to the original, but the yellow is very different. That's not surprising, as the difficulty with the conversions is the color components.

Unfortunately, I can't do much more. If you wish, try to contact the author of VobSub...
__________________
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; 1st June 2009 at 19:49.
r0lZ is offline   Reply With Quote
Old 1st June 2009, 19:43   #78  |  Link
turbojet
Registered User
 
Join Date: May 2008
Posts: 1,840
Do you mean vobsub / vsrip author, Gabest?

Unfortunately he's been gone for years but I see vsrip is open-source, if only I could make sense of any of the code.

Or would SubRip dev be able to help in some way?
turbojet is offline   Reply With Quote
Old 1st June 2009, 19:53   #79  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,210
No, my bad. I mean VobSub, of course. (I've fixed the "typo")

Unfortunately, if the development of VobSub has ceased, I suppose there is no simple solution. Try to find a program that can output the original palette in YCrCb format. If you need it, I can probably implement an import function in PgcEdit.
__________________
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 1st June 2009, 20:13   #80  |  Link
turbojet
Registered User
 
Join Date: May 2008
Posts: 1,840
I've been talking to BDSup2Sub dev about outputting dvd sup with one of the 2 pgcedit import formats. He said the txt format should be fairly simple but is there any advantage to using clb over the txt format?
turbojet 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 17:52.


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