With an effort, I wrote a demo which can record a h264/aac video successfully. I use MediaCodec and MediaMuxer which are both available since api-18. To avoid that the color formats for the camera output and the MediaCodec encoder input are different, I chose the color format "MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface" according to the continous capture activity of grafika. But I am worrying about one thing, there are so many kinds of Android phones, Can my demo record video successfully on any android mobile phone with api-18 or higher.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There are few guarantees in life, but the Android CTS tests attempt to ensure that all devices correctly perform certain actions. It sounds like what you're doing makes use of features covered by CTS, so the chances of success are very good, but there can always be exceptions.
For this or any app, it's good to test on as many different devices as possible.