int index = mEncoder.dequeueOutputBuffer(mBufferInfo, -1);
在執行這一句話的時候報錯如下
E/ACodec: [OMX.google.h264.encoder] ERROR(0x80001001)
signalError(omxError 0x80001001, internalError -2147483648)
E/MediaCodec: Codec reported err 0x80001001, actionCode 0, while in state 6
他會很奇怪的呼叫了stop和release
然后初始化程序如下
MediaFormat format = MediaFormat.createVideoFormat(MIME_TYPE, mWidth, mHeight);
format.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);
format.setInteger(MediaFormat.KEY_BIT_RATE, mBitRate);
format.setInteger(MediaFormat.KEY_FRAME_RATE, FRAME_RATE);
format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, IFRAME_INTERVAL);
Log.d(TAG, "created video format: " + format);
mEncoder = MediaCodec.createEncoderByType(MIME_TYPE);
mEncoder.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
mSurface = mEncoder.createInputSurface();
Log.d(TAG, "created input surface: " + mSurface);
mEncoder.start();
使用的是android5.1,API22所以只在AndroidManifest中注冊了權限,沒有動態申請權限,后來糊弄試了試也不管有
uj5u.com熱心網友回復:
那個函式回傳值不知道。。因為我會用日志列印輸出。。然后他根本不執行那句話uj5u.com熱心網友回復:
額我好像翻到了點東西應該是手機解析度的問題?在as上模擬器老是有這個問題但是到手機上不知道怎么搗鼓的就沒事了,結帖了。。。轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/60309.html
標籤:Java相關
