【问题标题】:What does error code -1010 in Android MediaCodec mean?Android MediaCodec 中的错误代码 -1010 是什么意思?
【发布时间】:2023-03-11 06:05:01
【问题描述】:

这是堆栈跟踪:

 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)

在 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);

【问题讨论】:

    标签: android android-mediacodec


    【解决方案1】:

    我在尝试将 16:9 视频编码为 .h264 并更改帧大小时遇到​​了这个问题(它适用于 4:3)。

    对我来说,解决方法是确保输出格式的高度和宽度可以被 2 整除。如果不是,我只是将它们四舍五入。

    【讨论】:

      【解决方案2】:

      这似乎是 Qualcomm 编解码器实现 (OMX.qcom.video.encoder.avc) 报告的内部错误。

      它可能是harmless,它可能表示configuration problem,或不同的configuration problem,或其他一些configuration problem。大多数情况下,它似乎只是表明它不喜欢您的配置,而没有提供任何具体的原因。

      错误代码有些无用,因此您必须从已知有效的值开始,一次更改一个,直到出现问题。您传递的比特/帧速率的实际值是多少?

      【讨论】:

      • 在使用 Surface 输入设置编码器时,不应将 Surface 传递给 `configure()´ 调用,仅当使用解码器解码到 Surface 时。
      猜你喜欢
      • 2015-05-18
      • 1970-01-01
      • 2015-05-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多