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

rica
29th September 2008, 20:55
I am currently converting my HD-DVD's to Blu-ray. In order to fit the content on a single layer DVD I downscale the movie to 720p and encode with x264. Everything is straightforward, except for downscaling of the subs. I extract the bitmaps to PNG format using SUPread. These are 8-bit PNG's with variable transparency (set in the tRNS chunk of the PNG files).
Neither Photoshop CS nor GIMP reads the full transparency data. I have found that ImageMagick (convert.exe) actually can convert the PNG's to 32-bit (with transparency preserved) and scale them down to 1280x720. Another command-line program, Pngnq, can convert the 32-bit PGN's back to 8-bit with variable transparency.
I now have a BDN XML file (720p) and a set of 8-bit PNG's. Does anyone know a way doing the opposite of what SUPread does, i.e. to create a "sup" subtitle file from a XML file and PNG's?
I have access to Scenarist and I made one Bly-ray compilation with the 720p content. The end result is perfect with subtitles looking as the original (no jaggy outlines). A much easier (and less costly) way would be to use the free tsMuxeR. The only obstacle is the lack of a program that can create a "sup" file from BDN XML file and PNG's. Can anyone help?

Thanks for the post.
I guess SubtitleWorkshop4 will accept your xml.
Please feedback.

Ulf
30th September 2008, 10:59
Thanks for the post.
I guess SubtitleWorkshop4 will accept your xml.
Please feedback.

SubtitleWorkshop4 will not take a xml file as input. I want to create a sup file from a xml bdn file and PNG's.
Scenarist accepts the xml.

I have made a batch file that makes conversion from 1080p to 720p easy:

@REM Conversion of BDM XML file and PNG files to 720p.
@REM Drop folder(s) with PNG files and BDN XML file in this BAT-file.
@REM Use "SUPRead" to save the bitmaps as PNG from a "sup" subtitle file.

@REM ImageMagick ("convert.exe") has the ability to read the tranparency data
@REM stored in an indexed PNG file (saved in the tRNS chunk in a PGN file).
@REM Bitmaps saved from ".sup" by "SUPread" contains the transparency,
@REM but this information is disregarded by GIMP, Photoshop etc.
@REM ImageMagick opens the file and uses the tranparency data to form a 32 bit
@REM PNG file with variable transparency. The script below scales the image to
@REM 1280x720 and saves it. Observe! "pngnq.exe" can only do a proper conversion
@REM if the downscaling in ImageMagick is done by the simpler downscaling
@REM command "-scale 1280" instead of "-resize 1280".
@REM ImageMagick: http://www.imagemagick.org

@REM "pngnq.exe" converts the PNG file to an indexed 8-bit PNG file with
@REM full transparency retained (saved in the tRNS chunk).
@REM "pngnq.exe" requres the following DLLs: libpng13.dll and zlib1.dll
@REM pngnq: http://pngnq.sourceforge.net/
@REM libpng13.dll: http://www.cybertherial.com/pngnq/libpng13.dll
@REM zlib1.dll: http://www.dll-files.com/dllindex/dll-files.shtml?zlib1

@REM "sed.exe" is the GNU sed editor.
@REM sed.exe: http://sourceforge.net/projects/gnuwin32/

@REM The resulting files can be imported as BDN assets in Sonic Scenarist.
@REM -------------------------------------------------------
set CONV_EXE=C:\Program Files\ImageMagick\convert.exe
set PNGNQ_EXE=C:\Program Files\pngtools\pngnq.exe
set SED_EXE=C:\Program Files\GnuWin32\bin\sed.exe
@REM -------------------------------------------------------
set CONV_OPT=-scale 1280
set SED_OPT="10,12d;s/"1080p"/"720p"/g;s/"1920"/"1280"/g;s/"1080"/"720"/g"
@REM -------------------------------------------------------
cls
:NEXT
IF EXIST "%~f1\_CONVERTED.txt" goto :SKIP
FOR %%a IN ("%~f1\*.png") DO (
start "CONVERT" /belownormal /b /w "%CONV_EXE%" "%%a" %CONV_OPT% "%%a.png"
start "PNGNQ" /belownormal /b /w "%PNGNQ_EXE%" -f "%%a.png"
del /q "%%a"
del /q "%%a.png"
copy "%%a-nq8.png" "%%a"
del /q "%%a-nq8.png"
)
FOR %%a IN ("%~f1\*.xml") DO (
"%SED_EXE%" %SED_OPT% "%%a" > "%~f1\720p_subtitles.bdn.xml"
)
echo Files converted to 720p > "%~f1\_CONVERTED.txt"
:SKIP
shift
IF NOT "%1"=="" goto :NEXT
@REM -------------------------------------------------------


