[Matroska-devel] Mkvmerge timecode file

Moritz Bunkus moritz at bunkus.org
Tue Oct 5 11:39:19 CEST 2004


> My first question is : what about referenced frames in the case of a 
> timecode file ? Is the reader aware of that and keep the correct 
> references ?

Yes. Internally each packet (= frame) has a timecode, a bref and a fref
parameter. Those are not changed by the timecode files. There is also a
_third_ value, assigned_timecode. This one is changed by the timecode

When the code wants to know which timecodes to hand over to libmatroska
it does this: (pseudo-codish)

timecode = packet->assigned_timecode
if (packet->bref != -1)
  bref_packet = find_packet_with_timecode(packet->bref)
  bref_timecode = bref_packet->assigned_packet
  bref_timecode = -1
if (packet->fref != -1)
  fref_packet = find_packet_with_timecode(packet->fref)
  fref_timecode = fref_packet->assigned_packet
  fref_timecode = -1

> My second question is : will there be a timecode file v3 to support gaps 
> ? And duration ?

Sure. Why don't you define it? :) I can write the parser for it, or you
can do it.

> IMO both v1 and v2 could be easily extended to support gaps :

No, I don't want to change the existing ones. So if you extend them then
use new version nubmers for them. E.g. your changed v1 will become v3,
and your changed v2 will become v4.

> - for v1 you could have a new comma-separated parameter :
> 800,1000,25,1
> 1500,1700,30,0
> The 1 means there is a gap, 0 there is no gap at the end.

Sounds good.

> - for v2 you could have a comma-separated parameter like :
> 0
> 40
> 80,gap
> 2320
> 2360

Why not the word 'gap' alone on a line?

> or a special timecode :
> 0
> 40
> 80
> -1
> 2320
> 2360

Yeah more like this, but I'd prefer a word like 'gap' (maybe even in
uppercase) to -1.


If Darl McBride was in charge, he'd probably make marriage
unconstitutional too, since clearly it de-emphasizes the commercial
nature of normal human interaction, and probably is a major impediment
to the commercial growth of prostitution. - Linus Torvalds

More information about the Matroska-devel mailing list