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 6th May 2007, 07:33   #21  |  Link
jokin
Dwight Schrute's homeboy
 
Join Date: Jan 2007
Location: The Office
Posts: 136
ok now we can extract is there any way to put them on a video via avs?
__________________
jokin
jokin is offline   Reply With Quote
Old 6th May 2007, 12:06   #22  |  Link
Pelican9
Coder
 
Pelican9's Avatar
 
Join Date: Jan 2007
Location: Around the World
Posts: 697
Quote:
Originally Posted by drmpeg View Post
Here's an update to xport that demuxes the subtitle (Presentation Graphics) stream.

http://www.w6rz.net/xportpgs.zip

An extra parameter has been added to select the subtitle stream.

xport -h movie.m2ts 1 1 1 1

Output filename is bits0001.pgs and the -u option dumps the PTS.

Ron
You are very fast!
Thanks!

The -h worked well and create a huge pgs (43MB).
How does the -u option work?

Code:
Transport Sync Error, skipped 4 bytes, at 3218297
Transport Sync Error, skipped 4 bytes, at 3218298
Transport Sync Error, skipped 4 bytes, at 3218299
Transport Sync Error, skipped 4 bytes, at 3218300
Transport Sync Error, skipped 4 bytes, at 3218301
Transport Sync Error, skipped 4 bytes, at 3218302
Transport Sync Error, skipped 4 bytes, at 3218303
Transport Sync Error, skipped 4 bytes, at 3218304
Transport Sync Error, skipped 4 bytes, at 3218305
Transport Sync Error, skipped 4 bytes, at 3218306
Transport Sync Error, skipped 4 bytes, at 3218307
Is it possible to insert the PTS information to the subtitle stream and write a (semi) compatible .sup file?
The .sup file contains 10 extra byte before every subtitle
'SP',PTS(4bytes),0x00000000

Edit:
We can create a new file format for BD subtitles. We can use other two letters instead of 'SP' (for example 'BD' or something), and the 4 bytes long PTS value, and the subtitle segment data.

Last edited by Pelican9; 6th May 2007 at 14:03.
Pelican9 is offline   Reply With Quote
Old 6th May 2007, 12:23   #23  |  Link
Pelican9
Coder
 
Pelican9's Avatar
 
Join Date: Jan 2007
Location: Around the World
Posts: 697
Quote:
Originally Posted by Rectal Prolapse View Post
BTW Pelican9, you implied that you already knew the format - is that true? If dmz01 can write a subtitle extractor then he must know the format already?
Yes.
No.

Quote:
Originally Posted by Rectal Prolapse View Post
Is there a reason why this information isn't more widely known?
Yes. This information is confidental.
Pelican9 is offline   Reply With Quote
Old 6th May 2007, 12:39   #24  |  Link
drmpeg
Registered User
 
Join Date: Jan 2003
Location: Silicon Valley
Posts: 455
Quote:
Originally Posted by Pelican9 View Post
You are very fast!
Thanks!

The -h worked well and create a huge pgs (43MB).
How does the -u option work?

Code:
Transport Sync Error, skipped 4 bytes, at 3218297
Transport Sync Error, skipped 4 bytes, at 3218298
Transport Sync Error, skipped 4 bytes, at 3218299
Transport Sync Error, skipped 4 bytes, at 3218300
Transport Sync Error, skipped 4 bytes, at 3218301
Transport Sync Error, skipped 4 bytes, at 3218302
Transport Sync Error, skipped 4 bytes, at 3218303
Transport Sync Error, skipped 4 bytes, at 3218304
Transport Sync Error, skipped 4 bytes, at 3218305
Transport Sync Error, skipped 4 bytes, at 3218306
Transport Sync Error, skipped 4 bytes, at 3218307
Is it possible to insert the PTS information to the subtitle stream and write a (semi) compatible .sup file?
The .sup file contains 10 extra byte before every subtitle
'SP',PTS(4bytes),0x00000000
Try:

xport -hus movie.m2ts 1 1 1 1

Ron
__________________
HD MPEG-2 Test Patterns http://www.w6rz.net
drmpeg is offline   Reply With Quote
Old 6th May 2007, 12:43   #25  |  Link
Pelican9
Coder
 
Pelican9's Avatar
 
Join Date: Jan 2007
Location: Around the World
Posts: 697
Quote:
Originally Posted by drmpeg View Post
Try:

xport -hus movie.m2ts 1 1 1 1

Ron
I've tried, but nothing changed in the file.

Last edited by Pelican9; 6th May 2007 at 13:00.
Pelican9 is offline   Reply With Quote
Old 6th May 2007, 13:52   #26  |  Link
drmpeg
Registered User
 
Join Date: Jan 2003
Location: Silicon Valley
Posts: 455
Quote:
Originally Posted by Pelican9 View Post
I've tried, but nothing changed in the file.
I meant just to get rid of the error messages and dump the PTS. I'll add the PTS header tomorrow (left coast time).

Ron
__________________
HD MPEG-2 Test Patterns http://www.w6rz.net
drmpeg is offline   Reply With Quote
Old 6th May 2007, 14:08   #27  |  Link
Pelican9
Coder
 
