title: Concatenate mp4 files in Android using halfninja ffmpeg
body: <p>I've manage to compile <a href="https://github.com/halfninja/android-ffmpeg-x264">halfninja ffmpeg scripts</a> for Android NDK using NDK version r5c. (Unfortunately any attempt to compile with earlier NDK generated some error), also I'm not very knowledgeable on the whole NDK process, so it's a bit hit-n-miss for me.</p>
  
  <p>His scripts are compiling ffmpeg version N-30996-gf925b24 (the specific commit he did the scripts for)</p>
  
  <p>Moving forward to my actual app.
  I manage to trim videos without problems, now I need to join/concatenate them but any attemp at using any and several combinations of the commands found on those 3 links (<a href="http://www.ffmpeg.org/ffmpeg-filters.html#Examples-1">link1</a>, <a href="http://ffmpeg.org/faq.html#How-can-I-concatenate-video-files_003f">link2</a>, <a href="http://ffmpeg.org/trac/ffmpeg/wiki/How%20to%20concatenate%20%28join,%20merge%29%20media%20files">link3</a>) generate errors such as <code>cat is not valid</code>, <code>&gt; is undefinined</code>, <code>unknown option filter_complex</code> or trying to override some of the input files.</p>
  
  <p>Does anyone know if it's possible and (how to do it), to join/concatenate mp4 videos (all same codec, size, quality, etc) using half-ninja compile of ffmpeg on Android, or how to compile/get a ffmpeg for Android using latest source codes?</p>
  
  <p>I've also gave a quick try on the <a href="https://code.google.com/p/mp4parser/">mp4Parser</a> without much success.</p>
  
  <p>ultimately I was trying to get this pseudo-method to work:</p>
  
  <pre><code>public static File concatenate(String[] inputPaths, String outputPath){
  
      // ... do stuff do generate ffmpeg commands....
      VideoKit v = new VideoKit();
      v.run(cmds);
  
      File f = new File(outputPath);
      return f;
  }
  </code></pre>