Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is mp4parser java library has android version

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?

like image 649
Nativ Avatar asked Jul 19 '26 04:07

Nativ


1 Answers

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/

like image 187
Vijayakumar Moorthy Avatar answered Jul 21 '26 21:07

Vijayakumar Moorthy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!