Log in

View Full Version : BDN XML without PNGs


edumj
16th June 2023, 19:04
Hi,

I'm authoring my first Blu-ray with Scenarist BD and I don't know how to make a BDN XML file to import .srt subtitles.

I need Text Subtitles (TextST) because my PlayList is made of 95 Clips and with PGS subtitles I would need to also split the subtitles file in 95 parts!

I've tried easySup but it always output BDN format in XML+PNGs (and also I would need to find a tool to convert 24 bits pngs to 8 bits and keep transparency).

I've tried Subtitle Edit but with the output format "Blu-ray TextST" it has to "write a PES packets" which doesn't import to Scenarist (it says ".textst it's not Supported").

Scenarist BD only imports .xml files (Import > BDN file) and now I'm trying to make a custom format with Subtitle Edit but I don't know the Sony BDN XML spec. It should be similiar to XML+PNGs but instead of <Graphic> tags with pngs info and location, it should be with text tags and subtitles, but I don't know the exact thing...

I've tried something like this (changing "Graphic" tag to "Text") but doesn't parse in Scenarist BD!:

<?xml version="1.0" encoding="UTF-8"?>
<BDN Version="0.93" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="BD-03-006-0093b BDN File Format.xsd">
<Description>
<Name Title="easySUP" Content=""/>
<Language Code="eng"/>
<Format VideoFormat="720p" FrameRate="50" DropFrame="false"/>
<Events LastEventOutTC="01:56:03:20" FirstEventInTC="00:30:02:33"
ContentInTC="00:00:00:00" ContentOutTC="01:56:04:00" NumberofEvents="1166" Type="Text"/>
</Description>
<Events>
<Event Forced="False" InTC="00:30:02.16" OutTC="00:30:06.06">
<Text>- Announcer: IT'S TIME AGAIN
FOR EVERYONE EVERYWHERE ALL AT</Text>
</Event>
</Events>
</BDN>

Any idea?

:thanks:

jpsdr
16th June 2023, 19:35
Are you sure you can import Text subtitles in Scenarist with BDN/XML ? And not just PNG with it ? I've never seen that in the few Scenarist doc i have, and the few i've understood about text subtitles on Blu-Ray it's that they are a pain in the ass !!!
Unfortunately my advice would be to use PGS. Also, try to ask in the "Advanced Authoring" part of the forum.

cubicibo
16th June 2023, 20:08
There used to be an open source program named srt2bdn that did exactly what you wanted but it has long vanished from the Internet.

