Log in

View Full Version : HD subtitle ripping (SUPread)


Pages : 1 2 3 4 5 6 [7] 8 9 10 11 12 13 14 15 16

XolocoTuxmaster
17th February 2008, 22:06
Hi everybody!
I'm still in Africa but I've worked on SUPread a little, but I don't know if is there anybody who need this program. I've just finished the BD strean export, so you can convert the HD DVD subtitle stream to BD subtitle stream. I'm working on the .srt import, with this function you can make a BD stream from an .srt. I didn't follow these topics here, so please tell me if somebody else has already made a tool for these functions. I'll upload the new beta soon (I hope).
Pel


Nobody has released a tool for hd dvd subs to BD subs yes
SubtitleWorkshop4 lets you import an .srt to export an .bdn...but it's still beta

Pelican9
18th February 2008, 08:17
Here it is.

Changes for v0.47

- Export Blu-ray subtitle stream
- Import .SRT files ('abc.png' needed for this function)
- correctly handle HD DVD contrast (transparency) information
- Palette and alpha information displays if 'Palette on bitmap' checked
- About window
- Little bugfixes
- abc.png contains all the english alphabet, the numbers,
the following chars !"#$%&'()*+,-./:;<>?@[]°,
music note and all the hungarian extra chars (áéíóöőúüű)
(Special thanks to 'Simon Templar' at avx.hu)

Download the latest version: http://pel.hu/down/SUPread.exe
Change log: http://pel.hu/down/SUPread.txt

Download 'abc.png': http://pel.hu/down/abc.png

This program is FREEWARE, but feel free to DONATE me here: http://pel.hu

nautilus7
18th February 2008, 09:35
So, if i got it right... I can import an English or Hungarian srt subtitle and convert it to HD DVD or Blu-ray sup subtitle. Is it possible to import other languages?

Pelican9
18th February 2008, 10:06
So, if i got it right... I can import an English or Hungarian srt subtitle and convert it to HD DVD or Blu-ray sup subtitle. Is it possible to import other languages?

1. You can do the following:
Import HD DVD subtitle stream -> export .srt subtitle
Import HD DVD subtitle stream -> export BD subtitle stream
Import HD DVD subtitle stream -> export bitmaps (BMP, PNG)
Import BD subtitle stream -> export .srt subtitle
Import BD subtitle stream -> export bitmaps (BMP, PNG)
Import .srt subtitle -> export BD subtitle stream
Import .srt subtitle -> export bitmaps (BMP, PNG)

2. Yes, it is possible, but I need help to make it (edit the abc.png and the data file). And if somebody wants italic letters, then he/she has to make the data file for it.

XolocoTuxmaster
18th February 2008, 10:37
Thank you very much!

It would be great if you include .bdn as output too, to use it at Scenarist BDA

nautilus7
18th February 2008, 11:25
OK, i see. Is srt --> HD DVD sup support expected soon?

What exactly do you need to add support for other (Greek) languages? An abc.png file with all Greek characters like the English one?

XolocoTuxmaster
18th February 2008, 12:31
If you want to know it, spanish special characters are:

áéíóúüñ
ÁÉÍÓÚÜÑ
€¿¡ºª«»

More info about special characters (for other languages too) can be found here

http://webdesign.about.com/library/bl_htmlcodes.htm

Thanks again, you are doing a great work

Pelican9
18th February 2008, 12:35
OK, i see. Is srt --> HD DVD sup support expected soon?

What exactly do you need to add support for other (Greek) languages? An abc.png file with all Greek characters like the English one?

Yes, and the positions and widths of the chars in that png.
I can send you the file if you want to work with it.

Pelican9
18th February 2008, 12:38
Thank you very much!

It would be great if you include .bdn as output too, to use it at Scenarist BDA

What is the format of this .bdn?

Pelican9
18th February 2008, 12:43
If you want to know it, spanish special characters are:

áéíóúüñ
ÁÉÍÓÚÜÑ
€¿¡ºª«»

More info about special characters (for other languages too) can be found here

http://webdesign.about.com/library/bl_htmlcodes.htm

Thanks again, you are doing a great work

I have to figure out, how can I handle all the languages...
Edit:
I've just uploaded the 0.47b2 version which works well...

XolocoTuxmaster
18th February 2008, 17:42
What is the format of this .bdn?

Well, actually I better said .png+.bdn, it's a kind of timecodes file. Subtitle WorkShop 4 ("http://www.urusoft.net/download.php?id=sw4&mirror=1) can export it from an .srt, it's still very beta and have some mistakes but maybe you can use it for some tests
1. Load *.srt file by SubtitleWorkshop4 (version 4 support bdn file export)
2. Clicks file->export customize image subtitle
3. Select 8bit PNG, and select movie resolution and fps.
4. Export
I have to figure out, how can I handle all the languages...


