Thursday, October 26, 2017

FFmpeg unpacks the video container as separate raw video data and audio data in a native layer. Then, the raw video data is transferred into MediaCodec’s APIs in the Java layer for hardware decoder



FFmpeg has supported Android since the 2.1 release, but the FFmpeg package did not have a build script for x86 on Android. Following are the steps for how to build FFmpeg for Android on x86:
  1. On FFmpeg's web site, download the latest FFmpeg release: ffmpeg-2.2.4.tar.bz2 [2]. 
  2. Copy the FFmpeg package to a Ubuntu* build machine and extract using this “tar” command:
    wangsy@ubuntu:~/Desktop$  tar  xvf  ffmpeg-2.2.4.tar.bz2
  3. Set up ANDROID_NDK_HOME environment with the "export" command: 
    export  ANDROID_NDK_HOME= $ ANDROID_NDK_HOME :/~/android-ndk-r9c
  4. Copy the following configuration file to ~/ffmpeg-2.2.4 and add the "run" permissions: 
    wangsy@ubuntu:~/Desktop$  cp  config_build_x86.sh  ~/ffmpeg-2.2.4
    wangsy@ubuntu:~/Desktop$  sudo chmod  a+x  ~/ffmpeg-2.2.4/config_build_x86.sh
    
    Config Build Icon
  5. Run the configuration script and build using the “make” and “make install” commands: 
    wangsy@ubuntu:~/Desktop/ffmpeg-2.2.4$  make 
    wangsy@ubuntu:~/Desktop/ffmpeg-2.2.4$  make install
The generated Android for x86 libs are under ~/Desktop/ffmpeg-2.2.4/android/x86/lib$.  
Developers can copy these generated libs for development. Because YASM [3] assembler compiler and Intel® Streaming SIMD Extensions (Intel® SSE) [4] are enabled in the config_build_x86.sh, the generated Android for x86 libs are optimized for high performance on Intel Atom-based Android platforms.

No comments: