android-transcoder icon indicating copy to clipboard operation
android-transcoder copied to clipboard

getSpsBuffer get an ArrayIndexOutOfBoundsException

Open spiritedRunning opened this issue 8 years ago • 4 comments

@ypresto Thanks for your sharing the java api transcoder library, I encountered a error when I use a Huawei p7 mobile phone. And transcode failed indeed. But in my another nexus 5, it's ok. The log file:

https://drive.google.com/open?id=10YlNODWx-I7sG-BobckGWX01yIl8uYokpDCDjT-k89Q

Android version 4.4.2

Hope for your reply.

Thanks, Zach

spiritedRunning avatar Jul 23 '16 14:07 spiritedRunning

It can be caused by mp4 file which is not supported by that device. Is that video is recorded by p7 phone itself?

If not, can you check profile and level of mp4 avc video track? Useful app for checking format: http://www.pozdeev.com/invisor/

ypresto avatar Jul 24 '16 02:07 ypresto

Thanks for your reply. Actually the file is recorded by nexus 5. The video track info below using Invisor:

https://drive.google.com/open?id=1UOdVKFB0RmBUfM6_0Uw4W9Sbk138uKkN0FVjt3PvAmQ

I also tried recorded a mp4 file by p7 itself, but it seemed that can't transcode either. It has the same exception.

And this video info is below:

https://drive.google.com/open?id=1YjsDjZFV0OqPgDOwAXkrktaZVrNABY4dFtpKUSAlbvM

Thanks, Zach

spiritedRunning avatar Jul 24 '16 14:07 spiritedRunning

Could you dump contents of sourceBuffer in AvcCsdUtils.getSpsBuffer()? It is strange to only have NAL header in csd-0...

csd-0 is defined as SPS in document. So if codec does not returns it, that codec is buggy. https://developer.android.com/reference/android/media/MediaCodec.html

ypresto avatar Jul 26 '16 19:07 ypresto

It's very strange that when I tried again, I get an another error, not like this issue. so I open a new issue 27...

spiritedRunning avatar Jul 29 '16 06:07 spiritedRunning