Save the code as a .BAT file and modify the path' to the executables if needed.

rica
30th September 2008, 11:27
Thanks for the tutorial.

rica
30th September 2008, 12:08
@Ulf,


I think there is an easier method of converting to 720p.

Just SUPRead is enough.

Options > Image > tick 720p

Savebitmaps > Export sup

You will have a 720p sup.

Ulf
30th September 2008, 21:34
@Ulf,


I think there is an easier method of converting to 720p.

Just SUPRead is enough.

Options > Image > tick 720p

Savebitmaps > Export sup

You will have a 720p sup.

Sure, I tried that first. The quality of the bitmaps that SUPRead produces by downscaling to 720p are barely usable.

Do a test and compare! Beware that you have to convert the resulting PNG's to 32-bit by:

convert.exe line0001.png line0001.png

before you actually can compare the results in a image viewer program (Photoshop, GIMP, ...).

rica
1st October 2008, 14:10
Sure, I tried that first. The quality of the bitmaps that SUPRead produces by downscaling to 720p are barely usable.

Do a test and compare! Beware that you have to convert the resulting PNG's to 32-bit by:

convert.exe line0001.png line0001.png

before you actually can compare the results in a image viewer program (Photoshop, GIMP, ...).

Yes, you are right. (I haven't noticed since i use srt.)

C:\>convert.exe -scale 1280 line0002.png out.png

1280*720 created by SUPRead:

http://img70.imageshack.us/img70/7140/line0002supreadmp7.th.png (http://img70.imageshack.us/my.php?image=line0002supreadmp7.png)http://img70.imageshack.us/images/thpix.gif (http://g.imageshack.us/thpix.php)

1280*720 created by ImageMagick:

http://img70.imageshack.us/img70/566/outiv3.th.png (http://img70.imageshack.us/my.php?image=outiv3.png)http://img70.imageshack.us/images/thpix.gif (http://g.imageshack.us/thpix.php)

Then what would be the command line to scale the whole pngs
inside the folder created by SUPRead? Or shall i have to use the script you gave?


_ _ _ _ _ _

Ulf
1st October 2008, 21:50
Then what would be the command line to scale the whole pngs
inside the folder created by SUPRead? Or shall i have to use the script you gave?


Use the the script. Save it as "720p.bat" and drop the whole folder created by SUPRead on it. The resulting files can be imported in Scenarist to a 720p project.

rica
2nd October 2008, 15:39
Use the the script. Save it as "720p.bat" and drop the whole folder created by SUPRead on it. The resulting files can be imported in Scenarist to a 720p project.

I tried; it worked very well but the question is i can't find out the output files :); when i look into the folder which i drop, i just see a text file which is written "Files Converted to 720p" ? (720p_subtitles.bdn.xml)

And i belive you will find the way of using it with a free tool?

Edit: I inserted libpng13.dll and zlib1.dll in the pngtools folder?

Ulf
2nd October 2008, 18:58
Well, I don't know what happened for you Rica. Have you installed the executables needed and put the right path for them in the .BAT file?

And, yes, libpng13.dll and zlib1.dll should be in the same folder as pngnq.exe. The converted files are created in the same folder that contained the original PNG's (with the same name as the originals). It works fine for me (I'm running WinXP).

rica
2nd October 2008, 20:52
Well, I don't know what happened for you Rica. Have you installed the executables needed and put the right path for them in the .BAT file?

And, yes, libpng13.dll and zlib1.dll should be in the same folder as pngnq.exe. The converted files are created in the same folder that contained the original PNG's (with the same name as the originals). It works fine for me (I'm running WinXP).

