yay a topic for me \o/ i have some questions which are bullying me for some time now : >The Styles would be stripped and placed in the CodecPrivateData. 1) how do you put the styles infos in CodecPrivateData (and CodecState for style override) ? in plain text or something ? (it's quite dirty, imo, you have to parse it to get wanted informations) or can we define some tags ? (like for video or audio, you have resolution, sampling rate etc ...) for me, subtitles have some necessary informations like video to be know. Like playResY in ssa : it's used know how to scale font size & position , if you change it from 768 to 1024, you mess up all your edition's work. (I agree, it's stupid, but it's the way SSA work :-/) 2) it's happen very often to have more than 3 or 4 events at the same time in a subfile ... is it possible in matroska to have blocks with the same timestamp in the same track ? 3) ssa is not sorted, and it's very usefull when you do some advanced edition (example : put the translation notes in a row to not have to search them in the entire file) how is handled in matroska ? it has to be sorted ? (if sorted at mux, demux do not output the original sub ;) - not like it's really a problem but ... wait, i don't want my subs to be demuxed ! - ) So, i think we need to define the one and only way to store subs in matroska, because subtitles are all the same (with more or less informations). And afaik, there isn't something defined in the specs (or i'm blind ?? it wouldn't suprise me ;) more, Once it's done, to add a new subtitle format, you just have to write a parser, all the matroska work is done. Here my humble opinion, perhaps it has already discussed many times and the same conclusions came up, but i'm not aware of it, and wanted to say it ;) bill_baroud "Pamel" <paul@xxxxxxx> a écrit dans le message news: b9rrdn$4lg$1@xxxxxxxxxxxxxxxxx > "Gabest" <gabest@xxxxxxxxxxx> wrote > > > In my opinion the best way to resolve the problem would be to use a new > > > subtitle MEDIATYPE (or SUBTYPE maybe). It will also make possible to > > > distingish subtitles format. > > > > That's an excellent idea, needed to be done to ogm long ago > > too. I suggest using a format, what I also forced into avi :), where there > > is only one sample containing the whole subtitle file. To save more space > it > > could be compressed with some lzw coding (I have the source of an gif > codec > > here somewhere which I made years ago, it is quite simple and short). Or > > alternatively, the format block of each sample could tell about the global > > style and other info in a predefined structure (more specs to be done, > > hehe), and the raw text could have some kind of style mod tags stuffed in > > it, but I hate html tags.. they are a pain to parse. > > I think I should comment here. There is a very specific way that subtitles > are supposed to be stored in Matroska. Each set of words with a timecode is > supposed is supposed to be stored by itself in a block. The timecode of the > block is the timecode that the subtitle is supposed to appear. The duration > that the subtitle is supposed to be on the screen is stored in an element > known as BlockDuration. Information that is to be applied to the subtitle > track in general goes in the CodecPrivateData. > > To illustrate this, I will use USF as an example. Here is some example USF > code: > > <USFSubtitles version="1.0"> > <metadata> > <title>The Core Media Player subtitle format sample</title> > <author> > <name>[Toff]</name> > <email>christophe.paris@xxxxxxx</email> > <url>http://christophe.paris.free.fr</url> > </author> > <language code="en">English</language> > <date>2002-08-15</date> > <comment>This is a sample</comment> > </metadata> > > <styles> > <style name="NarratorSpeaking"> > <fontstyle italic="yes" color="#FFEEEE" outline-color="#FF4444"/> > </style> > </styles> > > <subtitles> > <subtitle start="00:00:11.000" stop="00:00:15.000"> > <text style="NarratorSpeaking">What can be done ?</text> > </subtitle> > </subtitles> > </USFSubtitles> > > > In this example, the Metadata would be stripped and placed in the native > Matroska tags. The Styles would be stripped and placed in the > CodecPrivateData. The subtitle Start time would be stripped and placed in > the Blocks timecode. The Stop time would be stripped and used to calculate > the BlockDuration. > > When the file is loaded into a player, all of the Metadata is available as > track information. The CodecPrivateData is sent to the codec so that is > knows how to render all of the styles. When a subtitle block is sent to the > codec, it renders the subtitle using the appropriate Style that it has > already loaded. Then the subtitle is displayed at the correct time, for the > correct duration. Extremely complex subtitle systems that have dependancies > on other subtitles can use the ReferenceBlock element to ensure that the > other subtitle is loaded first. > > The reason for this is that it ensures that a Matroska editor doesn't need > to have a working knowledge of whatever subtitle system is being used. For > instance, if you had a movie with subtitles, you could cut out a clip from > the middle and it would remove the video frames, audio frames, and > subtitles, and everything would stay in synch. You could even change the > speed of the movie and only need to reencode the audio, the video and > subtitles would just need the timecode and Blockduration of the block > changed. In fact, most editing for Matroska could be done by an editor that > did not have to be able to decode any video, audio, or subtitle data, as > long as it was all stored in the proper manner. > > > > We must also define a way to inform dvobsub of the language used or if a > > > subtitle stream must always be displayed (like closed caption). > > > > This should go into the format block. > > This would actually go in the Language element for the Track. > > > > With the flexibility of matroska we need to re-think how subtitles are > > > handled :) > > > > "Think! Think! Think!" - Winnie The Pooh :) > > Most of this has already been thought out. Now it just needs to be properly > implemented. > > > Pamel > > > > http://www.matroska.org > http://usf.corecodec.org