title: Concatenating videos using concat demuxer in FFMPEG is finished but video is lost in second video?
body: <p>Used concat demuxer in FFMPEG code to concat videos :-</p>
  
  <pre><code>cmd = arrayOf("-y", "-f", "concat", "-safe", "0", "-i", textFile!!.path, "-c:v", "libx264", "-crf", "23", "-preset", "ultrafast", "-c:a", "copy", outputFile.path)
  </code></pre>
  
  <p>After concatenate finished, the video one played correctly has both audio &amp; video but video two - video is missing has only audio. Output file has size &amp; time duration including two videos.</p>
  
  <p>The textFile contains :-</p>
  
  <pre><code>file '/path/to/file1'
  file '/path/to/file2'
  </code></pre>
  
  <p>Used <code>absolutePath</code> for two mp4 video files.</p>
  
  <p>Tryed this <a href="https://stackoverflow.com/questions/43536929/ffmpeg-concat-video-finished-but-the-video-missing">FFMPEG concat video finished but the video missing</a>. But no solution to my problem.</p>
  
  <p>Anything I am missing in the command.</p>