Skip to content

iocaster/FFmpegMC264Kit

Repository files navigation

FFmpegMC264Kit

FFmpegMC264Kit is a ffmpeg android library module built over android MediaCodec HW accelated encoders.
Now, you can use two new encoders - 'mc264' / 'mcaac' - instead of 'libx264' / 'aac' in runing ffmpeg command in your code.

This library module has one java helper class - LibFFmpegMC264.java - for the native ffmpeg library. And one java utility class - MC264ScreenRecorder.java - which can cast/save android screen to Netowrk/File.

Supported Color Format :

  • mc264 YUV Input : yuv420p only
  • MediaCodec YUV Input :
    NV12 (MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420SemiPlanar),
    YV12 (MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar)

Therefor the INPUT stream of ffmpeg should have the color format of YUV420Planar. Or use '-pix_fmt yuv420p' option with INPUT.
The MediaCodec of your device should have the color format YV12 [NV12]. (Other formats will be supported later)

Class Diagram

FFMeg source code for mc264/mcaac codecs is here :

https://github.com/iocaster/ffmpeg-4.0.mc264

Referenced Links :