Log in

View Full Version : [Matroska] Subtitles, EbmlID


Kurosu
9th May 2004, 19:19
I'm using C++ version of libmatroska 0.6.3 and libebml 0.6.4. I've more or less used code from the CVS for Matroska Properties and various projects in that repository. I have several questions:

1) When parsing a subtitle track element, I found an EbmlElement of ID 0xEC. It appears to be an EbmlVoid element, probably holding a boolean value. What is its use?

2) I have a problem reading the duration available from KaxInfo element. In case an element is longer than the others (say, if I put a subtitle of an 1H for a 20s video), the whole clip has now the duration of subtitle. This was to be expected, but then, how can I get the per-track durations instead? I see the element KaxTrackDefaultDuration which should be probably used with a number of samples, but I don't know where I should get this number.

3) Finaly, once I have a subtitle track, how could I get further information from it, in particular its charset?

TIA,
Kurosu

alexnoe
9th May 2004, 19:54
-> Void elements never have any use except for filling some gap
-> subtitles are ALWAYS utf-8

EDIT of course, this refers to text subs only, not to picture subs.

robUx4
9th May 2004, 19:58
Hi

#1 The void element doesn't contain anything. The content is not meaningful. It is used to save space while muxing a file and be able to overwrite it later. And if the writing of the file crashes in the middle, the "hole" is not a problem to use the file...

#2 TrackDefaultDuration is the duration of a frame when its duration is not set. So it's not the total length of the track. There is no such thing as what you're looking for (yet).

#3 No idea, it probably depends on the kind of subs it is (depend on the codec used). So you have to be able to understand this/these codec.

Kurosu
9th May 2004, 19:58
Originally posted by alexnoe
-> Void elements never have any use except for filling some gap
OK, I guess it was all in its name :)

-> subtitles are ALWAYS utf-8You mean than the option in mmg (for instance) to set subtitle charset is used to translate the subtitle file content into UTF-8?

alexnoe
9th May 2004, 20:03
You mean than the option in mmg (for instance) to set subtitle charset is used to translate the subtitle file content into UTF-8?Yes. Some people indeed still save their text subs to something else than utf-8... :-(

Kurosu
10th May 2004, 02:47
Woops, hadn't seen this reply.

Originally posted by robUx4
#2 TrackDefaultDuration is the duration of a frame when its duration is not set. So it's not the total length of the track. There is no such thing as what you're looking for (yet).
Thanks for the information. Anyway, all tracks should have the same durations for, say, a movie (I haven't tested .mka albums)

#3 No idea, it probably depends on the kind of subs it is (depend on the codec used). So you have to be able to understand this/these codec.
In fact, I meant text subtitles, like srt or ssa. But as alexnoe said, they should be all encoded in UTF8. I haven't tested yet with vobsub subs.

Anyway, extracting interesting tags from the overwhelming amount available is my next objective.

Thanks alexnoe and RobUx4 for the help.