【发布时间】:2015-09-08 06:50:32
【问题描述】:
我将“csd-0”和“csd-1”设置为MediaCodec by MediaFormat 如下:
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 format = MediaFormat.createVideoFormat("video/avc", width, height);
format.setByteBuffer("csd-0", ByteBuffer.wrap(sps));
format.setByteBuffer("csd-1", ByteBuffer.wrap(pps));
...
但我得到了这样的错误:
E/MtkOmxVenc( 6724): Error: BufferType is not Gralloc Source !!!!
F/libc ( 6724): Fatal signal 11 (SIGSEGV) at 0x28006467 (code=1), thread 7500 (MtkOmxVencEncod)
所以我想尝试设置 Gralloc 源来修复它。有什么建议吗?
【问题讨论】:
标签: android encode android-mediacodec