Question

I'm trying to use mp4parser library in android and I encountered some difficulties. I'm guessing it is becuase mp4parser is a java based project and not adapted yet to android.

PS - mp4parser is worldly spread and even being used by Instagram

I'm basing my conclusions on the following pice of code:

 public PropertyBoxParserImpl(String... customProperties) {
    InputStream is = getClass().getResourceAsStream("/assets/isoparser-default.properties");
    mapping = new Properties();
    try {
        mapping.load(is);
        Enumeration<URL> enumeration = Thread.currentThread().getContextClassLoader().getResources("isoparser-custom.properties");

        while (enumeration.hasMoreElements()) {
            URL url = enumeration.nextElement();
            mapping.load(url.openStream());
        }
        for (String customProperty : customProperties) {
            mapping.load(getClass().getResourceAsStream(customProperty));
        }
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}

isoparser-default.properties is a reflaction mapping:

hint=com.coremedia.iso.boxes.TrackReferenceTypeBox(type)
cdsc=com.coremedia.iso.boxes.TrackReferenceTypeBox(type)
meta-ilst=com.coremedia.iso.boxes.apple.AppleItemListBox()
-----name=com.coremedia.iso.boxes.apple.AppleNameBox()
-----mean=com.coremedia.iso.boxes.apple.AppleMeanBox()
-----data=com.coremedia.iso.boxes.apple.AppleDataBox()
rmra=com.coremedia.iso.boxes.apple.AppleReferenceMovieBox()
rmda=com.coremedia.iso.boxes.apple.AppleReferenceMovieDescriptorBox()
rmdr=com.coremedia.iso.boxes.apple.AppleDataRateBox()
rdrf=com.coremedia.iso.boxes.apple.AppleDataReferenceBox()

in android you cant initiate a url with a link to a local class and mehod and load it like the above PropertyBoxParserImpl() does.

So I'm guessing that I'll just need to change the following function, does anyone enocountered those issues while using the mp4parser?

Was it helpful?

Solution

Yes, you can. Download both isoparser-1.0-RC-27.jar and aspectj-rt.jar, and include them in your libs folder.

http://repo1.maven.org/maven2/org/aspectj/aspectjrt/1.7.3/

http://repo1.maven.org/maven2/com/googlecode/mp4parser/isoparser/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top