Are you talking about programming...or finding the special characters for them all? If it's the second one, here there are some links to general special characters articles.

I've checked it includes Spanish, French, German and of course English ones...don't know anyone else since I just speak that ones XD but I think they are included too

http://graveyard.maniacalrage.net/etc/special/
http://www.yourhtmlsource.com/text/specialcharacters.html
http://www.degraeve.com/reference/specialcharacters.php

Hope it helps

nautilus7
18th February 2008, 20:01
Yes, and the positions and widths of the chars in that png.
I can send you the file if you want to work with it.Yes, please!

Rectal Prolapse
18th February 2008, 20:30
I made a new tool that converts hd-dvd .sup files (made by evodemux) into scenarist-compatible BDN files with PNGs:

D:\Projects\hdsup2bdn\release>hdsup2bdn.exe --help
Allowed options:
--help produce help message
--version print version number
--original output PNG images in the original size (suitable for
OCR)
--fullpng output 1920x1080 PNG images [DEFAULT]
--nobdnfixtimes do not divide BDN times by 1.001 (BDN output only)
--bdnfixtimes divide BDN times by 1.001 (BDN output only) [DEFAULT]
--srtfixtimes divide SRT times by 1.001 (SRT output only)
--nosrtfixtimes divide SRT times by 1.001 (SRT output only) [DEFAULT]
--framerate arg frame rate [DEFAULT: 29.97]
--input-file arg input file
--srt output SRT file
--xml output Scenarist HDMV BDN file
--forcedsubs make all subtitles forced (BDN output only)
--dropframes flag all subtitle times as drop frames (BDN output
only)
--nopng don't generate any PNGs


Be sure to use the --xml option to output BDN files. SRT output is added but doesn't do OCR - it is really only for those who with wish to look at the timings only.

Also note that the timestamps are sped up by 1.001 when converting from .sup to BDN - otherwise sync will be wrong. But you can override this setting with the --nobdnfixtimes option.

I will release full source code (C++ using Boost libraries) if this version works wells. :)

sendspace link to the file: http://www.sendspace.com/file/ud8b2b

Rectal Prolapse
18th February 2008, 20:44
BTW, hdsup2bdn preserves the original transparency colors from the hd-dvd subtitles. This will probably make it harder to OCR - for such cases, suprip may be a better choice, as the black outline around subtitles will blend in with the black background it uses.

The --original option preserves the original subtitle bitmap size from the .sup file as well - and will output the x,y coordinates in the BDN. This could save a little bit of space in the subtitle stream, and could potentially make it easier to OCR.

A later version will let you select the opaque transparency color for easier OCRing.

Rectal Prolapse
19th February 2008, 00:54
Thanks for the new supread by the way. :)