Pelican9's Avatar
 
Join Date: Jan 2007
Location: Around the World
Posts: 697
Quote:
Originally Posted by drmpeg View Post
I meant just to get rid of the error messages and dump the PTS. I'll add the PTS header tomorrow (left coast time).

Ron
Great! Thanks again.

But I've thought about the header, and it would be better to use another two letters instead of 'SP', because the structure is quite different and it would be easier to program.
Pelican9 is offline   Reply With Quote
Old 6th May 2007, 15:09   #28  |  Link
dmz01
Registered User
 
Join Date: Feb 2007
Posts: 213
Quote:
Originally Posted by Rectal Prolapse View Post
If dmz01 can write a subtitle extractor then he must know the format already?
Quote:
Originally Posted by Pelican9 View Post
No.
Pelican9 is correct. I don't know the format. You do not need to know a specific format information just to extract it from a well known container.
dmz01 is offline   Reply With Quote
Old 6th May 2007, 18:51   #29  |  Link
Rectal Prolapse
Registered User
 
Join Date: Mar 2005
Posts: 433
Thanks drmpeg!
Rectal Prolapse is offline   Reply With Quote
Old 6th May 2007, 23:47   #30  |  Link
Pelican9
Coder
 
Pelican9's Avatar
 
Join Date: Jan 2007
Location: Around the World
Posts: 697
SUPread 0.4 is ready to read BD subtitles...

Don't try to download, it's not available yet. I'm waiting for drmpeg's new xport version with PTS info.

Last edited by Pelican9; 6th May 2007 at 23:54.
Pelican9 is offline   Reply With Quote
Old 7th May 2007, 07:02   #31  |  Link
drmpeg
Registered User
 
Join Date: Jan 2003
Location: Silicon Valley
Posts: 455
Here's the update:

http://www.w6rz.net/xportpgs.zip

Make sure you clear your browser cache to get the latest. Files are dated 5/6/2007 at 10:55 PM.

I chose to use "PG" (for Presentation Graphics) instead of "SP".

Ron
__________________
HD MPEG-2 Test Patterns http://www.w6rz.net
drmpeg is offline   Reply With Quote
Old 7th May 2007, 09:36   #32  |  Link
Pelican9
Coder
 
Pelican9's Avatar
 
Join Date: Jan 2007
Location: Around the World
Posts: 697
Quote:
Originally Posted by drmpeg View Post
Here's the update:

http://www.w6rz.net/xportpgs.zip

Make sure you clear your browser cache to get the latest. Files are dated 5/6/2007 at 10:55 PM.

I chose to use "PG" (for Presentation Graphics) instead of "SP".

Ron
Thanks!

This is the structure of one subtitle as I thought:
-------------
'PG', PTS, 0,0,0,0, (start time)
0x16, ... presentation composition definition (0x13 bytes)
0x17, ... window definition (0x0A bytes)
0x14, ... palette definition (0x4F8 bytes)
0x15, ... object definition (0x3087 bytes)
0x80, 0, 0 end of displayset
'PG', PTS, 0,0,0,0, (end time)
0x16, ... presentation composition definition 0x0B
0x17, ... window definition 0x0A
0x80, 0, 0 end of displayset
-------------
Next subtitle


This is the structure of the xported .pgs:
-------------
0x16, ... presentation composition definition (0x13 bytes)
0x17, ... window definition (0x0A bytes)
'PG', PTS, 0,0,0,0, (0xFB9B81) 3:03.215
0x14, ... palette definition (0x4F8 bytes)
0x15, ... object definition (0x3087 bytes)
'PG', PTS, 0,0,0,0, (0xFB9C00) 3:03.216
0x80, 0, 0 end of displayset
0x16, ... presentation composition definition 0x0B
0x17, ... window definition 0x0A
'PG', PTS, 0,0,0,0, (0xFE4620) 3:05.156
0x80, 0, 0 end of displayset
-------------
Next subtitle

What is the extra (first or second) PTS?
Could you change something or I have to handle this structure?
Pelican9 is offline   Reply With Quote
Old 7th May 2007, 10:52   #33  |  Link
drmpeg
Registered User
 
Join Date: Jan 2003
Location: Silicon Valley
Posts: 455
I know what's wrong. Some segments have a PTS/DTS PES header, and I was only putting a header in the .pgs file on the segments with just a PTS.

Here's the update:

http://www.w6rz.net/xportpgs.zip

Files are dated 5/7/2007 at 2:48 am

For the segments with DTS, I've put the DTS after the PTS.

"PG", PTS (4 bytes), DTS (4 bytes)

If you think the DTS is useless, and you'd rather have 0x0, let me know.

Ron
__________________
HD MPEG-2 Test Patterns http://www.w6rz.net
drmpeg is offline   Reply With Quote
Old 7th May 2007, 12:01   #34  |  Link
Pelican9
Coder
 
Pelican9's Avatar
 
Join Date: Jan 2007
Location: Around the World
Posts: 697
Quote:
Originally Posted by drmpeg View Post
I know what's wrong. Some segments have a PTS/DTS PES header, and I was only putting a header in the .pgs file on the segments with just a PTS.

