public ChunkOffsetBox getChunkOffsetBox() { for (Box box : getBoxes()) { if (box instanceof ChunkOffsetBox) { return (ChunkOffsetBox) box; } } return null; }
private static void correctChunkOffsets(IsoFile tempIsoFile, long correction) { List<SampleTableBox> sampleTableBoxes = Path.getPaths(tempIsoFile, "/moov[0]/trak/mdia[0]/minf[0]/stbl[0]"); for (SampleTableBox sampleTableBox : sampleTableBoxes) { List<Box> stblChildren = new ArrayList<Box>(sampleTableBox.getBoxes()); ChunkOffsetBox chunkOffsetBox = Path.getPath(sampleTableBox, "stco"); if (chunkOffsetBox == null) { stblChildren.remove(Path.getPath(sampleTableBox, "co64")); } stblChildren.remove(chunkOffsetBox); assert chunkOffsetBox != null; long[] cOffsets = chunkOffsetBox.getChunkOffsets(); for (int i = 0; i < cOffsets.length; i++) { cOffsets[i] += correction; } StaticChunkOffsetBox cob = new StaticChunkOffsetBox(); cob.setChunkOffsets(cOffsets); stblChildren.add(cob); sampleTableBox.setBoxes(stblChildren); } }
ctts.setEntries(new ArrayList<CompositionTimeToSample.Entry>()); ArrayList<Box> bs = new ArrayList<Box>(stbl.getBoxes()); bs.add(bs.indexOf(stts), ctts);
if (traf.getTrackFragmentHeaderBox().getTrackId() == trackId) { sampleGroups = getSampleGroups( stbl.getBoxes(SampleGroupDescriptionBox.class), // global descriptions Path.<SampleGroupDescriptionBox>getPaths((Container) traf, "sgpd"), // local description Path.<SampleToGroupBox>getPaths((Container) traf, "sbgp"), if (traf.getTrackFragmentHeaderBox().getTrackId() == trackId) { sampleGroups = getSampleGroups( stbl.getBoxes(SampleGroupDescriptionBox.class), Path.<SampleGroupDescriptionBox>getPaths((Container) traf, "sgpd"), Path.<SampleToGroupBox>getPaths((Container) traf, "sbgp"), sampleGroups, 0); sampleGroups = getSampleGroups(stbl.getBoxes(SampleGroupDescriptionBox.class), null, stbl.getBoxes(SampleToGroupBox.class), sampleGroups, 0);
public ChunkOffsetBox getChunkOffsetBox() { for (Box box : getBoxes()) { if (box instanceof ChunkOffsetBox) { return (ChunkOffsetBox) box; } } return null; }
} else { ChunkOffset64BitBox co64 = stbl.getBoxes(ChunkOffset64BitBox.class).get(0); if (co64 != null) { log.debug("Chunk offset (64) atom found");
} else { ChunkOffset64BitBox co64 = stbl.getBoxes(ChunkOffset64BitBox.class).get(0); if (co64 != null) { log.debug("Chunk offset (64) atom found");
} else { List<ChunkOffset64BitBox> stblBoxes = stbl.getBoxes(ChunkOffset64BitBox.class); if (stblBoxes != null && !stblBoxes.isEmpty()) { ChunkOffset64BitBox co64 = stblBoxes.get(0);
} else { List<ChunkOffset64BitBox> stblBoxes = stbl.getBoxes(ChunkOffset64BitBox.class); if (stblBoxes != null && !stblBoxes.isEmpty()) { ChunkOffset64BitBox co64 = stblBoxes.get(0);
log.debug("stbl children: {}", stbl.getBoxes().size()); MP4Reader.dumpBox(stbl);
log.debug("stbl children: {}", stbl.getBoxes().size()); MP4Reader.dumpBox(stbl);
} else { ChunkOffset64BitBox co64 = stbl.getBoxes(ChunkOffset64BitBox.class).get(0); if (co64 != null) { log.debug("Chunk offset (64) atom found");
} else { ChunkOffset64BitBox co64 = stbl.getBoxes(ChunkOffset64BitBox.class).get(0); if (co64 != null) { log.debug("Chunk offset (64) atom found");
log.debug("stbl children: {}", stbl.getBoxes().size()); dumpBox(stbl);
log.debug("stbl children: {}", stbl.getBoxes().size()); dumpBox(stbl);
if (traf.getTrackFragmentHeaderBox().getTrackId() == trackId) { sampleGroups = getSampleGroups( stbl.getBoxes(SampleGroupDescriptionBox.class), // global descriptions Path.<SampleGroupDescriptionBox>getPaths((Container) traf, "sgpd"), // local description Path.<SampleToGroupBox>getPaths((Container) traf, "sbgp"), if (traf.getTrackFragmentHeaderBox().getTrackId() == trackId) { sampleGroups = getSampleGroups( stbl.getBoxes(SampleGroupDescriptionBox.class), Path.<SampleGroupDescriptionBox>getPaths((Container) traf, "sgpd"), Path.<SampleToGroupBox>getPaths((Container) traf, "sbgp"), sampleGroups, 0); sampleGroups = getSampleGroups(stbl.getBoxes(SampleGroupDescriptionBox.class), null, stbl.getBoxes(SampleToGroupBox.class), sampleGroups, 0);