在用AndroidMediaCodec编码h264的时候,会遇到,dequeueOutputBuffer在成功获取到config帧(sps pps)及第一个I帧后,dequeueOutputBuffer然后结果一直为-1的情况, 在我用的三星note3及小米3都是这样的,解决方案如下: 关键在下面这个函数的第四个参数上,就是时间戳,这个参数一定要填写,可以类似的这么简单的算一下: long ...
The other reasonMediaCodec.dequeueOutputBuffermay return -1 is that it is still doing work to decode a frame. So you would need to queue end-of-stream then dequeue until you receive the end-of-stream buffer to know thatMediaCodechas finished processing the input completely. I think this addr...
ionicwang1楼•2 个月前
dequeueOutputBuffer总是返回-1ENMediaCodec类Android提供的用于访问低层多媒体编/解码器接口,它是Android...
int index = m_MediaCodec.dequeueOutputBuffer(m_BufferInfo, 0);//这里老是返回-1while (index >= 0) {ByteBuffer outPutByteBuffer = m_MediaCodec.getOutputBuffer(index);byte[] outDate = new byte[m_BufferInfo.size];outPutByteBuffer.get(outDate);m_MediaCodec.releaseOutputBuffer(index, false);index...