Chi*_*ick 7 android mediacodec
这是堆栈跟踪:
E/ACodec: [OMX.qcom.video.encoder.avc] configureCodec returning error -1010
E/ACodec: signalError(omxError 0x80001001, internalError -1010)
E/MediaCodec: Codec reported err 0xfffffc0e, actionCode 0, while in state 3
E/MediaCodec: configure failed with err 0xfffffc0e, resetting...
W/System.err: android.media.MediaCodec$CodecException: Error 0xfffffc0e
W/System.err: at android.media.MediaCodec.native_configure(Native Method)
W/System.err: at android.media.MediaCodec.configure(MediaCodec.java:1778)
Run Code Online (Sandbox Code Playgroud)
崩溃在Nexus 6P上.
mediaCodec的初始化:
videoCodec = MediaCodec.createEncoderByType(MIME_VIDEO_CODEC_H264);
MediaFormat videoFormat = MediaFormat.createVideoFormat(MIME_VIDEO_CODEC_H264, imageWidth, imageHeight);
videoFormat.setInteger(MediaFormat.KEY_BIT_RATE, camera.getBitrate());
videoFormat.setInteger(MediaFormat.KEY_FRAME_RATE, camera.getFrameRate());
videoFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);
videoFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 0);
videoCodec.configure(videoFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
Run Code Online (Sandbox Code Playgroud)
当我尝试将16:9视频编码为.h264并更改帧大小时(我以4:3的方式工作正常),我遇到了这个问题.
对我来说,修复是确保输出格式的高度和宽度可被2整除.如果不是,我只是将它们四舍五入以便它们完成.
| 归档时间: |
|
| 查看次数: |
5497 次 |
| 最近记录: |