title: Concat video files with ffmpeg-android
body: <p>I am using <a href="http://writingminds.github.io/ffmpeg-android-java/" rel="nofollow noreferrer">ffmpeg-android</a> to concat two video files,bur it takes too long to concat and I guess it because of using  <code>"-filter_complex"</code> but that was the only command I found on internet,can please someone simplify the below command? I just want to concat two video files captured by <code>camera2</code> api without any modifications.</p>
  
  <pre><code> String command[] = new String[]{
                          "-y",
                          "-i", firstPath,
                          "-i", secondPath,
                          "-strict",
                          "experimental",
                          "-filter_complex",
                          "[0:v]scale=iw*min(1920/iw\\,1080/ih):ih*min(1920/iw\\,1080/ih)," +
                                  "pad=1920:1080:(1920-iw*min(1920/iw\\,1080/ih))/2:(1080-ih*min(1920/iw\\,1080/ih))/2,setsar=1:1[v0];[1:v] scale=iw*min(1920/iw\\,1080/ih):ih*min(1920/iw\\,1080/ih)," +
                                  "pad=1920:1080:(1920-iw*min(1920/iw\\,1080/ih))/2:(1080-ih*min(1920/iw\\,1080/ih))/2,setsar=1:1[v1];[v0][0:a][v1][1:a] concat=n=2:v=1:a=1",
                          "-ab", "48000", "-ac", "2", "-ar", "22050", "-s", "1920x1080", "-vcodec", "libx264", "-crf", "27", "-q", "4", "-preset", "ultrafast", getVideoFilePath(getActivity())};
                  commandFFMPEG(command);
  
  
   private void commandFFMPEG(String command[]) {
          FFmpeg ffmpeg = FFmpeg.getInstance(getActivity());
          try {
              ffmpeg.execute(command, new ExecuteBinaryResponseHandler() {
  
                  @Override
                  public void onStart() {
                      startTime = System.currentTimeMillis();
                  }
  
                  @Override
                  public void onProgress(String message) {
  
                  }
  
                  @Override
                  public void onFailure(String message) {
  
                  }
  
                  @Override
                  public void onSuccess(String message) {
                      long endTime = System.currentTimeMillis();
                      long result = endTime - startTime;
                      Toast.makeText(getActivity(), "Videos are merged", Toast.LENGTH_SHORT).show();
                  }
  
                  @Override
                  public void onFinish() {
  
                  }
              });
          } catch (FFmpegCommandAlreadyRunningException e) {
              // Handle if FFmpeg is already running
          }
      }
  </code></pre>