I am trying to solve the problem with MP4 streaming. FFPMEG place Moov atom
header to the end of MP4 which prevents proper streaming in FLASH.
I used trunk version of mp4parser:
IsoBufferWrapper isoBufferWrapper = new IsoBufferWrapper(new
File("C:/test.mp4"));
IsoFile isoFile = new IsoFile(isoBufferWrapper);
isoFile.parse();
isoFile.parseMdats();
Box[] boxes = isoFile.getBoxes();
IsoFileConvenienceHelper.switchToAutomaticChunkOffsetBox(isoFile);
//moving MOOV header to front
Box[] fixed = new Box[]{boxes[0], boxes[3], boxes[2], boxes[1]};
//no direct api to change the order of boxes in isoFile
Field field = isoFile.getClass().getDeclaredField("boxes");
field.setAccessible(true);
field.set(isoFile, fixed);
IsoOutputStream isos = new IsoOutputStream(new FileOutputStream(new
File("c:/testFixed.mp4")));
isoFile.getBox(isos);
So i have used reflection to change boxes array in IsoFile. Without that i will
get incorrect offset because boxes in isoFile will use old offsets when writing
to file.
P.S May you please release trunk 1.0-alpha-2-SNAPSHOT as artifact to maven ?
Original issue reported on code.google.com by werde...@gmail.com on 13 Jan 2011 at 7:46
Original issue reported on code.google.com by
werde...@gmail.com
on 13 Jan 2011 at 7:46