[英]on some Samsung devices decoding H264 stream at hight resolution with MediaCodec, dequeueOutputBuffer always return -1
I am trying to use the MediaCodec API to decoding H264 stream with Android client. 我正在尝试使用MediaCodec API与Android客户端一起解码H264流。 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. 当远程H264流分辨率较大(例如:1600 * 1200)时,此函数将始终返回-1(MediaCodec.INFO_TRY_AGAIN_LATER)
,因此解码将失败,但无法捕获任何异常。 if the resolution is lower (eg 1920*1080, 1280*720), the decode machanism works OK. 如果分辨率较低(例如1920 * 1080、1280 * 720),则解码机制工作正常。
this only happens on some Samsung devices: Galaxy S3, Note2, and note. 这仅在某些三星设备上发生:Galaxy S3,Note2和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 ). 我还检查了这些支持H264配置文件级别的机器,它们都是4级设备,理论上可以支持最大分辨率大小2048 * 1024( 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. 我尝试在queueInputBuffer
和dequeueOutputBuffer
时修改参数,但无法修复。
this reason is due to the Samsung devices which use the EXYNOS4412/EXYNOS4210 processor. 原因是由于使用EXYNOS4412 / EXYNOS4210处理器的Samsung设备。 these type of processor use the Mali-400 MP4 GPU. 这些类型的处理器使用Mali-400 MP4 GPU。
The SoC integrates an ARM Mali-400 MP4 GPU (15.8 GFLOPS at 440 MHz). SoC集成了ARM Mali-400 MP4 GPU(在440 MHz下为15.8 GFLOPS)。 Typical smartphone games (2012) will run fluently even in high resolutions like 1280 x 720 pixels. 即使在1280 x 720像素等高分辨率下,典型的智能手机游戏(2012年)也将流畅运行。 Videos can be accelerated by a multi-format video decoder (1080p AVI, WMV, H.264, H.263, VC1, MPEG2, MPEG4). 可以通过多格式视频解码器(1080p AVI,WMV,H.264,H.263,VC1,MPEG2,MPEG4)加速视频。 ( http://www.notebookcheck.net/Samsung-Exynos-4412-Quad-ARM-SoC.86876.0.html ) ( 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. 因此,如果视频分辨率超过1080P,则解码器将冻结。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.