<ol>
<li>Create a file named <code>FileList.txt</code> with the content:</li>
</ol>
<pre><code>file full/path/to/Video001.mp4
file full/path/to/Video002.mp4
file full/path/to/Video003.mp4
.
.
.
file full/path/to/Video030.mp4
</code></pre>
<p>One could use the full path instead<br />
2. Run <code>ffmpeg -f concat -safe 0 -i FileList.txt -c copy MergedFile.mp4</code>.<br />
3. In case of the error <code>Could not find tag for codec pcm_alaw in stream #1</code> or something related to PCM audio, know that <code>FFMPEG</code> can't generate an <code>MP4</code> file with <code>PCM</code> audio. Hence chose another container: <code>ffmpeg -f concat -safe 0 -i FileList.txt -c copy MergedFile.mkv</code> or encode the audio: <code>ffmpeg -f concat -safe 0 -i FileList.txt -c:v copy -c:a aac MergedFile.mkv</code>.</p>
<p><strong>Remark</strong><br />
The answer is based on:</p>
<ul>
<li><a href="https://stackoverflow.com/questions/7333232">StackOverflow - How to Concatenate Two MP4 Files Using <code>FFMPEG</code></a>.</li>
<li><a href="https://stackoverflow.com/questions/47495713">Handling PCM Stream in MP4 File in <code>FFMPEG</code></a>.</li>
</ul>

CC BY-SA 4.0
2022-03-06T19:02:45.897Z
2022-03-06T19:11:07.120Z
2022-03-06T19:11:07.120Z
Royi
<p>I have few video files I'd like to merge.</p>
<p>I'd like to create a single video of them without any compression, just one after another.</p>
<p>How can it be done using <code>FFMPEG</code>?</p>
<p>For the answer we may assume the files are named:</p>
<pre><code>Video001.mp4
Video002.mp4
Video003.mp4
.
.
.
Video030.mp4
</code></pre>
<p>If there a way to automate (Something like <code>Video*.mp4</code>) it would be great.</p>

CC BY-SA 4.0
2022-03-06T18:43:39.340Z
Related https://stackoverflow.com/questions/7333232.
Royi
<ffmpeg><lossless>
Merge / Concatenate Video Files in a Lossless Manner (No Encoding / Compression)
Royi
# Merge / Concatenate Video Files in a Lossless Manner (No Encoding / Compression)

(Asked by: username_0 on 2022-03-06)

I have few video files I'd like to merge.
I'd like to create a single video of them without any compression, just one after another.
How can it be done using FFMPEG?
For the answer we may assume the files are named:
Video001.mp4
Video002.mp4
Video003.mp4
.
.
.
Video030.mp4

If there a way to automate (Something like Video*.mp4) it would be great.

**Tags:** ffmpeg, lossless

> **Comments:**
> **username_0**: Related https://stackoverflow.com/questions/7333232.  

---

## 1 answers

### Answer by username_0 on 2022-03-06. Score: 1 | Accepted answer

Create a file named FileList.txt with the content:

file full/path/to/Video001.mp4
file full/path/to/Video002.mp4
file full/path/to/Video003.mp4
.
.
.
file full/path/to/Video030.mp4

One could use the full path instead
2. Run ffmpeg -f concat -safe 0 -i FileList.txt -c copy MergedFile.mp4.
3. In case of the error Could not find tag for codec pcm_alaw in stream #1 or something related to PCM audio, know that FFMPEG can't generate an MP4 file with PCM audio. Hence chose another container: ffmpeg -f concat -safe 0 -i FileList.txt -c copy MergedFile.mkv or encode the audio: ffmpeg -f concat -safe 0 -i FileList.txt -c:v copy -c:a aac MergedFile.mkv.
Remark
The answer is based on:

StackOverflow - How to Concatenate Two MP4 Files Using FFMPEG.
Handling PCM Stream in MP4 File in FFMPEG.


---