Yes, everything has been made as you described.
More; ex 1080p pngs have dissapeared.
Tried to get an SS, maybe it gives an idea:

http://img129.imageshack.us/img129/3435/supfd2.th.png (http://img129.imageshack.us/my.php?image=supfd2.png)http://img129.imageshack.us/images/thpix.gif (http://g.imageshack.us/thpix.php)

http://img387.imageshack.us/img387/1393/sup02hu9.th.png (http://img387.imageshack.us/my.php?image=sup02hu9.png)http://img387.imageshack.us/images/thpix.gif (http://g.imageshack.us/thpix.php)


Vista 32 ultimate btw...
_ _ _

rica
3rd October 2008, 00:15
OK,
i've found my mistake; i should have loaded "static.exe" instead of "dll.exe"

Now it is still converting and i see 1080ps are returning to 720ps gradually:

http://img129.imageshack.us/img129/9629/sup03oq6.th.png (http://img129.imageshack.us/my.php?image=sup03oq6.png)http://img129.imageshack.us/images/thpix.gif (http://g.imageshack.us/thpix.php)

rica
3rd October 2008, 00:36
OK, thanks, i have a folder which includes 720p pngs.
Next?

rica
3rd October 2008, 22:29
I hope pelican will have a look at those posts and update his SUPRead some day.

rica
4th October 2008, 00:45
I was wondering where this xml is?
Ulf reminded me to tick "Scenarist exp" box under options of SUPread; he said otherwise xml creation doesn't work.
And finally i got xml.
Thanks to Ulf again.
Hope it is gonna work with a free software someday.

alc0re
2nd December 2008, 05:33
@ Ulf or anyone else...

If someone doesn't have access to scenarist....am I SOL right now if I want to create a .sup file for Bluray muxing with TSRemux that is downscaled/resized to 1280x720?

Also, how do I get forced subtitles to work on an AVCHD disc?

Octo-puss
2nd December 2008, 09:51
Pardon the OT, but does SOL mean shit out of luck? :)

Adub
2nd December 2008, 19:46
@Octo-puss
Yes.

alc0re
3rd December 2008, 06:57
If anyone is interested and doesn't know it yet, there is a solution to this problem.

If you don't have access to Scenarist (like me), TSMuxer now accepts .srt files as input and will convert these to a Bluray compliant PGS/.sup subtitle stream.

So, I rip my Bluray using eac3to, including the .sup file I want.

I then ocr the .sup file with SupRip. Save as .srt. Spell check/fix ocr mistakes.

Then open up TSMuxer and add your video/audio/.srt subtitle stream. Set subtitle options in the subtitls tab. I set my font to Arial at a size of 40 for 720p video, with a bottom pixel offset of 36.

Set output to Create Bluray disk. That's it. Subs look great on standalones/PS3.

I apologize if this is old news to anyone, but I thought I'd share what I found just in case this helps anyone that was anxiously awaiting the export .sup as 720 option in SupRead.

laserfan
3rd December 2008, 15:23
...I then ocr the .sup file with SupRip. Save as .srt. Spell check/fix ocr mistakes.

Then open up TSMuxer and add your video/audio/.srt subtitle stream. Set subtitle options in the subtitls tab. I set my font to Arial at a size of 40 for 720p video, with a bottom pixel offset of 36....

I apologize if this is old news to anyone...Doesn't hurt to clarify!

I might add that this is useful also for re-positioning subs on a 'scope display i.e. if original subs bleed-into the "black bar" at the bottom, you can use Offset to re-position them for a 2.35:1 screen presentation.

jetli123
19th December 2008, 22:15
Hi,
I'm trying to extract the english subtitle from BD Fearless. If I use TSmuxer or ea3to and extract the subtitle .sup from the Director's Cut version which resides in 00153.m2ts file, then SUPread and/or SupRip would read the file fine. However, if I try extracting from the Theatrical version which resides in multiple *.m2ts files (ex: 00134.m2ts+00123.m2ts+***), either program would fail when reading the new .sup file:

SUPread:
Access violation at address 0054EC83 in module 'SUPread.exe'. Write of address FFFFFF68.

SupRip:
Object reference not set to an instance of an object.

Void LoadBluraySup(System.IO.FileStream)

at SupRip.SubtitleFile.LoadBluraySup(FileStream fs)
at SupRip.SubtitleFile.LoadFromSup(String supfile)
at SupRip.SubtitleFile..ctor(String fileName)
at SupRip.MainForm.LoadSubtitleFile(String fileName)


Have anyone try extracting subtitle from multiple *.m2ts files?

Here is the sup file generated from 2 .m2ts files (via eac3to)
http://www.100megs16.com/~thlphoto/test/00134_00123.sup


thx

jetli123
21st December 2008, 01:13
any help?

nautilus7
21st December 2008, 02:44
It's sticky anyway!

Don't expect much support from Suprip developer, though.

jetli123
21st December 2008, 02:57
It's sticky anyway!

Don't expect much from support from Suprip developer, though.


wow, so friendly ... happy holiday to you too :)
:thanks:

saint-francis
21st December 2008, 04:44
wow, so friendly ... happy holiday to you too :)
:thanks:

What it boils down to is that the developer doesn't spend as much time on the forum and in development as some users of his software might like. So since you posted a sample you will just need to be patient for a little while until he gets a chance to look at it. BD subtitles are still frustrating as we still have no comprehensive tools to deal with them, I understand. So we all need to be patient and wait for the technology to mature with time. This is something we can't rush as we aren't developing the software. We can only be grateful for what we already do have; and for free too!

ukendt
21st December 2008, 08:08
Peeps!!!!!!!
Behave....

jetli123
21st December 2008, 10:38
What it boils down to is that the developer doesn't spend as much time on the forum and in development as some users of his software might like. So since you posted a sample you will just need to be patient for a little while until he gets a chance to look at it. BD subtitles are still frustrating as we still have no comprehensive tools to deal with them, I understand. So we all need to be patient and wait for the technology to mature with time. This is something we can't rush as we aren't developing the software. We can only be grateful for what we already do have; and for free too!


Thanks, I didn't mean to rush. I'm just surprise that I can't find any comment on extracting subtitle from combined .m2ts files, that's all. I'm very happy that SUPread work with single .m2ts file. I googled this topic but didn't find much ...

Sorry if I offend anyone ... thanks for this wonderful software!

princenigma
5th January 2009, 02:34
Hi, I try "Home Alone (1900) Blu-ray" with supread 0.52b2,in image tab all line is empty
Are there any solutions ?
Thanks :)

Taktaal
5th January 2009, 20:02
A Bluray from 1900? Are you sure you really bought a movie and weren't tricked with a victorian era round mirror? :D

Anyway, can you try it with Suprip in my sig? If that doesn't work either, please send me the .sup file so I can have a look at it.

princenigma
6th January 2009, 09:55
Sorry . Wrong typing , it's 1990
Ok I will send the sup tomowwow. Thanks for the replay :)

princenigma
6th January 2009, 14:48
HI,Taktaal . I tried Suprip can show the sup file content correctly.
this is the sup file which Supread fail to read any img content
http://www.filesavr.com/hocn1

PassThePeas
12th January 2009, 02:07
Thanks pel for your great tool.

I'm having an issue with hd-dvds subtitles converted to blu-ray when played on a stand-alone player (sony BDP-S350). The problem is seen with subs extracted with EVO-Demux or eac3to from 2 different HD-DVDs then converted to Blu-Ray subs, before remuxing to BD with tsMuxer.

As soon as the first sub appears, the screen goes black except for the subs bounding box (readjusting as each sub comes along).
The subs play just fine with software player (tmt or power dvd).
I tried to compare the subs to others extracted directly from BDs, and the only thing i came up with seems to be the palette : when i display it in supread, the first color is red (whereas it comes black with other subs). Extracting PNGs produces the sames result (red background for "bad displaying" subs and black for others).

Has anybody else experienced the same issue ? In that case, has any solution been found ?
Any clue as to resolving the issue (or finding a workaround) ?

Thanks in advance for any answer as I have about ten HD-DVDs I'd like to convert to BD ;)

