title: How to build and use ffmpeg within android
body: <p>I am prototyping a fairly simple camera app to test out using MediaRecorder to create a custom camera activity with one snag, I want to set the aspect ratio of recorded videos to a 1x1. Through much research I have found that this is only possible by using a library like FFMPEG to crop each frame of the video to the size I desire. </p>
  
  <p>I have read many tutorials and articles on different ways to build FFMPEG into Android, but most of them are either outdated and use older versions of both the Android NDK and FFMPEG, or more recent ones just do not work when followed. I tried following the popular <a href="http://www.roman10.net/how-to-build-ffmpeg-for-android/">http://www.roman10.net/how-to-build-ffmpeg-for-android/</a>‎ and a few other similar ones that all lead to an error about a missing pkg-config file because FFMPEG is generally meant to be installed on linux or another OS apparently. I found some information about building FFMPEG in android by using a make-standalone-toolchain.sh file here <a href="http://software.intel.com/en-us/android/blogs/2013/12/06/building-ffmpeg-for-android-on-x86">http://software.intel.com/en-us/android/blogs/2013/12/06/building-ffmpeg-for-android-on-x86</a> and can't make heads or tails as to how to go about using this method. </p>
  
  <p>This now leads into my question: What is the best/proven way currently to build and use FFMPEG within android applications? If the standalone toolchain method is the way to go, is there any material better than the one listed that is easier to follow? I would even be open to a reliable template application with the FFMPEG Libraries ready to go (if this is possible); although, I would much rather know how to build this into android for future use.</p>
  
  <p>Thank you in advance for any advice or suggestions on this issue.</p>