private static void appendSampleToChunk(TrakBox trakBox1, TrakBox trakBox2, int off) {
SampleToChunkBox stsc1 = trakBox1.getStsc();
SampleToChunkBox stsc2 = trakBox2.getStsc();
SampleToChunkEntry[] orig = stsc2.getSampleToChunk();
SampleToChunkEntry[] shifted = new SampleToChunkEntry[orig.length];
for (int i = 0; i < orig.length; i++) {
shifted[i] = new SampleToChunkEntry(orig[i].getFirst() + stsc1.getSampleToChunk().length,
orig[i].getCount(), orig[i].getEntry() + off);
}
NodeBox.findFirstPath(trakBox1, NodeBox.class, Box.path("mdia.minf.stbl")).replace("stsc",
SampleToChunkBox.createSampleToChunkBox((SampleToChunkEntry[]) ArrayUtil.addAllObj(stsc1.getSampleToChunk(), shifted)));
}