Thunderbolt8
14th January 2009, 18:53
there are sometimes movies for which Supread doesnt recognize/display any subs on screen. dont know why, but the subs are fine, as they work with suprip without problems for example. guess its the same problem princeenigma posted about above^^
is there any way to fix that? heres a sample:
http://www.sendspace.com/file/hju6si

SomeJoe
18th January 2009, 21:53
I'm having an issue with hd-dvds subtitles converted to blu-ray when played on a stand-alone player (sony BDP-S350). The problem is seen with subs extracted with EVO-Demux or eac3to from 2 different HD-DVDs then converted to Blu-Ray subs, before remuxing to BD with tsMuxer.

As soon as the first sub appears, the screen goes black except for the subs bounding box (readjusting as each sub comes along).
The subs play just fine with software player (tmt or power dvd).
I tried to compare the subs to others extracted directly from BDs, and the only thing i came up with seems to be the palette : when i display it in supread, the first color is red (whereas it comes black with other subs). Extracting PNGs produces the sames result (red background for "bad displaying" subs and black for others).

Has anybody else experienced the same issue ? In that case, has any solution been found ?
Any clue as to resolving the issue (or finding a workaround) ?

Thanks in advance for any answer as I have about ten HD-DVDs I'd like to convert to BD ;)

I have seen the same issue under the same conditions (converting sub stream extracted with eac3to.exe from an HD-DVD and converted to a BD sub stream with SUPread, and played back on a Sony BDP-S350).

I don't know a whole lot about the structure of subs, so I haven't investigated why this happens, but I suspect some problem with the color palette as you have discovered.

My only work-around has been to use SUPread to convert the HD-DVD sub stream to an .srt using the OCR function. After that, you can bring the .srt into TSMuxer and it will render a BD subtitle stream according to the font settings on the Subtitles tab. The OCR in SUPread is pretty good, but I have run into one HD-DVD (Disturbia) that the OCR was terrible because the character spacing on the original HD-DVD subs was very tight. It required several hours of editing before I had a good .srt.

PassThePeas
19th January 2009, 03:05
Thanks for your answer SomeJoe. I came to the same conclusion (OCR with supread then muxing srt with tsMuxer), but since I'm french, OCR'd subtitles editing can be quite painfull (é,è,ê mixed up, strange spaces between numbers, etc ...).

As far as I could understand from the different threads I've read, palette information seems to be stored at some point before the actual images in the PG stream, so it should be possible to alter that information while parsing the data in the stream, but I couldn't find information consistent enough to be able to even consider coding such a tool.

Since SupRead can display the palette on the screen with each sub, I guess that it could integrate some kind of functionality like setting a pre-defined pallette for all subtltiles ... Pel, if you hear me ... :)

