Illegal Exception on MediaCodec.configure

℡╲_俬逩灬. 提交于 2019-12-06 05:30:56
fadden
E/ACodec﹕ [OMX.qcom.video.encoder.avc] does not support color format 19

Looks like you're trying to use color format 19 (COLOR_FormatYUV420Planar, a/k/a I420) on a Qualcomm device. A quick test on one of my devices indicates their codecs want color format 21 (COLOR_FormatYUV420SemiPlanar, a/k/a NV12).

The buffer-to-buffer tests in the EncodeDecodeTest sources show how to query the MediaCodecInfo for an appropriate color format. Since you are receiving input from the Camera, you will want to set the preview format to a semi-planar layout (NV21), and then do the U/V swap before handing it to the MediaCodec.

If you have Android 4.3 or later, you can skip all of the format gymnastics and use the Surface preview output. See the CameraToMpegTest sources for an example.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!