INDExOS / media-for-mobile

Media for Mobile
Other
456 stars 177 forks source link

Add audio effect with mp3(audio/mpeg) on android sample #10

Open cloudysky32 opened 9 years ago

cloudysky32 commented 9 years ago

I've been trying to add audio effect with mp3(audio/mpeg) but I can't make it.

It crashes with BufferOverflowException.

The log message is

java.nio.BufferOverflowException java.nio.BufferOverflowException at java.nio.ByteBuffer.put(ByteBuffer.java:787) at com.intel.inde.mp.domain.Frame.copyDataFrom(Frame.java:91) at com.intel.inde.mp.domain.pipeline.CopyDataCommandHandler.handle(CopyDataCommandHandler.java:33) at com.intel.inde.mp.domain.CommandProcessor.process(CommandProcessor.java:114) at com.intel.inde.mp.domain.CommandProcessor.process(CommandProcessor.java:86) at com.intel.inde.mp.domain.CommandProcessor.processCommandPairs(CommandProcessor.java:78) at com.intel.inde.mp.domain.CommandProcessor.process(CommandProcessor.java:50) at com.intel.inde.mp.MediaComposer$1.run(MediaComposer.java:344) at java.lang.Thread.run(Thread.java:818)

What I've tried things to solve this problem are

but the things didn't help.

so, I printed log with buffer's value.

D/EqualRateAudioReader﹕ EqualRateAudioReader read start D/EqualRateAudioReader﹕ decoderInputBufferIndex : 0 D/EqualRateAudioReader﹕ decoderInputBuffer.capacity() 524288, decoderInputBuffer.limit() 524288 D/EqualRateAudioReader﹕ SampleData size : 417 D/EqualRateAudioReader﹕ Presentation Time : 0 D/EqualRateAudioReader﹕ mAudioExtractor.getSampleFlags() : 1 I/ACodec﹕ >>> getPortFormat 16, OMX.SEC.mp3.dec D/EqualRateAudioReader﹕ decoderOutputBufferIndex MediaCodec.INFO_OUTPUT_FORMAT_CHANGED D/EqualRateAudioReader﹕ decoderInputBufferIndex : 1 D/EqualRateAudioReader﹕ decoderInputBuffer.capacity() 524288, decoderInputBuffer.limit() 524288 D/EqualRateAudioReader﹕ SampleData size : 418 D/EqualRateAudioReader﹕ Presentation Time : 26122 D/EqualRateAudioReader﹕ mAudioExtractor.getSampleFlags() : 1 D/EqualRateAudioReader﹕ decoderOutputBufferIndex : 0 D/EqualRateAudioReader﹕ mAudioDecoderOutputBufferInfo.offset : 0 D/EqualRateAudioReader﹕ mAudioDecoderOutputBufferInfo.size : 2492 D/EqualRateAudioReader﹕ byteBuffer.capacity() 1048576 D/EqualRateAudioReader﹕ byteBuffer.limit() 2492 D/EqualRateAudioReader﹕ decoderOutputBuffer.capacity() 27648 D/EqualRateAudioReader﹕ decoderOutputBuffer.limit() 2492 D/SubstituteAudioEffect﹕ timeProgress 0 D/SubstituteAudioEffect﹕ input.limit() 24576, input.capacity() 24576, byteBuffer.limit() 2492, byteBuffer.capacity() 1048576 I/AMP﹕ New frame allocated for buffer 0 I/AMP﹕ New frame allocated for buffer 12 I/AMP﹕ New frame allocated for buffer 1 D/EqualRateAudioReader﹕ EqualRateAudioReader read start D/EqualRateAudioReader﹕ decoderInputBufferIndex : 2 D/EqualRateAudioReader﹕ decoderInputBuffer.capacity() 524288, decoderInputBuffer.limit() 524288 D/EqualRateAudioReader﹕ SampleData size : 418 D/EqualRateAudioReader﹕ Presentation Time : 52244 D/EqualRateAudioReader﹕ mAudioExtractor.getSampleFlags() : 1 D/EqualRateAudioReader﹕ decoderOutputBufferIndex : 1 D/EqualRateAudioReader﹕ mAudioDecoderOutputBufferInfo.offset : 0 D/EqualRateAudioReader﹕ mAudioDecoderOutputBufferInfo.size : 4608 D/EqualRateAudioReader﹕ byteBuffer.capacity() 1048576 D/EqualRateAudioReader﹕ byteBuffer.limit() 4608 D/EqualRateAudioReader﹕ decoderOutputBuffer.capacity() 27648 D/EqualRateAudioReader﹕ decoderOutputBuffer.limit() 4608 D/SubstituteAudioEffect﹕ timeProgress 23219 D/SubstituteAudioEffect﹕ input.limit() 24576, input.capacity() 24576, byteBuffer.limit() 4608, byteBuffer.capacity() 1048576 I/AMP﹕ New frame allocated for buffer 11 I/AMP﹕ New frame allocated for buffer 0 I/AMP﹕ New frame allocated for buffer 1 I/MPEG4Writer﹕ setStartTimestampUs: 0 I/MPEG4Writer﹕ Earliest track starting time: 0 I/AMP﹕ New frame allocated for buffer 2 D/EqualRateAudioReader﹕ EqualRateAudioReader read start D/EqualRateAudioReader﹕ decoderInputBufferIndex : 3 D/EqualRateAudioReader﹕ decoderInputBuffer.capacity() 524288, decoderInputBuffer.limit() 524288 D/EqualRateAudioReader﹕ SampleData size : 418 D/EqualRateAudioReader﹕ Presentation Time : 78367 D/EqualRateAudioReader﹕ mAudioExtractor.getSampleFlags() : 1 D/EqualRateAudioReader﹕ decoderOutputBufferIndex : 2 D/EqualRateAudioReader﹕ mAudioDecoderOutputBufferInfo.offset : 0 D/EqualRateAudioReader﹕ mAudioDecoderOutputBufferInfo.size : 4608 D/EqualRateAudioReader﹕ byteBuffer.capacity() 1048576 D/EqualRateAudioReader﹕ byteBuffer.limit() 4608 D/EqualRateAudioReader﹕ decoderOutputBuffer.capacity() 27648 D/EqualRateAudioReader﹕ decoderOutputBuffer.limit() 4608 D/SubstituteAudioEffect﹕ timeProgress 46439 D/SubstituteAudioEffect﹕ input.limit() 24576, input.capacity() 24576, byteBuffer.limit() 4608, byteBuffer.capacity() 1048576

If you have any idea, please help me.

thank you.

DanhDueExOICTIF commented 8 years ago

I want to try MMS but I can't get libs folder(I can't download INDE on homepage because it is currently unavailable). So, Can you share it for me? My email: danhdue@gmail.com.

Thank so much!

marlon-b commented 8 years ago

Check your inbox!

thisIsAnil commented 7 years ago

Can you share the libs folder with me? EMail-Id - this.anil96@gmail.com