FileDocCategorySizeDatePackage
ExtractPictureFromItunesFile.javaAPI Docmp4parser 1.0-RC-17964Wed Dec 19 20:10:38 GMT 2012com.googlecode.mp4parser

ExtractPictureFromItunesFile

public class ExtractPictureFromItunesFile extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

        IsoFile isoFile = new IsoFile(new FileInputStream(args[0]).getChannel());


        AppleDataBox data = (AppleDataBox) Path.getPath(isoFile, "/moov/udta/meta/ilst/covr/data");
        String ext;
        if ((data.getFlags() & 0x1) == 0x1) {
            ext = "jpg";
        } else if ((data.getFlags() & 0x2) == 0x2) {
            ext = "png";
        } else {
            System.err.println("Unknown Image Type");
            ext = "unknown";
        }

        FileOutputStream fos = new FileOutputStream("image." + ext);
        fos.write(data.getData());
        fos.close();