Giter Site home page Giter Site logo

dv8fromtheworld / jaadec Goto Github PK

View Code? Open in Web Editor NEW
27.0 9.0 26.0 482 KB

JAAD is an AAC decoder and MP4 demultiplexer library written completely in Java. It uses no native libraries, is platform-independent and portable. It can read MP4 container from almost every input-stream (files, network sockets etc.) and decode AAC-LC (Low Complexity) and HE-AAC (High Efficiency/AAC+). Fork of:

Home Page: https://sourceforge.net/projects/jaadec/

License: Other

Java 100.00%

jaadec's Introduction

JAADec

This is a fork of https://sourceforge.net/projects/jaadec/ containing fixes to make it play nice with other Java Sound Providers.

The original project was licensed under Public Domain and as such this fork is also licensed under Public Domain. Use as you like!

JAAD is an AAC decoder and MP4 demultiplexer library written completely in Java. It uses no native libraries, is platform-independent and portable. It can read MP4 container from almost every input-stream (files, network sockets etc.) and decode AAC-LC (Low Complexity) and HE-AAC (High Efficiency/AAC+).

This library is available on Bintray's jcenter as a Maven/Gradle download.
https://bintray.com/dv8fromtheworld/maven/JAADec/view

For Gradle:

repositories {
  jcenter()
}

dependencies {
  compile 'net.sourceforge.jaadec:jaad:0.8.6'
}

For Maven:

<repositories>
  <repository>
    <id>central</id>
    <name>bintray</name>
    <url>http://jcenter.bintray.com</url>
  </repository>
</repositories>

<dependencies>
  <dependency>
    <groupId>net.sourceforge.jaadec</groupId>
    <artifactId>jaad</artifactId>
    <version>0.8.6</version>
  </dependency>
</dependencies>

jaadec's People

Contributors

candrews avatar dv8fromtheworld avatar gamax92 avatar hedgehog1029 avatar pejic avatar umjammer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jaadec's Issues

Cannot decode mp4/aac

I've tried a number of different input files but cannot get this to work..

