How to solve the Android MediaCodec error after setting “csd-0” and “csd-1”?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I use the MediaCodec to encode video stream and i need to set the "csd-0" and "csd-1" as following according to here : 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)); ... But i got an error: format: {frame-rate=15, height