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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th September 2009, 19:38   #1  |  Link
deank
Programmer (or just 教务长)
 
deank's Avatar
 
Join Date: Oct 2008
Location: Valencia, Spain
Posts: 4,251
readSUP - CLI to downscale/resize SUP to 720p/576i/480i and extract timings to SRT

Here is a small tool to create 'srt' timings from .sup file and to downscale (only) higher to lower resolution: readSUP (only 40kb (or 90kb with the icon) - requires calclib.dll (1.4MB) from multiAVCHD/CalcIt or just full download (600kb)).

I don't know if there is any use of it... I decided today to play around with this .sup format and see if it is possible to create a CLI for resizing .sup subtitles.

The idea was to make it small and not dependent on NET framework or java or anything... just a standalone exe+dll.

Also here is a link to another tool textST which extracts textST subtitle streams from m2ts / pes files.

Code:
C:\>readSUP.exe
readSUP 0.2 - SUP/PGS analyzer & resizer (deank@doom9)

Usage: readSUP input_file [out_file] /720|576|480 /verbose /srt /analyse /left
* input_file must be in SUP/PGS format
Code:
C:\>readSUP.exe 00000.track_4608.sup

readSUP - SUP/PGS analyzer (deank@doom9)

Detected 2928 segments and 366 objects (732 PG compositions).
...

00:02:14,857 - 00:02:14,926 # 113:   $13 bytes, Presentation: 1920x1080@23.976
00:02:14,857 - 00:02:14,922 # 114:    $A bytes, Window: 466,870 981x156
00:00:00,000 - 00:02:14,857 # 115:  $4E4 bytes, Palette Definition
00:02:14,857 - 00:02:14,866 # 116: $D30F bytes, Object: 54024 bytes, 981x156 [C]
00:00:00,000 - 00:02:14,866 # 117:    $0 bytes, End of Display Set

00:02:14,926 - 00:02:18,180 # IN_OUT TIME

00:02:18,175 - 00:02:18,180 # 118:    $B bytes, Presentation: 1920x1080@23.976
00:02:18,175 - 00:02:18,175 # 119:    $A bytes, Window: 466,870 981x156
00:00:00,000 - 00:02:18,175 # 120:    $0 bytes, End of Display Set

00:02:18,319 - 00:02:18,388 # 121:   $13 bytes, Presentation: 1920x1080@23.976
00:02:18,319 - 00:02:18,383 # 122:    $A bytes, Window: 450,870 1013x156
00:00:00,000 - 00:02:18,319 # 123:  $4E9 bytes, Palette Definition
00:02:18,319 - 00:02:18,328 # 124: $FFEF bytes, Object: 65577 bytes, 1013x156 [F]
00:02:18,319 - 00:02:18,328 # 125:   $45 bytes, Object: (cont) 58 bytes [L]
00:00:00,000 - 00:02:18,328 # 126:    $0 bytes, End of Display Set

00:02:18,388 - 00:02:23,727 # IN_OUT TIME

00:02:23,722 - 00:02:23,727 # 127:    $B bytes, Presentation: 1920x1080@23.976
00:02:23,722 - 00:02:23,722 # 128:    $A bytes, Window: 450,870 1013x156
00:00:00,000 - 00:02:23,722 # 129:    $0 bytes, End of Display Set
Code:
15
00:02:14,926 --> 00:02:18,180
Text line #15

16
00:02:18,388 --> 00:02:23,727
Text line #16

17
00:02:24,019 --> 00:02:28,482
Text line #17

Dean
__________________
multiAVCHD - donate | popBD | uncropMKV | mkv2avi | easySUP

Last edited by deank; 1st October 2009 at 16:05.
deank is offline   Reply With Quote
Old 29th September 2009, 11:36   #2  |  Link
0xdeadbeef
Author of BDSup2Sub
 
Join Date: Jun 2003
Posts: 478
Quote:
Originally Posted by deank View Post
I decided today to play around with this .sup format and see if it is possible to create a small CLI for resizing .sup subtitles.
Just a small warning: when the subtitles are resized, the dts/pts timestamps of the different packets have to be recalculated. For a complex PGS with e.g. multiple objects in multiple windows this will need a very detailed understanding of the PGS format and the timing limitations defined by the BD specs. And since unfortunately the current free authoring (let's better call them muxing) solutions don't check or recalculate these timestamps, the playability of resized streams is questionable if these additional time stamps are missing or wrong.

It took me quite some time to determine all of the timestamps for my simplified packet format in BD-SUP streams exported by BDSup2Sub, so I guess it will be a major effort to get this all right in a complex stream.
0xdeadbeef is offline   Reply With Quote
Old 29th September 2009, 19:57   #3  |  Link
deank
Programmer (or just 教务长)
 
deank's Avatar
 
Join Date: Oct 2008
Location: Valencia, Spain
Posts: 4,251
I'll see what will happen.

I had some time earlier today so I'm ready with the vertical resize. I loaded the 'resized' .sup file in BDsup2sub and it is just fine.

Now I'll finish the horizontal resize and will post back with a test version.

Except resizing I'll add simple parsing with changing the justification of the subtitles, so one can move them up or down and align them left/centered/right.

Small steps at a time - after all it is just 200 lines of code without the help of any libraries or anything.

edit: Ok, now resize works just fine Wasn't that hard.

It is kind of slow (~9mins for 1400 subpictures 1920x1080->1280x720 conversion in 2hr movie), but I'll check the RLE decode/encode, as it seems it is slowing the whole process.
__________________
multiAVCHD - donate | popBD | uncropMKV | mkv2avi | easySUP

Last edited by deank; 30th September 2009 at 17:32.
deank is offline   Reply With Quote
Old 30th September 2009, 14:16   #4  |  Link
deank
Programmer (or just 教务长)
 
deank's Avatar
 
Join Date: Oct 2008
Location: Valencia, Spain
Posts: 4,251
Task completed! Link in 1st post is updated to a fully working readSUP downscaller.

I'll appreciate any feedback (without complaints about speed).

Dean

p.s. Few small bugs were fixed, too.
__________________
multiAVCHD - donate | popBD | uncropMKV | mkv2avi | easySUP

Last edited by deank; 30th September 2009 at 20:31.
deank is offline   Reply With Quote
Old 11th October 2015, 00:08   #5  |  Link
Rudde
Registered User
 
Join Date: Oct 2009
Posts: 13
Wow, this post is really old, but I'm desperate. I need to extract TextST subs from a BD, using the textst.exe tool I only get the error.

Quote:
textST stream extractor (deank@doom9)

(RT) Error oppening file (WIN32 Error: 8) - Line 24
I have now tried both Windows 8.1 x64 and Windows 7 x64 and get the exact same error both places.
Rudde is offline   Reply With Quote
Reply

Tags
multiavchd, readsup, textst


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 20:33.


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