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

Reply
 
Thread Tools Search this Thread Display Modes
Old 5th July 2013, 00:39   #1  |  Link
moffy
Registered User
 
Join Date: Apr 2013
Posts: 17
A new proposed open standard for all current subtitle formats

Movie subtitles either DVD, Bluray or broadcast are split into 3 major formats:
1. DVD subtitles, which when ripped are saved as sub/idx files.
2. PGS subtitles, which when ripped are saved as a sup file.
3. TEXT subtitles, which are typically saved as a srt file, but there are many other formats also.

I am proposing a single format/file which can incorporate all of the above while being an open standard, with a library of C language utilities for dealing with converting the above formats to the new one, as well as reading and editing the new format. I have a provisional three letter acronym 'SBS', which is just an abreviation of 'subtitles'.

With the SBS format it would be possible to incorporate TEXT, DVD and PGS subtitles along with their respective palettes into a single file/stream. Each subtitle stream would have its own ID from 1 to 255, as well as a language ID. Start and End times would be stored along with subtitle size and position as well as video size. The format can easily cope with new types of data, as at present only 7 out of the 255 types are allocated. Parsing is simplified as only the desired types need to be decoded, the others can merely be skipped. An index is also proposed which would store a text description of the stream.

Both the DVD and PGS subtitles would be strored in their RLE encoded form. TEXT should be stored as UTF8.

Attached is a file 'sbs_0_5.zip' which has very preliminary C files on the SBS format. I am opening up the format for comment as I am by no means an expert and would appreciate the input of such. The plan would be to firm up the specification then create an open code project.

While I have placed copyright notices at the top of the files, this is only a temporary measure, to prevent early fragmentation, which would defeat the purpose of the proposed standard.
Attached Files
File Type: zip sbs_0_5.zip (11.3 KB, 25 views)
moffy is offline   Reply With Quote
Old 10th July 2013, 18:57   #2  |  Link
ps auxw
Registered User
 
Join Date: Apr 2009
Posts: 102
I'm not sure what the goal here is. If it's about storage and being able to split/append and performing similar transformation, you can just mux the subtitles to Matroska.

Otherwise, are you trying to make universal subtitle format that can contain both bitmap subtitles and text subtitles and makes rendering easier by having everything in a unified format? That could be a bit difficult, as different formats allow for a wide range of feature sets. For example, SSA/ASS subtitles allow a wide range of transformations and other things and that format is pretty popular.
ps auxw is offline   Reply With Quote
Old 11th July 2013, 06:52   #3  |  Link
Chetwood
Registered User
 
Chetwood's Avatar
 
Join Date: Nov 2001
Posts: 1,103
YET another format does solve exactly what? As it is there are tons of formats already, most of which are only roughly supported by various standalones. The fact that even Blu-ray's standard subs - PGS - aren't supported by many current 'Smart' TVs isn't promising.
__________________

MultiMakeMKV: MakeMKV batch processing (Win)
MultiShrink
: DVD Shrink batch processing
Offizieller ‹bersetzer von DVD Shrink deutsch
Chetwood is offline   Reply With Quote
Old 12th July 2013, 00:54   #4  |  Link
moffy
Registered User
 
Join Date: Apr 2013
Posts: 17
Thank you ps auxw and Chetwood for your replies. I share your concern about YASF(Yet another subtitle format) but I do have a particular reason for proposing this. Trying to decode PGS and DVD subs is a bit of a minefield if you are writing code. You can of course borrow from such projects as LibAV and MPC-HC (which I have), but to compile, you have all the dependency issues which are truly non trivial, depending on your platform. The code I am writing at least for the main functions are in pure 'C' and only dependent on the C standard library, making dependency a non issue. The decoding functions have also been simplified to make following as easy as is reasonably possible.

The new standard is purely my attempt at putting all the info necessary about a subtitle into a simple format, 2 basic structures sbsh_t and sub_t. The idea is to provide a means to simplify the handling of subtitles through a simple library. Not looking at 'Smart' TVs yet, just trying to provide a way to simplify the programmer of subtitles lot.

Haven't read anything about SSA/ASS subtitles so will have a look at that.

Thanks again for your comments.
moffy is offline   Reply With Quote
Old 12th July 2013, 00:56   #5  |  Link
moffy
Registered User
 
Join Date: Apr 2013
Posts: 17
Have a new version of SBS with the following changes:

SBS: Proposed universal subtitle format

Version: Major = 0 Minor = 50
1. First code release

Version: Major = 0 Minor = 51
1.Added bitmap files.
2.Added bitmap output for PGS subtitles.
3.Added DVD sup to sbs conversion.
4.Added DVD decoding and extended format info.
4a.Changed sup_t::reserved for sup_t::is8bit.
4b.Extra types added into DVD data: DVD_RLE_DATA, DVD_COLOUR_MAP, DVD_ALPHA
5.Added bitmap output for DVD subtitles.
6.Added language ID enum for all languages.
7.Seperated SRT functions into their own files.
8. Added two DEBUG flags for DVD and PGS which decode the sbs file and the DVD and PGS data into bimaps which are then output to a subdirectory 'output' if it exists.
9.Tested the code to ensure it works.
Attached Files
File Type: zip sbs_0_51.zip (23.3 KB, 10 views)
moffy is offline   Reply With Quote
Old 15th July 2013, 00:55   #6  |  Link
moffy
Registered User
 
Join Date: Apr 2013
Posts: 17
Could anyone explain to me the workings of the DVD subtitle palette? I get that it is (1 of 4) to (1 of 16) rgb colours, but there are menu palettes etc. Also how do you tell if a DVD subtitle is part of a menu or forced?

Advice appreciated.
moffy is offline   Reply With Quote
Old 16th July 2013, 00:35   #7  |  Link
moffy
Registered User
 
Join Date: Apr 2013
Posts: 17
Its yuv not rgb, but I knew that.
moffy is offline   Reply With Quote
Old 18th July 2013, 00:46   #8  |  Link
moffy
Registered User
 
Join Date: Apr 2013
Posts: 17
Another update, also included a couple of command line utilities and the source. Hope you find it usefull.

Version: Major = 0 Minor = 52

1. Added SBSParseSBSH().
2. Added SBSStreamInit().
3. Added SBSStream() and sbsstream_t type.
4. New defines: SBS_SBSH_SIZE ,SBS_SUB_SIZE and SBS_INDEX_SIZE.
5. Tidied up SBSReadFile().
6. Fixed pgs bmp file name from "dvd%d.bmp" to "pgs%d.bmp"
7. Fixed all times so that they all are converted into milliseconds.
8. Added SBSMux, basic muxing routines and index file based muxing.
9. Added write and read an index.
10. Changed sbsh_t to include nindex which tells how many indexes there are.
11. Indexes are now of variable size.
12. Changed the names and added a couple of macros.
Attached Files
File Type: zip sbs_0_52.zip (47.3 KB, 15 views)
moffy 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 04:36.


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