Create mp4 files on Android using Jcodec

ぐ巨炮叔叔 提交于 2019-12-02 21:13:13

Android 4.3 (API 18) has two new features that may be useful.

First, the MediaCodec class accepts input from a Surface, so anything you can decode to a Surface or render with OpenGL ES can be recorded without having to fiddle with YUV color planes.

Second, the new MediaMuxer class provides a way to combine audio and H.264 video into a .mp4 file.

Sample source code (primarily for the video aspects) can be found here.

YUV420SemiPlanar of 4x4 image is a format like YYYYYYYYYYYYYYYYUVUVUVUV, Not YYYYYYYYYYYYYYYYUUUUVVVV. I can get mp4 file with proper color using Jcodec and MediaCodec on Android after I passed a image with the format.

I don't have an answer about audio.

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