How to concatenate multiple WebM files with FFmpeg
Today, I've created a screencast with some information for a colleague. Within that video, I showed him some stuff regarding GitHub Actions. Because those workflows need some time to run, and my screen recording software has no pause button, I decided to stop the first video and start the second one after the workflow was finished.
Suddenly, I was confronted with the challenge to merge the two following files into one single video file:
- Kooha-2025-09-04-17-43-30.webm
- Kooha-2025-09-04-17-48-17.webm
I asked ChatGPT how to do it via terminal on Fedora Workstation (because that's my daily driver). It gave me the following proposal:
ffmpeg -i "concat:video1.webm|video2.webm" -c copy output.webm
Unfortunately, that only produced a video file with the length of the first video but audio of both. – Strange! 😄
Instead, the following worked for me (as also described here):
ffmpeg -f concat -safe 0 -i files.txt -c copy output.webm
Whereas the files.txt needs to contain this content:
file ./Kooha-2025-09-04-17-43-30.webm
file ./Kooha-2025-09-04-17-48-17.webm