http://code.google.com/p/mp4parser/
这是我使用的法典的一部分:
String filepath = "/yourFilePathHere/yourFileNameHere.ext";
File sourceFile = new File ( filepath );
IsoBufferWrapper isoBufferWrapper = new IsoBufferWrapperImpl( sourceFile );
IsoFile isoFile = new IsoFile(isoBufferWrapper);
isoFile.parse();
AppleItemListBox appleItemListBox = (AppleItemListBox) IsoFileConvenienceHelper.get(isoFile, "moov/udta/meta/ilst");
AppleCoverBox coverBox = (AppleCoverBox) IsoFileConvenienceHelper.get (appleItemListBox, AppleCoverBox.TYPE);
List<Box> dataBoxes = coverBox.getBoxes();
byte[] coverBoxByte = null;
if (dataBoxes != null && dataBoxes.size() > 0) {
AppleDataBox dataBox = (AppleDataBox)dataBoxes.get(0);
coverBoxByte = dataBox.getContent();
}
Bitmap icon = null;
if (coverBoxByte != null){
icon = BitmapFactory.decodeByteArray(coverBoxByte, 0, coverBoxByte.length);
}