SEVERE: box ���, overread: 8 bytes, offset: 931,565
Mar 28, 2018 3:24:50 PM net.sourceforge.jaad.mp4.boxes.BoxFactory parseBox
SEVERE: box ���, overread: 8 bytes, offset: 931,565
error while decoding: java.io.IOException: error while decoding box '���$' at offset 931565: box too large for parent```

any hints? thanks.

Seek is weird

Current implementation of seek in Track seems to be broken:

	public double seek(double timestamp) {
		//find first frame > timestamp
		Frame frame = null;
		for(int i = 0; i<frames.size(); i++) {
			frame = frames.get(i++);
			if(frame.getTime()>timestamp) {
				currentFrame = i;
				break;
			}
		}
		return (frame==null) ? -1 : frame.getTime();
	}

The loop over frames uses i up until i<frames.size(), e.g. last frame.
But then inside the loop frame following i-th frame is taken - because if following frame is after specified time we need to start with current i-th frame. This can result in IndesOutOfBoundsException for example when time is after last frame.

Thus we need to loop until i<frames.size()-1. Or loop from 1 to i<frames.size() and return previous frame.

Also, there is clearly a bug with taking next frame - frames.get(i++) will also update i which is wrong! Loop step becomes 2 instead of 1. This should be frames.get(i+1). Or just frames.get(i) if we start from 1 and return (i-1)-th frame when frames.get(i).getTime() is after timestamp.

Also the API seems weird. It's not clear what this double value actually is (minutes? seconds?) It would be more useful to include seek(int frameNumber) method to allow to skip to specific frame. And thus also getFramesCount() method so one would know what is the index of the last frame in the track. This would allow to also seek by percentage based position in the track (e.g. go to 33% of the track etc) besides the existing time-based seek.

License

Hello, what's the license of this project?

AACException: unexpected profile for LTP: AAC Low Complexity

Hello,
I am new to AAC decoding. I trie to decode and play the following strem: http://streams.bigfm.de/bigfm-charts-128-aac?usid=0-0-H-A-D-30
Therefore i used the Radio example (https://github.com/DV8FromTheWorld/JAADec/blob/master/src/main/java/net/sourceforge/jaad/Radio.java), but i get the exception above.
When I use the Play approach of yours (https://github.com/DV8FromTheWorld/JAADec/blob/master/src/main/java/net/sourceforge/jaad/Play.java), it plays (sometimes i get the same exception, but most of time it works) but the audio stucks.
Am I wrong or is this reproducable?

Regression: error decoding metadata from some m4a files in 0.8.6

I've tried to play some m4a files I've bought from iTunes store, and everything worked with version 0.8.5 from Maven. But when I started to work with current code from master - MP4Container creation failed with this error:

Exception in thread "main" java.io.IOException: error while decoding box '����' at offset 73633: box too large for parent
	at net.sourceforge.jaad.mp4.boxes.BoxFactory.parseBox(BoxFactory.java:347)
	at net.sourceforge.jaad.mp4.boxes.BoxImpl.readChildren(BoxImpl.java:110)
	at net.sourceforge.jaad.mp4.boxes.impl.MetaBox.decode(MetaBox.java:26)
	at net.sourceforge.jaad.mp4.boxes.BoxFactory.parseBox(BoxFactory.java:353)
	at net.sourceforge.jaad.mp4.boxes.BoxImpl.readChildren(BoxImpl.java:110)
	at net.sourceforge.jaad.mp4.boxes.BoxFactory.parseBox(BoxFactory.java:357)
	at net.sourceforge.jaad.mp4.boxes.BoxImpl.readChildren(BoxImpl.java:110)
	at net.sourceforge.jaad.mp4.boxes.BoxFactory.parseBox(BoxFactory.java:357)
	at net.sourceforge.jaad.mp4.MP4Container.readContent(MP4Container.java:90)
	at net.sourceforge.jaad.mp4.MP4Container.<init>(MP4Container.java:81)
	at net.sourceforge.jaad.Play.decodeMP4(Play.java:63)
	at net.sourceforge.jaad.Play.main(Play.java:49)

Checking differences between 0.8.5 and 0.8.6 I've found this change:
4c9fce6
When commented out, decoding works again.

I'm sorry I can't provide more relevant data and can't attach m4a file (because that'd be a copyright violation). If needed I suppose though I could provide some portion of the file content, e.g. where headers are.

Application stucks when reading large mp4 files

Application stucks forever when parsing media boxes larger tan 2Gb. No exceptions generated. This happens with RandomAccessFile sources only.
The problem is in MP4InputStream.skipBytes() method:

while(l<n) {
        if(in!=null) l += in.skip((n-l));
        else if(fin!=null) l += fin.skipBytes((int) (n-l));
}

This cast to int on line 3 causes int to overflow and skipBytes always returns zero as a result which leads to an endless cycle.

Can't access 0.8.6

Hello,
I feel a bit stupid, but it seems I can't access version 0.8.6. I've added

<repositories>
  <repository>
    <id>central</id>
    <name>bintray</name>
    <url>http://jcenter.bintray.com</url>
  </repository>
</repositories>

and

  <dependency>
    <groupId>net.sourceforge.jaadec</groupId>
    <artifactId>jaad</artifactId>
    <version>0.8.6</version>
  </dependency>

to my POM and also added

        <mirror>
            <id>bintray</id>
            <mirrorOf>*</mirrorOf>
            <name>bintray</name>
            <url>http://jcenter.bintray.com</url>
        </mirror>

to the settings.xml, but I still see Could not find artifact net.sourceforge.jaadec:jaad:0.8.6 from Maven. It seems it does not even check the added repository:

Downloading: http://[INTERNAL_NEXUS]/nexus/content/groups/public/net/sourceforge/jaadec/jaad/0.8.6/jaad-0.8.6.pom
Downloading: http://uk.maven.org/maven2/net/sourceforge/jaadec/jaad/0.8.6/jaad-0.8.6.pom
[WARNING] The POM for net.sourceforge.jaadec:jaad:jar:0.8.6 is missing, no dependency information available
Downloading: http://INTERNAL_NEXUS/nexus/content/groups/public/net/sourceforge/jaadec/jaad/0.8.6/jaad-0.8.6.jar
Downloading: http://uk.maven.org/maven2/net/sourceforge/jaadec/jaad/0.8.6/jaad-0.8.6.jar

Hints? What am I missing?

implicit sbr + ps not working

I failed to decode any he-aac plus v2 (AAC + SBR + PS) stream.
After several nights of debugging against faad2 (C-code) I found several bugs.
Concerning SBR I prepared a pull request.
Implicit PS did not work, too. The function SBR.processPS() was not called at all.
The output channel is prepared as mono and can not be switched to stereo easily.
As a workaround I upgraded all mono streams to stereo.
All the bugs I found in the original code too.

Dieter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.