Of course, if someone is able to provide enough information on the PG stream, I could try and make the tool (I'll just have to find the time and to sum up my memories to be able to do some programming again ...).
If that was to happen, I'll keep you posted :rolleyes:

DaMacFunkin
19th January 2009, 18:34
Anybody know a quick way to force a subtitle stream created with supread and imported into scenarist as a bdn file? If you edit the bdn file each line has a section which says "forced="False" i have tried editing the bdn file so all the subs say "True" but it doesn't work, you have to go through every single sub in Scenarist and force them :-(

Rectal Prolapse
19th January 2009, 19:00
DaMacFunkin, you can open your scenarist project file after saving your project in Scenarist - it is in XML format. You can edit it to force the subtitles on in there!

DaMacFunkin
19th January 2009, 22:52
Brilliant, didn't realise this, wish i'd known this before i did The Mummy Returns (HD DVD 2 Blu-RAY(110 subs manually forced)) Thanks.

Rectal Prolapse
19th January 2009, 23:15
You may be able to also force subtitles on using the "setstream" command (before the play command) when building the playlist scenario. Um. I think that is what it is called.

Octo-puss
1st February 2009, 11:45
Could you give me some brief hint how to work with SUPRead please? I know I used it in past, but I forgot all I knew. I got this .sup file I extracted from my Blu-Ray movie LONG ago and now I decided it's time to convert it into srt format... But I am totally confused how.

Furiousflea
11th February 2009, 02:14
Hi there, I'm trying to load an .srt file in SUPread but ever time I do an error pops up...

"Division by zero"

I've tried looking for other people with this problem but don't seem to be anyone at all.

I have abc.png in same directory as needed.

Any ideas...?

Thanks, Rob

Rectal Prolapse
11th February 2009, 06:25
Doesn't supread read .sup files only?

0xdeadbeef
11th February 2009, 20:13
I stumbled over an issue with the SUPs extracted from the German Blu-Ray of "Pirates of the Carribean III".

In most of the SUP frames, there is a seconds palette definition
after the ODS with the byte size 2 (-> 0 entries) that looks like this:

14 00 02 01 00

This is what SupRead reports:

00000002: PTS=004F6308 (00:00:57,808)
0000000A: PCS (13) state: 2
0000002A: WDS0 (0A) id: 0 -
00000041: PDS (4FD) 255 palettes
0000054B: ODS0 (628F) 670 x 118
000067E7: END
000067EC: PTS=0055BEA2 (00:01:02,437)
000067F4: PCS (0B) state: 0
0000680C: WDS0 (0A) id: 0 -
00006823: PDS (02) 0 palettes <-----------------------------
00006832: END

When I delete the 2nd 2-Byte PDS entries from the SUP before importing them into SupRead, the subtitles are rendered correctly.

So obviously, SupRead uses the 2nd (invalid) palette definition to render the subtitle image instead of the first one (->empty). I'd guess that the order matters though and the PDS _before_ the ODS should be used.
Or maybe palette definitions with 0 palettes just must be ignored?
Either fix would do...

Besides, while we're at it, the 1st PCS in this SUP stream looks like this:

16 00 13 07 80 04 38 10 00 00 80 00 00 01 00 00 00 00 02 C3 03 65 - POTC3 (1)

16 - PCS identifier
00 13 - size of section: 0x13
07 80 04 38 - width, height: 1920x1080.
10 00 01 - sequence number ???
10 00 00 xx - xx = 1: don't clear, 0: clear, 10 = ???
00 00 00 xx - 40: next sub forced, 0: don't force
02 C3 03 65 - ???

Is anything known about the last 4 bytes or the other entries marked as "???" ?

I'd be interested in any documentation about the BD-SUP (and maybe HDDVD-SUP) format that exceeds the discussion in this forum.

pleinlesyeux
13th February 2009, 17:44
"division by zero" when importing .srt file.

I have the same problem as Rob.

My issue is to create a compliant sst, xml and png files to import in scenarist. So far, my png files are of a black background, not a transparent one. How could I do that ?

Thanks.

Rectal Prolapse
13th February 2009, 22:15
pleinlesyeux, you could do an adobe photoshop action to make black always transparent, and then process all the PNGs in a batch action.

pleinlesyeux
13th February 2009, 23:58
Hi !

First I found out a way to stop the "divide by zero" issue.

It seems that my .srt outputed from suprip in not fully compliant with supread.
So I used subtitler to input the .srt and to save it again.

Result : 3 times lighter. And imports fine in supread.
When I check the difference between both in notepad, there is... none !

-----

My aim is to change the vertical position of the subtitle of a blu ray stream. Stand alone players don't do that.

I tried many stuff, but am still stuck.


-

Thunderbolt8
23rd February 2009, 00:39
anyone able to take up the work on SUPread since Pelican9 obviously doesnt do anything any more?

Rectal Prolapse
23rd February 2009, 05:44
Thunderbolt8, there is no source for supread. It's also written in Delphi, which isn't very commonly known.

I have been thinking of writing my own version - although it won't be much more functional than suprip if I ever do start on it.

madshi
23rd February 2009, 08:25
It's also written in Delphi, which isn't very commonly known.
Delphi is the only good development language... ;)

<goes into hiding before C and C++ devs chime in>

Rectal Prolapse
24th February 2009, 18:57
lol madhi!

Delphi reminds me of Pascal, but without the insanity. :)

C++ is like a beautiful woman who is great in bed - but occasionally goes batpoo insane and runs off with your credit cards and has affairs behind your back. And occasionally leaves dangling pointers!

GZZ
26th February 2009, 21:28
all in for delphi. Its a nice language. Still using Delphi 7 and it rocks. :P