0
votes

I am trying to use the MediaCodec API to decoding H264 stream with Android client. sample code:

int decoderStatus = decoder.dequeueOutputBuffer(mBufferInfo, TIMEOUT_USEC); 

When the remote H264 stream resolution size is bigger (eg: 1600*1200), this function will always return -1(MediaCodec.INFO_TRY_AGAIN_LATER), so the decode will failed but can not catch any exception. if the resolution is lower (eg 1920*1080, 1280*720), the decode machanism works OK.

this only happens on some Samsung devices: Galaxy S3, Note2, and note.

I also check these machines that supported H264 profile Level, and they are all Level 4 devices and can support maximum resolution size 2048*1024 theoretically (https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels).

Does someone meet this problem? I try to modify the parameters when queueInputBuffer and dequeueOutputBuffer but failed to fix it.

1

1 Answers

1
votes

this reason is due to the Samsung devices which use the EXYNOS4412/EXYNOS4210 processor. these type of processor use the Mali-400 MP4 GPU.

The SoC integrates an ARM Mali-400 MP4 GPU (15.8 GFLOPS at 440 MHz). Typical smartphone games (2012) will run fluently even in high resolutions like 1280 x 720 pixels. Videos can be accelerated by a multi-format video decoder (1080p AVI, WMV, H.264, H.263, VC1, MPEG2, MPEG4). (http://www.notebookcheck.net/Samsung-Exynos-4412-Quad-ARM-SoC.86876.0.html)

So if the video resolution exceed 1080P the decoder will become frozen.