Pelican9
19th February 2008, 14:49
I've upload a new beta with minor changes to handle more than one language.
The abc.png (http://pel.hu/down/abc.png) has changed also.
It contains now the upside down ?! and the n with tilde.
The program search the .png files in the same directory where the program started.

If you want to make an own character set then make your own .png file and download the data.pas (http://pel.hu/down/data.pas), edit it and send them to me.

I've put comments into it where you can place your data.

First you have to insert your file name (.png) (letfiles).

I need three data for every line:
1. y position of the line's top (letls)
2. y position of the line's base (this is the bottom of the letters) (letlb)
3. y position of the line's bottom (letle)

The normal and the italic style is two seperate array (letdat, letdati).

I need five data for every single char:
1. the line number
2. the character's starting x position
3. the character!s width
4. pixels decreasing the spacing before the start of the char
5. pixels decreasing the spacing after the end of the char

Pelican9
19th February 2008, 15:05
Well, actually I better said .png+.bdn, it's a kind of timecodes file. Subtitle WorkShop 4 ("http://www.urusoft.net/download.php?id=sw4&mirror=1) can export it from an .srt, it's still very beta and have some mistakes but maybe you can use it for some tests

I see, it's an xml. I can do it, if somebody wants this. The PNG export works well.

Are you talking about programming...or finding the special characters for them all?
I mean the programming part.

I made a new tool that converts hd-dvd .sup files (made by evodemux) into scenarist-compatible BDN files with PNGs:

Will this function be useful in SUPread?

hm10
19th February 2008, 15:38
i can't export sup
i have the abc with the english letters that you did, load srt file in english try to export and it write error

"Access violation at address 0049A75F in module 'SUPread.exe'. Read of address 4A4948AF."

thx pelcian

Pelican9
19th February 2008, 15:42
i can't export sup
i have the abc with the english letters that you did, load srt file in english try to export and it write error

"Access violation at address 0049A75F in module 'SUPread.exe'. Read of address 4A4948AF."

thx pelcian

Is this the newest version?

hm10
19th February 2008, 15:44
yes 0.47b3

maby i changed in mistake something in the options
so i will download the tool again and'll talk you in more 3-4 h' i'm going now...

hm10
19th February 2008, 18:18
ok, try to download again but still don"t work

Rectal Prolapse
19th February 2008, 18:39
Will this function be useful in SUPread?

Maybe. Although hdsup2bdn is very fast - it can process approximately 20 subtitles a second on a Core 2 Duo PC (the conversion to PNG takes a long time - I'm using the official PNG library).

It also corrects the timestamps for use in Scenarist BDMV, as the PTS times are in non-drop frame mode (24 fps) instead of the expected 23.976 fps.

It only works on HD-DVD .sup files though, so I can see a demand for making BDN files for Blu-ray subtitles. I would like to add Blu-ray .sup support one day, but it may be a while.

Give hdsup2bdn a try - figuring out the BDN file format should be straightforward!

Pelican9
20th February 2008, 09:59
ok, try to download again but still don"t work
Send me that .srt file, I'll check it.

nautilus7
20th February 2008, 11:04
Pelican9, i don't understand what to modify in the .pas file. Can you make it more clear?

hm10
20th February 2008, 11:39
Send me that .srt file, I'll check it.

check your pm

Pelican9
20th February 2008, 21:07
Pelican9, i don't understand what to modify in the .pas file. Can you make it more clear?
OK, I'm trying to explain (sorry for my English).
1. Create a png file with your letters. It has to be a transparent background and the letters have to be in lines. (See the abc.png, it has 5 rows.) You have to leave enough space between the italic characters because I will cut the chars from this image with rectangular shape. (It will be easier for me if your lines will be about 70-80 pixels high and the base around 57 pixels.)
http://pel.hu/down/lett.jpg

2. You have to fill the line data.
The blue lines are the top y coordinates of the 1st and the 3rd lines. You have to write this into the letls array.

letls: array[0..0] of Tline = ( // line start y
( 0, 73,146,218,291, 0, 0, 0, 0, 0) // for default
// ,
// ( 1st, 2nd, 3rd, 0, 0, 0, 0, 0, 0, 0)
);

The red lines are the base y coordinates of the 1st and the 3rd lines.
You have to write this into the letlb array.

letlb: array[0..0] of Tline = ( // line base y
( 57,130,203,276,349, 0, 0, 0, 0, 0)
// ,
// ,( 1st, 2nd, 3rd, 0, 0, 0, 0, 0, 0, 0)
);

The green lines are the y coordinates of the 1st and the 3rd lines. You have to write this into the letle array. The same way as above.

3. You have to fill the characters data (normal style)

The purple lines indicate the x position of the D and th E letters.
You have to give five numbers for each character.
For example the 'D' looks like this: (3, 187, 41, 1, 0),
because it is in the 3rd line, it starts at 187 (x position) and its width is 41 pixels.
The last two numbers is needed for adjusting the space between two letters. The first one tells how many pixels bypassed before the char the second number shows the same but after the char.
You have to put the characters data to the letdat and letdati (italic style)
This array has 256 line. The first line is for the character code 0 (not exists), the second is for code 1, the 33rd is for code 32 (space) the 34th is for code 33 (!), ... and the 256th is for code 255.

letdat: array[0..0] of Tletdat
//char code, line, x pos, width, dec before, dec after
=(// normal letters in 'abc.png'
((0, 0, 0, 0, 0), //00
(0, 0, 0, 0, 0), //01
...
(0, 0, 0, 0, 0))
// ,( // put the new data here (normal)
// (0, 0, 0, 0, 0),
// ...
// (0, 0, 0, 0, 0))

After the 256th line you can find a comment where have to put your data.

I hope it will help you.
Thanks for your work!

nautilus7
20th February 2008, 21:47
Ok, thanks. I will try when i find some time.

Pelican9
21st February 2008, 22:53
I've worked on SUPread a little.
Here is the new beta.
Download the abc.png (http://pel.hu/down/abc.png) too.
There is some new option to SRT -> bitmap conversion.

hm10:
Try this version, maybe help.

hm10
22nd February 2008, 06:02
hm10:
Try this version, maybe help.

thx now working

but still i can't import this in tsremux
or maby this happen because i need change to stream export to HD-DVD?
how i change? i remember was "import button" that give to chnage this

Pelican9
22nd February 2008, 09:46
thx now working

but still i can't import this in tsremux
or maby this happen because i need change to stream export to HD-DVD?
how i change? i remember was "import button" that give to chnage this

The HD DVD stream export does'nt work, because I don't know any tool which can handle it, so it's useless now. Anyway, I think it's not a big work, so maybe I'll finish this, just in case. :)

I hope TsRemux or TsMuxer can mux this BD stream soon...

hm10
22nd February 2008, 13:29
The HD DVD stream export does'nt work, because I don't know any tool which can handle it, so it's useless now. Anyway, I think it's not a big work, so maybe I'll finish this, just in case. :)

I hope TsRemux or TsMuxer can mux this BD stream soon...

ok thx

Rectal Prolapse
22nd February 2008, 17:23
Any feedback for the hdsup2bdn tool?

If everything is fine I may release the source next week or two.

With luck, portions of it can be used in a new VSFilter or something like that...

Pelican9
22nd February 2008, 21:56
I've just finished the HD DVD stream export.
Enjoy it! :)

You can do the following now:
Import HD DVD subtitle stream -> export .srt subtitle
Import HD DVD subtitle stream -> export BD subtitle stream
Import HD DVD subtitle stream -> export bitmaps (BMP, PNG)
Import BD subtitle stream -> export .srt subtitle
Import BD subtitle stream -> export bitmaps (BMP, PNG)
Import BD subtitle stream -> export HD DVD subtitle stream
Import .srt subtitle -> export BD subtitle stream
Import .srt subtitle -> export bitmaps (BMP, PNG)
Import .srt subtitle -> export HD DVD subtitle stream

You can do also BD to BD or HD DVD to HD DVD but it doesn't make sense.

Rectal Prolapse:
I haven't started the bdn export yet...

hm10
22nd February 2008, 22:43
chnage the link in your http link to the new ver'

Pelican9
23rd February 2008, 07:22
chnage the link in your http link to the new ver'

Only the newest version is there.
I've just check it, this is the new one.

hm10
23rd February 2008, 14:32
yesterday it was the the older, now ok...
and the hd-dvd sup doesn't work with tsremux...

Pelican9
23rd February 2008, 15:12
Change for v0.49

- BDN xml export for Scenarist during bitmap saving

jamos
24th February 2008, 02:14
Change for v0.49

- BDN xml export for Scenarist during bitmap saving

Nice job Pelican Ill check it out.

Pelican9
24th February 2008, 08:39
Nice job Pelican Ill check it out.

Thank you for testing. I need feedback...

hm10
24th February 2008, 14:54
now just need support in tsremux =\

Kurtnoise
24th February 2008, 18:08
@Pelican9: great stuff...:) btw, why not embedding the abc.png file within your .exe ?

hm10
24th February 2008, 18:16
http://pel.hu/down/lett.jpg



you can give me the psd of this picture

Pelican9
24th February 2008, 19:51
@Pelican9: great stuff...:) btw, why not embedding the abc.png file within your .exe ?

Yes, it should be more elegant, but there will be more png file(cyrillic, greek, maybe others), and I don't want put into the exe all of them. I'm still thinking about it.

Pelican9
24th February 2008, 19:52
you can give me the psd of this picture

No, I can't. It's png.

hm10
24th February 2008, 19:58
No, I can't. It's png.

you didn't make it in photoshop?
so maby you know how i do letter same in u'r picture with transpent background

jamos
24th February 2008, 20:01
Thank you for testing. I need feedback...

Getting a error when trying to import into scenarist well it just locks up at 0% after it loads the xml. xml looks good, its when its actually trying to import the pngs that it hangs. Wonder if it doesnt like the pallete or something I know scenarist only supports 256 colors so you need to use 8bit png.

Also can you support 720p? Add a feature to the format box where you can set the resolution to 1080p or 720p?

thanks

Pelican9
24th February 2008, 20:53
you didn't make it in photoshop?
so maby you know how i do letter same in u'r picture with transpent background
Start a new file choose transparent background.
Write the text and check 'stroke' in layer style.

Pelican9
24th February 2008, 21:00
Getting a error when trying to import into scenarist well it just locks up at 0% after it loads the xml. xml looks good, its when its actually trying to import the pngs that it hangs. Wonder if it doesnt like the pallete or something I know scenarist only supports 256 colors so you need to use 8bit png.

Also can you support 720p? Add a feature to the format box where you can set the resolution to 1080p or 720p?

thanks
Hmmm, it sounds interesting. Somebody reports succesfully import in Scenarist but it was about six month ago...
Are you sure Scenarist cannot load PNG24?
I don't want to degrade the picture quality if not neccessary.

marco_ooo
24th February 2008, 21:42
i changed the picures(png) for the one that subtitle workshop create png 8bit en then the xml works

hope this experiment helps

Pelican9
24th February 2008, 21:47
i changed the picures(png) for the one that subtitle workshop create png 8bit en then the xml works

hope this experiment helps

Thank you!
It means Scenarist really needs PNG8. :-(