If you can give me the TextST file output by SubtitleEdit, I could maybe modify ScenariStream (https://forum.doom9.org/showthread.php?t=184889) to convert .textst file to TES+MUI which Scenarist supports.
Since TextST does not use DTS+PTS, but PTSin+PTSout, I would need a sample TES+MUI file. You could generate one with Scenarist BD subtitle editor with one single caption and the in & out timecodes of the subtitle. It would help me to figure it out.

edumj
16th June 2023, 21:08
Yes, I just found that srt2bdn mentioned in a web, but the forum doesn't exist anymore!

There used to be an open source program named srt2bdn that did exactly what you wanted but it has long vanished from the Internet.

If you can give me the TextST file output by SubtitleEdit, I could maybe modify ScenariStream (https://forum.doom9.org/showthread.php?t=184889) to convert .textst file to TES+MUI which Scenarist supports.
Since TextST does not use DTS+PTS, but PTSin+PTSout, I would need a sample TES+MUI file. You could generate one with Scenarist BD subtitle editor with one single caption and the in & out timecodes of the subtitle. It would help me to figure it out.

Here you are the .textst from Subtitle Editor and .tes+.mui from enconding a single subtitle from Scenarist BD.

Thanks!

cubicibo
16th June 2023, 21:14
Attachment needs weeks for approval, share it with dropbox or something.
Also I would need the timecode values you set for the TES+MUI sample (and chosen fps for project) so I can verify my decoding.

edumj
16th June 2023, 21:19
It should be possible, because if I have to do one subtitle at a time adding DialogPresentation's one by one... There are many thing missing in the manuals, like how to create a Palette... but it says:

"For TextSTs, Scenarist BD automatically parses the (.xml) file, imports the fonts referenced in the BDN file, creates the TextST data structure, and encodes the TextST"

So, do I need to put the font name in the .xml!?

By the way, I coudn't find a .otf font compatible with Scenarist! In the end I just renamed a .ttf to .otf and seems to work! Although I still get no outlines...

Are you sure you can import Text subtitles in Scenarist with BDN/XML ? And not just PNG with it ? I've never seen that in the few Scenarist doc i have, and the few i've understood about text subtitles on Blu-Ray it's that they are a pain in the ass !!!
Unfortunately my advice would be to use PGS. Also, try to ask in the "Advanced Authoring" part of the forum.

edumj
16th June 2023, 21:25
Attachment needs weeks for approval, share it with dropbox or something.
Also I would need the timecode values you set for the TES+MUI sample (and chosen fps for project) so I can verify my decoding.

Ok, here it is.

https://www.dropbox.com/s/je4nt3c3ijwn9nx/Subtitle%20Edit%20%28.TextST%29%2BScenarist%20BD%20%28.tes%2B.mui%29.zip?dl=0

Timecode Start is 00:00:00:00 and End is 00:00:20:00
at 50 fps

cubicibo
16th June 2023, 21:42
Null timecode is the worst, because it does not let one distinguish padding from actual zero value useful in stream.
Anyway, I will spend some time and see if I can figure it out. If not, sorry in advance.

edumj
16th June 2023, 21:51
Null timecode is the worst, because it does not let one distinguish padding from actual zero value useful in stream.
Anyway, I will spend some time and see if I can figure it out. If not, sorry in advance.

Ok, thanks! Tell me if I have to change the start time or something.

cubicibo
17th June 2023, 08:17
Some notes while I keep investigating:
- SubtileEdit does not insert "expected" TextST segments headers but uses M2TS'. Probably because no one has ever seen a real .TextST file. Not a blocking problem but it makes file processing more annoying.
- MUI object type is 0x04, unlike PGS or IGS that are both under type 0x03.
- MUI file does not appear to contain any timestamps (everything is zero). But I suspect this is because the start time of the subtitle is set to zero.
- TextStyle segment has a length offset of 5 between MUI and TES, while all other segments (PGS, IGS, 0x82 TextDialog) have a difference of 3. Not sure why but it does not seem to matter.
- Timestamps of TextDialog are 5 bytes long and have a 54000000 ticks offset. So PTSin is 54000000 ticks (600s) (00:00:00:00) and PTSout is 55800000 (620s) (00:00:20:00). As such, SubtitleEdit timestamps must have + 54000000 ticks added in the conversion process (note for myself, really.)

Can you generate new TES+MUI assets?
- The first subtitle has a first text style and it should appear at something like 00:00:10:22-00:00:12:19
- The second subtitle has a DIFFERENT text style and it should appear at like 00:02:40:01-00:02:43:04
I need this because I suspect Scenarist inserts timestamps in MUI for TextStyle segments only (but I can't know if first TextStyle segment is at PTS 0 in MUI format).

edumj
17th June 2023, 15:25
Ok, I changed the style of the second subtitle to Italic.

https://www.dropbox.com/s/07a4ng6r1gsmuk3/Encode.zip?dl=0

I hope it helps.

edumj
17th June 2023, 15:44
Hi, after hours of testing, trial and error, trying to fix errors showed in Scenarist BD and figuring out the location of needed Elements and Attributes, I ended with this .xml, although I donīt know the meaning of CharacterCode (must be 1 to 7) or the right Palette colors...:

<?xml version="1.0" encoding="UTF-8"?>
<BDN Version="0.93" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="BD-03-006-0093b BDN File Format.xsd">
<Description>
<Name Title="easySUP" Content=""/>
<Language Code="eng"/>
<Format VideoFormat="720p" FrameRate="50" DropFrame="false"/>
<Events LastEventOutTC="00:00:06:00" FirstEventInTC="00:00:02:00"
ContentInTC="00:00:00:00" ContentOutTC="01:56:04:00" NumberofEvents="2" Type="Text" CharacterCode="1"/>
</Description>
<Palettes>
<Palette PaletteID="1" ColorMode="RGB">
<Palette Entry="1" Index="1" Y_R="0" Cb_G="0" Cr_B="0" T_A="0"/>
<Palette Entry="2" Index="2" Y_R="255" Cb_G="255" Cr_B="255" T_A="0"/>
</Palette>
</Palettes>
<Fonts>
<Font FontID="0" FontFile="0000.otf">
</Font>
</Fonts>
<TextRegions>
<RegionCount RegionStyleID="0">
<RegionStyle RegionHorizontalPosition="0" RegionVerticalPosition="0" RegionWidth="1000" RegionHeight="150" RegionPaletteID="1" BackgroundPaletteEntryID="1"/>
<TextBox TextBoxHorizontalPosition="0" TextBoxVerticalPosition="0" TextBoxWidth="500" TextBoxHeight="150" TextFlow="1" TextHorizontalAlignment="2" TextVerticalAlignment="1"/>
<LineSpace LineSpace="24"/>
<FontInfo FontID="0" FontSize="24" FontStyle="1" FontPaletteEntryID="1" FontOutlinePaletteEntryID="2" FontOutlineThickness="3"/>
</RegionCount>
</TextRegions>
<Events>
<Event Forced="False" InTC="00:00:02:00" OutTC="00:00:06:00">
<Text RegionStyleID="0">TEXTO</Text>
</Event>
</Events>
</BDN>

But now I get this error:
Error : Length of Text element value is an odd number.

And if I add one character of text it just shows this error:
Error : Parse Error
<Events> <Event>#1 <Text>


I donīt know what more to try!

:scared:

cubicibo
17th June 2023, 20:05
Does this work? https://0x0.st/HTMX.7z

This should be the proper conversion of the original file. If there's encoding errors then SubtitleEdit may not encode TextST streams properly (I already spotted one error, SubtitleEdit includes the dialog count in TextStyle header length, which Scenarist does not, hence why the MUI file has +5 bytes offset rather than the common +3).

edumj
18th June 2023, 01:42
Hi, it gives this errors:

Error : Out of range, Region must exist within a Video area.
Error : TextST Decode error. H:\OSCARS 2023 Blu-ray\Scenarist BD\Oscars\OSCARS 95 by Edumj\00.00.0002\Encode\test.tes offset=0x0 (first byte of invalid segment).
Error : FilePath : H:\OSCARS 2023 Blu-ray\Scenarist BD\Oscars\OSCARS 95 by Edumj\00.00.0002\Encode\test.tes,
Decode failed.

Maybe someone who has Lemony Pro could try to export any subtitles to BDN without pngs, just to see the right .xml format?
I saw in the documentation it can export to "blu-ray images and blu-ray text", but I can't make the program work.

cubicibo
18th June 2023, 09:45
If your video format is 720p (going by the BDN example), then the Oscars.textst file will not work because the file is encoded for 1080p.

If it is really 1080p, then I see three possible issue with how SubtitleEdit generates the 0x81 segment. Try each of these examples. If none work, I give up.
https://0x0.st/HTQI.7z (the MUI file is identical for all TES).

- override: literally re-use 0x81 position data from another commercial textst.
- zerotbv: set relative textbox vertical position to zero.
- shift_one: subtract one to vertical position to avoid height+v_pos == video_height

edumj
18th June 2023, 16:39
It keeps saying:

Error : Out of range, TextBox must exist within a Region area.
Error : TextST Decode error. H:\OSCARS 2023 Blu-ray\Scenarist BD\Oscars\OSCARS 95 by Edumj\00.00.0002\Encode\test_override.tes offset=0x0 (first byte of invalid segment).
Error : FilePath : H:\OSCARS 2023 Blu-ray\Scenarist BD\Oscars\OSCARS 95 by Edumj\00.00.0002\Encode\test_override.tes,
Decode failed.
Error : Out of range, TextBox must exist within a Region area.
Error : TextST Decode error. H:\OSCARS 2023 Blu-ray\Scenarist BD\Oscars\OSCARS 95 by Edumj\00.00.0002\Encode\test_shift_one.tes offset=0x0 (first byte of invalid segment).
Error : FilePath : H:\OSCARS 2023 Blu-ray\Scenarist BD\Oscars\OSCARS 95 by Edumj\00.00.0002\Encode\test_shift_one.tes,
Decode failed.
Error : Out of range, TextBox must exist within a Region area.
Error : TextST Decode error. H:\OSCARS 2023 Blu-ray\Scenarist BD\Oscars\OSCARS 95 by Edumj\00.00.0002\Encode\test_zerotbv.tes offset=0x0 (first byte of invalid segment).
Error : FilePath : H:\OSCARS 2023 Blu-ray\Scenarist BD\Oscars\OSCARS 95 by Edumj\00.00.0002\Encode\test_zerotbv.tes,
Decode failed.


Even changing importing options in Scenarist to 1080p 25fps, so it may be what you say: Subtitle Edit exports at 1080p, because in exporting options it says Width=1720, Height=200, Textbox width=1719, Textbox height=130, ...

So, if I make a pair of subtitles in Scenarist BD, but with the same exact parameters of "Region styles" (region and texbox size and position, font style, ...) and "Palettes"? that Subtitle Edit exports by default, it should be easier to compare the .textst with the .tes??

Also, are you sure the .mui is the same for all 3 files? I think the name of the .tes is inside the .mui (I opened "TextST#1.tes.mui" and "TextST#1+.tes.mui" in Notepad++ and the only think I understood is that I saw the "+" sign inside).

cubicibo
18th June 2023, 16:43
Yes, MUI file is just a segment index/reference. If the count of text object does not change, MUI remain the same.

Ok one last idea:
Create TES+MUI in Scenarist with the longest double line subtitle you have, so we are ensured all subtitles fit on screen. Export to TES+MUI. Then, replace 0x81 packet in desired TES file (I can guide you how to do that).

Here's with the 720p samples you provided: https://0x0.st/HT_B.7z (albeit text box parameter may not be wide enough for long captions.)

edumj
18th June 2023, 22:02
Ok,

for now I'm trying to copy the "Region style" configuration from Subtitle Edit and there is someting wrong with default "Text box vertical pos" of "880" because Scenarist says this:

Error : Property value is not valid.. [Out of range, some values of TextBoxStruct are out of range.]


So, maybe that's the error "Out of range, TextBox must exist within a Region area." because the textbox must be at 0,0 inside the Region

edumj
18th June 2023, 22:38
Here's with the 720p samples you provided: https://0x0.st/HT_B.7z (albeit text box parameter may not be wide enough for long captions.)

It says, importing like 720p 50fps:

Error : The interval from Start Time(previous Dialog Presentation) to Start Time is too close. minimum interval=00:00:01:05


or, with 1080p 25 fps:

Error : The interval from Start Time(previous Dialog Presentation) to Start Time is too close. minimum interval=00:00:01:10

cubicibo
18th June 2023, 22:47
TextST has bad timing requirements. There are mentions that srt2bdn was also generating bdn that did not pass Scenarist TextST conversion due to delay between subs.

Your only solution is to space out each subtitle and guarantee a minimum delay of 00:00:01:10 between each event in 1080p.
But hey, we are very close to a solution! I will let you regenerate textst file. You can then convert it to TES+MUI using latest v0.0.3 ScenariStream python utility. Then you (or I) just need to copy 0x81 segment like done before.

edumj
18th June 2023, 22:55
Well,

https://www.dropbox.com/s/hm560g7u1aw153p/Subs.rar?dl=0

here it is the .textst and .tes+.mui, with only 2 subtitules and the same configurations (Region Style, Text Style, 1080p 25fps, ... even I donīt know the resolution Subtitle Edit exports to!)

I also include the trimmed .srt file, the .xml from exporting it to BDN XML+PNG (even I dont't know why it says VideoFormat="2048x858"!?) and a screen capture with both Scenarist and Subtitle Edit Region Style configuration.

edumj
19th June 2023, 00:36
TextST has bad timing requirements. There are mentions that srt2bdn was also generating bdn that did not pass Scenarist TextST conversion due to delay between subs.

Your only solution is to space out each subtitle and guarantee a minimum delay of 00:00:01:10 between each event in 1080p.
But hey, we are very close to a solution! I will let you regenerate textst file. You can then convert it to TES+MUI using latest v0.0.3 ScenariStream python utility. Then you (or I) just need to copy 0x81 segment like done before.

Well, it still says that about first byte...:

Error : The interval from Start Time(previous Dialog Presentation) to Start Time is too close. minimum interval=00:00:01:10
Error : TextST Decode error. H:\Scenarist BD\Subtitulos\HT_B\test_tesmui\test.tes offset=0x230 (first byte of invalid segment).
Error : FilePath : H:\Scenarist BD\Subtitulos\HT_B\test_tesmui\test.tes,
Decode failed.

I still need to learn how to use Python in Windows... Dou you have an executable of your program?

cubicibo
19th June 2023, 18:07
Let's not overcomplicate things!

Error : The interval from Start Time(previous Dialog Presentation) to Start Time is too close. minimum interval=00:00:01:10
Error : TextST Decode error. H:\Scenarist BD\Subtitulos\HT_B\test_tesmui\test.tes offset=0x230 (first byte of invalid segment).
Error : FilePath : H:\Scenarist BD\Subtitulos\HT_B\test_tesmui\test.tes,
Means that your file imports properly (error offset is no more 0x0 but in the middle of subs data!!) but the subtitle at 0x230 in TES file is too close to the previous subtitle in PTSin difference.
What you must do is take the SRT and ensure that all the ENTRY time of all subtitles are separatef by 00:00:01:10 or more. Then you can export to TextST and I will tell you how to modify the 0x81 data for Scenarist to be happy.

Here is a practical example:
Legal:
00:01:01:00 > 00:01:05:08: Subtitle 1
00:01:05:10 > 00:01:06:19: subtitle 2
Here, sub1 and sub2 PTSin are separated by >4 seconds. PTSin2-PTSend1 is very small but it does NOT matter.

Illegal:
00:01:01:05 > 00:01:01:08: Subtitle 1
00:01:01:16 > 00:01:06:19: subtitle 2

PTSin2-PTSin1 = 00:01:01:16-00:01:01:05 = 11 frames << 00:00:01:10, this is illegal for TextST!

edumj
19th June 2023, 18:54
So, and easy way to find illegal subs should be the duration of every subtitle? If it's less than 1 second and 100 or 400 ms they are too close.
I think Subtitle Workshop can fix that.

So, in the last zip the subtitles were ok? Or dou you want the full srt with fixed durations? Even it's not the full .srt, I still have to join 2 more parts...

cubicibo
19th June 2023, 19:00
The DELAY between subtitles appearance!
NOT the duration of the subtitle themselves or the delay between two (long duration) subtitles.

Subs1 and subs2 must not appear one after the other in short time.
In TextST, ~1s is needed to decode a subtitle. Decoding of next subtitle starts AFTER the last subtitle appears on screen.


I cannot check it now. I will tell you this evening or tomorrow.

cubicibo
19th June 2023, 21:40
This photo explains what you must ensure: https://i.imgur.com/NnNEngV.jpg

Here are the subtitles that needs to be corrected: https://textup.fr/714103Oo
"delta" = PTSin(current)-PTSin(previous) = D(CA)
This is the value that you must ensure is larger than 00:00:01:10.
-------
Convert to TES+MUI:
- Install python3 from Windows Store
- Download ScenariStream
- Open cmd.exe, cd to ScenariStream directory:
python3 client.py -s subs.textst -o subs.tes --textst
=> This will create subs.tes and subs.mui from subs.textst input.

Replace 0x81 segment:
- Use HxD or Hex Fiend (hex editor)
- In TES file, copy good 0x81 segment from Scenarist BD TES to SubtitleEdit TES. Replace all data up to '048E82' (not included). The length can change. You must NOT overwrite '048E82', this is all that matters!
- In MUI file, copy everything up to first '82' byte (not included). The length must not change.

- This photo shows you how many bytes to select in Scenarist BD TES file: https://i.imgur.com/28tfzYi.png. It can be different from 0x46, read the value and count in hex. You can verify that your count is correct when 0x82 is +3 bytes on the right.
- The highlighted section show what to replace in subs.tes. The content may be longer or shorter. You must not overwrite 048E82, this is all that matters.
https://i.imgur.com/tHaJYrF.png
- The highlighted section in subs.mui file must has constant length before and after change. Only a single byte should change (segment length).

edumj
19th June 2023, 22:16
The DELAY between subtitles appearance!
NOT the duration of the subtitle themselves or the delay between two (long duration) subtitles.

Subs1 and subs2 must not appear one after the other in short time.
In TextST, ~1s is needed to decode a subtitle. Decoding of next subtitle starts AFTER the last subtitle appears on screen.


I cannot check it now. I will tell you this evening or tomorrow.

Yes, I know what you mean, one subtitle must appear more than 1 second after the other has appeared.

But the if the subtitles donīt overlap (as usual), the second subtitle should appear after the duration of first subtitle, plus the gap between them (PTSin2-PTSend1), so this is easier to find in Subtitle Workshop than looking at every subtitle start time and try to calculate the difference...

In Subtitle Workshop I can see the subs "Duration" in a glance or better find the shortest duration, for example.

edumj
20th June 2023, 01:04
This photo explains what you must ensure: https://i.imgur.com/NnNEngV.jpg

Here are the subtitles that needs to be corrected: https://textup.fr/714103Oo
"delta" = PTSin(current)-PTSin(previous) = D(CA)
This is the value that you must ensure is larger than 00:00:01:10.
-------
Convert to TES+MUI:
- Install python3 from Windows Store
- Download ScenariStream
- Open cmd.exe, cd to ScenariStream directory:
python3 client.py -s subs.textst -o subs.tes --textst
=> This will create subs.tes and subs.mui from subs.textst input.

Replace 0x81 segment:
- Use HxD or Hex Fiend (hex editor)
- In TES file, copy good 0x81 segment from Scenarist BD TES to SubtitleEdit TES. Replace all data up to '048E82' (not included). The length can change. You must NOT overwrite '048E82', this is all that matters!
- In MUI file, copy everything up to first '82' byte (not included). The length must not change.

- This photo shows you how many bytes to select in Scenarist BD TES file: https://i.imgur.com/28tfzYi.png. It can be different from 0x46, read the value and count in hex. You can verify that your count is correct when 0x82 is +3 bytes on the right.
- The highlighted section show what to replace in subs.tes. The content may be longer or shorter. You must not overwrite 048E82, this is all that matters.
https://i.imgur.com/tHaJYrF.png
- The highlighted section in subs.mui file must has constant length before and after change. Only a single byte should change (segment length).

I fixed the subs, and installed Pyhton 3.8 (the last for Windows 7) but I get this error:

Traceback (most recent call last):
File "client.py", line 27, in <module>
from scenaristream import EsMuiStream
File "H:\Scenarist BD\Subtitulos\ScenariStream-main\scenaristream\__init__.py"
, line 61, in <module>
class StreamFile:
File "H:\Scenarist BD\Subtitulos\ScenariStream-main\scenaristream\__init__.py"
, line 131, in StreamFile
def segments(self) -> list[bytes]:
TypeError: 'type' object is not subscriptable
Presione una tecla para continuar . . .

:scared:

cubicibo
20th June 2023, 06:40
It needs latest Python3.9 or more. You don't have any linux or more up to date Windows to do the conversion…? Send the file, then.

edumj
21st June 2023, 01:31
Hi,

at last I think I have fixed everyting in both subtitles (I have 2 playlists), imported them in SubtitleEdit, change settings for 720p, and export to TextST, so they should be Ok in Scenarist BD.

By the way, I read something in your program about no more than 5 hours?? One of the PlayLists is almost 6 hours...

Right now I can't test it in another computer, if you can convert it, here it is:

https://www.dropbox.com/s/ebdw6edvfh6541s/Subs.zip?dl=0

:thanks:

cubicibo
21st June 2023, 20:38
https://0x0.st/HT0f.7z

The 5 hour limit only applies to PES and IES streams (SUP-PGS, MNU-IGS).
If you want to be helpful in turn, I would welcome a PG stream (PES) with one subtitle every hour, up to 15 hour.
And one TextST stream that uses palette update functionality (if you can generate such thing in Scenarist).

edumj
21st June 2023, 22:09
Still no luck...

If I import them as 720p 50 fps (the supposed format):

Error : Out of range, Region must exist within a Video area.
Error : TextST Decode error. H:\Scenarist BD\Subtitulos\SubtitleEdit-3.6.13\Moviestar.tes offset=0x0 (first byte of invalid segment).
Error : FilePath : H:\Scenarist BD\Subtitulos\SubtitleEdit-3.6.13\Moviestar.tes,
Decode failed.

May be the Region size it's still to big?? I copied the same parameters that work in Scenarist!



And, if I try 1080p at 25 fps, just to try:

Error : The interval from Start Time(previous Dialog Presentation) to Start Time is too close. minimum interval=00:00:02:00
Error : TextST Decode error. H:\Scenarist BD\Subtitulos\SubtitleEdit-3.6.13\Moviestar.tes offset=0x235 (first byte of invalid segment).
Error : FilePath : H:\Scenarist BD\Subtitulos\SubtitleEdit-3.6.13\Moviestar.tes,
Decode failed.

I think I read something about subtitle size and that interval... the bigger the subtitle more time has to pass between them!?


What is PES?

edumj
21st June 2023, 22:19
Oh, at last I could try Lemony Pro and the supposed BDN XML for text subtitles is something like this:

<?xml version="1.0" encoding="UTF-8"?>
<BDN Version="1.00" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="BD-03-006-0092b BDN File Format.xsd">
<Description>
<Name Title="Title" />
<Language Code="spa" />
<Format VideoFormat="720p" FrameRate="50" DropFrame="false" />
<Events NumberofEvents="1" Type="Text" CharacterCode="1" />
</Description>
<Palettes>
<Palette PaletteID="0" ColorMode="RGB">
<Entry Index="0" Y_R="0" Cb_G="0" Cr_B="255" T_A="0" />
<Entry Index="1" Y_R="255" Cb_G="255" Cr_B="255" T_A="255" />
<Entry Index="2" Y_R="0" Cb_G="0" Cr_B="0" T_A="255" />
<Entry Index="3" Y_R="0" Cb_G="0" Cr_B="0" T_A="128" />
<Entry Index="4" Y_R="255" Cb_G="255" Cr_B="255" T_A="255" />
<Entry Index="5" Y_R="255" Cb_G="0" Cr_B="0" T_A="255" />
<Entry Index="6" Y_R="255" Cb_G="255" Cr_B="0" T_A="255" />
<Entry Index="7" Y_R="0" Cb_G="255" Cr_B="0" T_A="255" />
<Entry Index="8" Y_R="0" Cb_G="255" Cr_B="255" T_A="255" />
<Entry Index="9" Y_R="0" Cb_G="0" Cr_B="255" T_A="255" />
<Entry Index="10" Y_R="255" Cb_G="0" Cr_B="255" T_A="255" />
<Entry Index="11" Y_R="0" Cb_G="0" Cr_B="0" T_A="255" />
</Palette>
</Palettes>
<Fonts>
<Font FontID="0" FontFile="0000.otf" />
</Fonts>
<TextRegions>
<Region RegionStyleID="0">
<RegionStyle RegionHorizontalPosition="128" RegionVerticalPosition="72" RegionWidth="1024" RegionHeight="576" RegionPaletteID="0" BackgroundPaletteEntryID="0" />
<TextBox TextBoxHorizontalPosition="10" TextBoxVerticalPosition="10" TextBoxWidth="1004" TextBoxHeight="556" TextFlow="1" TextHorizontalAlignment="2" TextVerticalAlignment="3" />
<LineSpace LineSpace="64" />
<FontInfo FontID="0" FontStyle="0x04" FontSize="48" FontPaletteEntryID="1" FontOutlinePaletteEntryID="2" FontOutlineThickness="0x02" />
</Region>
</TextRegions>
<Events>
<Event InTC="00:00:00:00" OutTC="00:00:03:00">
<Text RegionStyleID="0" ReferenceText="Hola, qué tal? | Cómo te va?">00241B010F486F6C612C207175C3A92074616C3F1B0A001B010C43C3B36D6F2074652076613F</Text>
</Event>
</Events>
</BDN>

So, every subtitle must be encoded in some strange format!? And the "ReferenceText" is just informative...?

Anyway, it doesn't work either in Scernarist BD!:

Error : There is no Event element.

But it is!

cubicibo
21st June 2023, 22:42
"lol". No one has used TextST for year so the feature could be totally broken in either Lemony Pro or Scenarist.

Anyway, I could re-use yet another header for 720p but if you have timing issue in 1080p file, it will also have timing issue in 720p file. TextST is shit, hence why it has been abandonned by all majors but also by the format (TextST is not available on 4K BD).

Here it is: https://0x0.st/HTGP.7z
It will likely not work, but that should give you enough data to do the work yourself from now on. Good luck, I did my best.

Still no luck (...)
I literally took your files and used your header. So the subtitles lines are now probably too long and don't fit on the defined region.


I think I read something about subtitle size and that interval... the bigger the subtitle more time has to pass between them!?

Yes, like PGS (=PES). But TextST is much more complex and slow because the player has to render subtitles from fonts, while PG it is just decoding and displaying images.

cubicibo
22nd June 2023, 16:18
Try this with Scenarist:
https://forum.doom9.org/showthread.php?p=1399988#post1399988

If you have more Lemony Pro examples it could be helpful to write a new srt2bdn, by the way.

'00' <- unknown, maybe region ID.
'24' <- length of upcoming data (number of bytes, so total length - 2)
'1B 01 0F' <- Text data of length 0x0F
[UTF-8 text of this line]
'1B 0A 00' <- New line
'1B 01 0C' <- Text data of length 0x0C
[UTF-8 text of this line]

Easy to encode. But I cannot guarantee any timing because the decoding speed is not given in any patent. It is likely only available in the BD specs.

edumj
2nd July 2023, 21:06
Hi, at last I made it! :D

I loaded the srt in Aegisub, saved as .ass, opened it in Lemony Pro (with the import option), and Quick exported as "Sony BDN script Blu-ray v 1.00 Text" and you have the .xml correctly formatted and without PNGs, just text subtitles!

Although you have to make some changes to the xml (like change the extension of the font from .ttf to .oft) and adjust size and position of Region and Textbox.

But then there was another problem, the subtitles starts at the begining of the video (00:00:00:00) even if the first subtitle starts at min 30! So, they are out of sync! But I fixed it adding another "empty" subtitle at 00:00:00:02 (because it doesn't work at 00:00:00:00). It's not empty but with another style with transparent color.

I tested it in Scenarist QC and it crashed with some fonts (MS Sans Serif), but works Ok with others (like Arial) and the Outline doesn't show!, but when burned in disc and tested in PS3 and a LG Player it's seems to work ok!



Here it is: https://0x0.st/HTGP.7z
It will likely not work, but that should give you enough data to do the work yourself from now on. Good luck, I did my best.




Thanks, I'll try it but now the link doesn't work. Oh, and I donīt know if the .textst by Subtitle Edit is correct (appart from the FPS and size) because when I open it in Lemony Pro it seems to detect the format (Scantitling 890) but there are some strange characters...

edumj
2nd July 2023, 21:24
I can send you the final .xmls if you want them. I had to sepparate more subtitles, some 2 seconds or more. It seems that it has to do with CPS (characters per scecond?)

Try this with Scenarist:
https://forum.doom9.org/showthread.php?p=1399988#post1399988

If you have more Lemony Pro examples it could be helpful to write a new srt2bdn, by the way.

'00' <- unknown, maybe region ID.
'24' <- length of upcoming data (number of bytes, so total length - 2)
'1B 01 0F' <- Text data of length 0x0F
[UTF-8 text of this line]
'1B 0A 00' <- New line
'1B 01 0C' <- Text data of length 0x0C
[UTF-8 text of this line]

Easy to encode. But I cannot guarantee any timing because the decoding speed is not given in any patent. It is likely only available in the BD specs.

cubicibo
3rd July 2023, 09:43
Congrats. Sorry that I could not help more but working directly with raw TextST is too painful. It is why I worked a bit to create a new srt2bdn (text BDN), maybe I will finish it and release it. In the text BDN, you can then easily edit the text box position, size and so on to manage to import in Scenarist. Your sample would be helpful to me.

Also, seems like you need to complain to Scenarist LLC with your issues about timestamps. I bet they haven't tested their TextST stuff for years, as one uses it.

Scantitling 890 is different from TextST, so Lemony Pro will not parse the file correctly.

edumj
9th July 2023, 04:34
Ok,

sorry for the delay, here it is!:
https://www.dropbox.com/s/ebdw6edvfh6541s/Subs.zip?dl=0

Hope this can help.