Strange error from OMX.google.h264.encoder using MediaCodec API

I cannot create a media / avc encoder when using OMX.google.h264.encoder, I get a rather strange conclusion:

I/VideoStreamer﹕ Selected color format: 21 I/VideoStreamer﹕ Format: {height=480, slice-height=480, crop-left=0, width=640, crop-bottom=480, crop-top=0, mime=video/avc, stride=640, crop-right=640} I/VideoStreamer﹕ Width: 640 Height: 480 I/OMXClient﹕ Using client-side OMX mux. I/SoftAVCEncoder﹕ Construct SoftAVCEncoder I/ACodec﹕ setupVideoEncoder succeeded E/OMXNodeInstance﹕ OMX_GetExtensionIndex failed E/SoftAVCEncoder﹕ Failed to initialize the encoder: -8 E/ACodec﹕ [OMX.google.h264.encoder] ERROR(0x80001001) E/MediaCodec﹕ Codec reported an error. (omx error 0x80001001, internalError -2147483648) 

While the code works on other devices. How can I understand why OMX.google.h264.encoder fails with such a useless error?

For reference: I look at the list of available encoders and then check the list of supported color formats. I am working on several errors when a device crashes in color format 19, forcing it to use color format 21. I can provide code samples, but this is a specific encoder, and I am at a loss how to understand what this error tells me.

EDIT: Found AVCENC_LEVEL_FAIL to crash, but still not sure what this tells me. As far as I know, it is not possible to set the level that the AVC encoder should use.

+6
source share
1 answer

The problem with your device is that it probably does not have a hardware encoder. The h264 software codec has significantly limited functionality, among other things, it disables high-quality profiles , since they will probably not work enough on lower-class devices.

If you are working on your own, a user device, you can remove this restriction by setting the encoder level to AVC_LEVEL5_1 . This will unlock your stagefright library and you can encode high-quality videos using a software codec.

+1
source

Source: https://habr.com/ru/post/973783/


All Articles