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 > (HD) DVD & Blu-ray authoring

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th January 2016, 03:14   #81  |  Link
bigotti5
Spielberger
 
bigotti5's Avatar
 
Join Date: Feb 2005
Posts: 838
After a test encode with Blu-print
PaletteID 254 is a quirk in Scenarist

Number of dialog presentation segments is removed from elementary stream by mkvmerge
(from The Mummy 00012.m2ts eng textST)

Last edited by bigotti5; 27th January 2016 at 03:18.
bigotti5 is offline   Reply With Quote
Old 27th January 2016, 10:18   #82  |  Link
DVD
Registered User
 
DVD's Avatar
 
Join Date: Oct 2002
Posts: 72
Ah, perfect. This explains it. Still odd that mkvextract removes this.

Anyways, another question: I did some testing yesterday and found that the timestamps I decoded from the stream do not match with the movie. Do you have any guidance how the "dialog_start_time" needs to be interpreted. Currently, I devide the 5 byte number by 90 to get the amount of milliseconds. Unfortunately, this does not seem to work. Is the factor wrong or is there any sort of delay?
__________________

CU DVD
DVD is offline   Reply With Quote
Old 27th January 2016, 11:50   #83  |  Link
bigotti5
Spielberger
 
bigotti5's Avatar
 
Join Date: Feb 2005
Posts: 838
You have to remove muxing delay from PTS
In corresponding mpls you can find "in_time" - this is the muxing delay
Look for first "4D 32 54 53" (M2TS), ignore 3 bytes, next 4 bytes are "in_time". (Should be always from byteposition 0x52)
Divide by 45 und you have the value in ms.
In case of The Mummy e.g.
11.650


Common delays are
00:10:00.000 - Scenarist
00:00:11.650 - Blu-Print
00:00:02.000 - Panasonic
bigotti5 is offline   Reply With Quote
Old 31st January 2016, 02:55   #84  |  Link
DVD
Registered User
 
DVD's Avatar
 
Join Date: Oct 2002
Posts: 72
@ bigotti5: Thanks, this helps!

I added some code to parse all MPLS files from a Disc and list the in_time delays so they can be used to correct the offsets. I am almost done with my code. I need to add some small features/fixes, but for the most part it seems to work now. The ASS/SSA files it produces work quite nicely and they even use the correct formatting/position from the TextST subtitles now (taken from The Mummy Returns):

Original BD Image - Example 1
Original BD Image - Example 2
Original BD Image - Example 3


ASS representation in the MKV file - Example 1
ASS representation in the MKV file - Example 2
ASS representation in the MKV file - Example 3
__________________

CU DVD
DVD is offline   Reply With Quote
Old 1st February 2016, 18:24   #85  |  Link
DVD
Registered User
 
DVD's Avatar
 
Join Date: Oct 2002
Posts: 72
TextST Parser and Converter supporting SRT and ASS output

Hello,

I am now done with implementing a more complete version which also includes export to Advanced SubStation Alpha Subtitles (ASS) as well as simple SubRip Text (SRT) support. Although the feature set is far from complete, it worked quite well for my "The Mummy" and "The Mummy Returns" Blu-Rays. Timing and formating seem fine and on "The Mummy Returns" it even positions the subtitle on the top/bottom of the screen depending on its assigned screen position in the original TextST file. (For some screenshots of the result, see previous post)

I thought I share my code and some instructions how to use it so that somebody willing to use or even extend on it can give it a shot and does not need to start from scratch.

