Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#12 Indexing Interleaved Essence

Oliver Morgan

(I think this was fixed in mxfwrap 1.10 on 2004-04-06.
Not sure if the new GCWriter delivered a systemic fix)

Oliver reported on Mar 17:

making ganged OP1A files, video and 2 x sound
@30000/1001, i.e not const samples, i.e. 3xVBR streams
in the GC

Each index table entry should therefore have 3 slices

However, when IndexManager::SetOffset is called by
mxfwrap::WriteBody() (mxfwrap line #1757)

GCWriter::GetStreamOffset() is giving us the offset in
the substream, not in the entire EC.

Anu reported on Feb 23:

Currently, mxfwrap creates an OP1a file when it is
passed one set of
ganged input files. E.g.

mxfwrap -f -i video.m2v+audio.wav op1a.mxf

The index table created indexes only for the video
stream because
CanIndex is set to False for WAV files in WAV parser
Also the stream offsets in the index table do not take
into account the
WAV data in the ContentPackage. So if you try to
randomly access the
'n'th video element unit, it will not coincide with the
start of the
video element.

Another problem is that since the WAV stream cannot be
indexed it is not
recognised as a substream so the delta entry offsets etc
in the index
table are not set.

The problem with indexing the video stream seems to be
with line 1734 in


The GetStreamOffset returns an offset into the stream
in the Current
writer, but does not take into account that this Writer
may be part of a
stream i.e. interleaved essence.

I think there are two ways to solve this problem

Fix the problem in mxfwrap.cpp so that we figure out the
correct offset
and then pass it to OfferStreamOffset


Modify IndexManager::AddEntriesToIndex so that it
calculates the the
index table entries correctly based on the offsets into
essence streams i.e

replace line 1542 in index.cpp

Index->AddIndexEntry(ThisEditUnit, ThisEntry-
ThisEntry->KeyOffset, ThisEntry->Flags, ThisEntry-
>StreamOffset[0], NSL,
SliceOffsets, NPE, PosTable);


Index->AddIndexEntry(ThisEditUnit, ThisEntry-
ThisEntry->KeyOffset, ThisEntry->Flags, actualOffset,
NSL, SliceOffsets,
NPE, PosTable);

where actualOffset is calculated as as sum of the 'n'
individual stream

ThisEntry->StreamOffset[0]+ ThisEntry->StreamOffset
[1] +... +


  • Matt Beard
    Matt Beard

    Logged In: YES

    I believe this is now fixed - can someone please check...

  • Matt Beard
    Matt Beard

    • status: open --> pending
  • Matt Beard
    Matt Beard

    • priority: 5 --> 4
    • status: pending --> open