<p>From <a href="http://www.ffmpeg.org/faq.html#Concatenating-using-the-concat-protocol-_0028file-level_0029" rel="nofollow">FFmpeg FAQ</a>:</p>

<blockquote>
  <p>A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to
  concatenate video by merely concatenating the files containing them.</p>
</blockquote>

<p>Hence you may concatenate your multimedia files by first transcoding them to these privileged formats, then using cat command (or copy under Windows), and finally transcoding back to your format of choice.</p>

<pre><code>ffmpeg -i input1.avi -qscale:v 1 intermediate1.mpg
ffmpeg -i input2.avi -qscale:v 1 intermediate2.mpg
cat intermediate1.mpg intermediate2.mpg &gt; intermediate_all.mpg
ffmpeg -i intermediate_all.mpg -qscale:v 2 output.avi
</code></pre>

CC BY-SA 3.0
2013-08-07T18:54:46.563Z
If I want to keep image quality, I have to use mpeg with high bitrate which both create big intermediate files and time consuming. Which settings should I choose to save processing time?
Dzung Nguyen
CC BY-SA 3.0
2013-08-07T04:07:12.297Z
2013-08-07T05:02:00.730Z
2013-08-07T05:02:00.730Z
Eugene S
<p>Which video format allows concatenation simply by joining files?</p>

<pre><code>cat out1.mp4 ou2.mp4 &gt;out.mp4
</code></pre>

<p>These videos are created from images using ffmpeg:</p>

<pre><code>ffmpeg -loop 1 -f image2 -i image.png -s 640x480 -vcodec libx264 -t 30 -y out.mp4
</code></pre>

<p>If you can give me a running example it'd be great.</p>

<video><file-formats><conversion>
Join videos through concatenation
Dzung Nguyen
# Join videos through concatenation

(Asked by: username_0 on 2013-08-06)

Which video format allows concatenation simply by joining files?
cat out1.mp4 ou2.mp4 >out.mp4

These videos are created from images using ffmpeg:
ffmpeg -loop 1 -f image2 -i image.png -s 640x480 -vcodec libx264 -t 30 -y out.mp4

If you can give me a running example it'd be great.

**Tags:** video, file-formats, conversion


---

## 1 answers

### Answer by username_1 on 2013-08-07. Score: 0 | Accepted answer

From FFmpeg FAQ:

A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to
  concatenate video by merely concatenating the files containing them.

Hence you may concatenate your multimedia files by first transcoding them to these privileged formats, then using cat command (or copy under Windows), and finally transcoding back to your format of choice.
ffmpeg -i input1.avi -qscale:v 1 intermediate1.mpg
ffmpeg -i input2.avi -qscale:v 1 intermediate2.mpg
cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg
ffmpeg -i intermediate_all.mpg -qscale:v 2 output.avi

> **Comments:**
> **username_0**: If I want to keep image quality, I have to use mpeg with high bitrate which both create big intermediate files and time consuming. Which settings should I choose to save processing time?  

---

