Open jpxiong opened 8 years ago
OMXCodec::onEvent--OMX Bad Parameter!! checkout sps and pps
It works fine on other Android Phones. So it doesn't matter about the sps and pps.
The MTK H264 decoder need the parameter csd-0 and csd-1 to init the decoder(You can get some information at http://developer.android.com/reference/android/media/MediaCodec.html). csd-0 and csd-1 stands for SPS and PPS of H264.We can use the code below to set these two parameters. byte[] sps = {0,0,0,1,103,100,0,40,-84,52,-59,1,-32,17,31,120,11,80,16,16,31 ,0,0,3,3,-23,0,0,-22,96,-108}; byte[] pps = {0,0,0,1,104,-18,60,-128}; MediaFormat mFormat = MediaFormat.createVideoFormat("video/avc", width, height); mFormat.setByteBuffer("csd-0", ByteBuffer.wrap(sps)); mFormat.setByteBuffer("csd-1", ByteBuffer.wrap(pps)); Maybe that's whay we got the OMX Bad Parameter error message.
Thanks. I will try it. I have a question: where are the sps and pps array datas from ? Is there any link for that ?
@Android4MediaPlayer It crashed :
I/libexynosv4l2( 9923): open video device /dev/video7 E/EXYNOS_LOG( 9923): HAL format is unsupported(0xe92d4010) E/EXYNOS_VIDEO_ENC( 9923): [Exynos_OMX_ExtensionSetup] unsupported color format : ANB color is 0x0 E/ACodec (10243): [OMX.Exynos.AVC.Encoder] ERROR(0x80001006) E/MediaCodec(10243): Codec reported an error. (omx error 0x80001006, internalError -2147483648) E/EXYNOS_LOG( 9923): HAL format is unsupported(0x30) E/EXYNOS_VIDEO_ENC( 9923): [Exynos_OMX_ExtensionSetup] unsupported color format : ANB color is 0x0 E/ACodec (10243): [OMX.Exynos.AVC.Encoder] ERROR(0x80001006) E/MediaCodec(10243): Codec reported an error. (omx error 0x80001006, internalError -2147483648)
encoder? HAL format is unsupported
No. I added the sps/pps what you said, then crash happened.
@Android4MediaPlayer Where are the values as the following from:
byte[] sps = {0,0,0,1,103,100,0,40,-84,52,-59,1,-32,17,31,120,11,80,16,16,31
,0,0,3,3,-23,0,0,-22,96,-108};
byte[] pps = {0,0,0,1,104,-18,60,-128};
Could you please share the link? Thanks.
It seems the decoder's error, how to solve this kind of error ? Thanks.