Here is how it works:
  1. Use MakeMKV to extract the video, audio and subtitle information into an MKV file.
  2. Use mkvextract (part of mkvtoolnix) with the MKV file created in the first step and the following commandline to demux the raw TextST data for all TextST stream IDs:

    Code:
    mkvextract tracks <MKV Source File> --fullraw <First ID>:<Filename ID 1>.<Extension> --fullraw <Second ID>:<Filename ID 2>.<Extension> ... --fullraw <Last ID>:<Filename ID n>.<Extension>
  3. Now the MPLS files (playlists) need to be analyzed to detect the muxing delay for the subtitle streams. The following command line will do so:

    Code:
    java -jar SubConverter.jar -mode=MPLS -input="/Users/DVD/Movie/MPLS" -verbose
    Result:

    Code:
    Blu-Ray TextST Parser/Converter - Version 0.50 alpha - by DVD
    
    Using directory '/Users/DVD/Movie/MPLS' with extension 'mpls'
    1 files files found!
    
    Start processing file '/Users/DVD/Movie/MPLS/00000.mpls'
    Num bytes read: 1864
    Start Time: 00:00:11.650
    End Time: 02:09:43.414
    Duration: 02:09:31.764
    Delay: -11650
  4. Now this delay can be used as input for the actual conversion, e.g. SRT:

    Code:
    java -jar SubConverter.jar -mode=TEXTST -input="/Users/DVD/Movie/" -extension=TextST -output=SRT -delay=-11650 [-verbose]
    Along with the following output the SRT files will be generated in the source folder.

    Code:
    Blu-Ray TextST Parser/Converter - Version 0.50 alpha - by DVD
    
    Using directory '/Users/DVD/Movie/' with extension 'TextST'
    9 file(s) files found!
    
    Start processing file '/Users/DVD/Movie/12.textST'
    Num bytes read: 138311
    Parsing successfull for '/Users/DVD/Movie/12.textST'
    Exporting to file '/Users/DVD/Movie/12.srt' using SRT format.
    Export complete!
    
    [...]
  5. If you want to use ASS output, the following command line should be used:

    Code:
    java -jar SubConverter.jar -mode=TEXTST -input="/Users/DVD/Movie" -extension=TextST -output=SSA/ASS -delay=-11650 -fonts="/Users/DVD/Movie/Fonts" -width=1920 -height=1080 [-verbose]
    This will also output all subtitles but as formatted ASS files instead of SRT.

    Code:
    Blu-Ray TextST Parser/Converter - Version 0.50 alpha - by DVD
    
    Using directory '/Users/DVD/Movie' with extension 'TextST'
    9 file(s) files found!
    
    Start processing file '/Users/DVD/Movie/12.textST'
    Num bytes read: 138311
    Parsing successfull for '/Users/DVD/Movie/12.textST'
    Checking for font directory ...
    Using directory '/Users/DVD/Movie/Fonts' with extension 'otf'
    1 file(s) files found!
    Exporting to file '/Users/DVD/Movie/12.ass' using SSA/ASS format.
    Export complete!
    
    [...]
    The additional parameters (as opposed to SRT output) work as follows:

    -fonts Identifies the folder that contains the Blu-Ray font files (BDMV/AUXDATA/*.otf). The fonts will not be included into the ASS file, but the tool will read the font name and put it into the result file. You can manually install them on your device or merge them into the final MKV file.

    -width x-resolution of the video material used in the ASS file for creating resizing and positioning information.

    -height y-resolution of the video material used in the ASS file for creating resizing and positioning information.

  6. The final ASS files are viewable in any text editor and can be modified to your own liking, e.g. font, size, color, etc . I for example increased the font size a little bit from 54 to 65.

    Code:
    [V4+ Styles]
    Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
    Style: Region_Style_0,Arial,65,&H00EBEBEB,&H00EBEBEB,&H3F101010,&HFF000000,0,0,0,0,100,100,0,0,1,2,0,2,1,1,142,0
    Style: Region_Style_1,Arial,65,&H00EBEBEB,&H00EBEBEB,&H3F101010,&HFF000000,0,0,0,0,100,100,0,0,1,2,0,8,1,1,141,0
    In sample above each style entry is derived from a region style in the source material. In this case a text box at the top of the screen and a text box at the bottom.

    Note: The -verbose flag prints a lot of additional information on the console. This can be used for debugging and analysis.

Please note that the code does not come with any form of warranty!

Again, special thanks to bigotti5 for providing his valuable input!
Attached Files
File Type: txt SubConverter v0.50 alpha.txt (51.0 KB, 34 views)
__________________

CU DVD

Last edited by DVD; 1st February 2016 at 18:35.
DVD is offline   Reply With Quote
Old 1st February 2016, 23:34   #86  |  Link
bigotti5
Spielberger
 
bigotti5's Avatar
 
Join Date: Feb 2005
Posts: 838
Attachment approval takes days so cant test your prog now.
I made a small BD to test.
Contains 3 StyleRegions and many inline styles.
This rar file contains BD folder and a tes file (number of dialog presentations removed).
bigotti5 is offline   Reply With Quote
Old 1st February 2016, 23:41   #87  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Not so long ago, a moderator suggested that fastest way to get an attachment approved was to 'report' your own post.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 2nd February 2016, 00:10   #88  |  Link
DVD
Registered User
 
DVD's Avatar
 
Join Date: Oct 2002
Posts: 72
Quote:
Originally Posted by bigotti5 View Post
Attachment approval takes days so cant test your prog now.
I made a small BD to test.
Contains 3 StyleRegions and many inline styles.
This rar file contains BD folder and a tes file (number of dialog presentations removed).
I must admit that I have not implemented any inline style conversion yet, although I think it can be added. I had only the mummy movies to test with and they do not use inline styles. As soon as I have another day to spare I will look into your file ... Of course you can also take my code and make additions to it!
__________________

CU DVD
DVD 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 08:01.


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