Here's the update:

http://www.w6rz.net/xportpgs.zip

Files are dated 5/7/2007 at 2:48 am

For the segments with DTS, I've put the DTS after the PTS.

"PG", PTS (4 bytes), DTS (4 bytes)

If you think the DTS is useless, and you'd rather have 0x0, let me know.

Ron
Yesss! Much better! Thank you!
All segment have their own PTS/DTS info.

What do you think about the file extension?
I mean the .sup is well known as subtitle file.
But on the other hand .pgs shows that it is a different structure.

Last edited by Pelican9; 7th May 2007 at 13:34.
Pelican9 is offline   Reply With Quote
Old 7th May 2007, 18:45   #35  |  Link
manusse
SubtitleCreator's Co-Dev
 
manusse's Avatar
 
Join Date: Oct 2005
Location: France
Posts: 564
I vote for the ".sup" extension because there are already too many subtitle extensions and this will mean that it's a binary subtitle (a.k.a. image).

Cheers
Manusse
manusse is offline   Reply With Quote
Old 7th May 2007, 23:23   #36  |  Link
Pelican9
Coder
 
Pelican9's Avatar
 
Join Date: Jan 2007
Location: Around the World
Posts: 697
Quote:
Originally Posted by drmpeg View Post
I know what's wrong. Some segments have a PTS/DTS PES header, and I was only putting a header in the .pgs file on the segments with just a PTS.
Ron!

Did you decrease the PTS values with the PTS of the first video frame?
I think you didn't, because the subtitles are delaying about 10 sec.
Could you check it?
And I vote the .sup extension too.
Thanks in advance.

Edit:
SUPread v0.4b1

Last edited by Pelican9; 8th May 2007 at 00:12.
Pelican9 is offline   Reply With Quote
Old 8th May 2007, 11:23   #37  |  Link
drmpeg
Registered User
 
Join Date: Jan 2003
Location: Silicon Valley
Posts: 455
Quote:
Originally Posted by Pelican9 View Post
Ron!

Did you decrease the PTS values with the PTS of the first video frame?
I think you didn't, because the subtitles are delaying about 10 sec.
Could you check it?
And I vote the .sup extension too.
Thanks in advance.

Edit:
SUPread v0.4b1
The PTS/DTS is not adjusted. It's directly from the bitstream. Here's an update where the initial video PTS is subtracted from all PGS PTS/DTS values. Also, filename changed to .sup as suggested.

http://www.w6rz.net/xportpgs.zip

File times are 5/8/2007 at 3:16 am.

Ron
__________________
HD MPEG-2 Test Patterns http://www.w6rz.net

Last edited by drmpeg; 8th May 2007 at 12:56.
drmpeg is offline   Reply With Quote
Old 8th May 2007, 12:51   #38  |  Link
Pelican9
Coder
 
Pelican9's Avatar
 
Join Date: Jan 2007
Location: Around the World
Posts: 697
Quote:
Originally Posted by drmpeg View Post
The PTS/DTS is not adjusted. It's directly from the bitstream. Here's an update where the initial video PTS is subtracted from all PGS PTS/DTS values. Also, filename changed to .sup as suggested.

http://www.w6rz.net/xportsup.zip

File times are 5/8/2007 at 3:16 am.

Ron
THANKS!
(The working link: http://www.w6rz.net/xportpgs.zip)

Edit:
Something wrong with the PTS/DTS adjusting.
Original - Adjusted:
0xFBB289 - 0xFBB28A
0xFBB281 - 0xFBB282
0xFBB249 - 0xFBB24A
...
Like the first video PTS is -1 (or 0xFFFFFFFF)

I've expected something like this:
Original - Adjusted:
0xFBB289 - 0xEDF6E9
0xFBB281 - 0xEDF6E1
0xFBB249 - 0xEDF6A9
...

Edit 2:
It was my fault.
I've used this command:
xport -h 00001.m2ts 1 9 9 1
because I didn't want to demux the video and the audio stream but only the subtitle stream (not enough space on this drive).
Is there a way to skip the video stream demux but get the first video PTS and make a .sup?

Last edited by Pelican9; 8th May 2007 at 13:55.
Pelican9 is offline   Reply With Quote
Old 8th May 2007, 13:20   #39  |  Link
manusse
SubtitleCreator's Co-Dev
 
manusse's Avatar
 
Join Date: Oct 2005
Location: France
Posts: 564
Could you post an example of such an extracted SUP file so that I can try working on its import by SubtitleCreator?
(Or better a file from which to extract the sup plus the command line I must use).
A short sample will be enough.

Thanks
Manusse
manusse is offline   Reply With Quote
Old 8th May 2007, 15:08   #40  |  Link
jokin
Dwight Schrute's homeboy
 
Join Date: Jan 2007
Location: The Office
Posts: 136
I used SUPread on the xported sup and it seems after SUPread is done the SRT times are behind by 11 seconds
__________________
jokin
jokin is offline   Reply With Quote
Reply


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 13:26.


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