Many years ago, in times when eMule (aMule on Linux) was the king downloader, I think we were all a little less legal than we are now. Who else for less, we all downloaded a movie from time to time, and sometimes we had to download two 700mb videos (what could fit on a CD). What can we do to reproduce a movie like this? Well, it's very simple: we can reproduce one after the other or, from what this article is about, join videos.
And what is the best way to do it on Linux? Although FFmpeg is also for other platforms, for one reason or another we have it installed on practically any Linux distribution, so it will be the software that we will use. Sure we could take an editor like Kdenlive and put them together, where we could also take away a few seconds that could be repeated at the end of the first and the beginning of the second video, but converting / rendering it would take a long time. With FFmpeg it is less easy, but much faster.
Stitching Videos with FFmpeg - Less Easy, Faster
The steps that we will have to take are the following:
- As it is possible, if we do not have it installed, we install FFmpeg. For this we have to install the ffmpeg package, something we can do with commands like sudo apt install ffmpeg, sudo pacman -S ffmpeg o sudo dnf -y install ffmpeg.
- With FFmpeg and with all the dependencies that it proposes installed, now we have to take the next step, which is to put the two videos in the same folder.
- Now, in the same folder, we have to create a text file with the name (without the quotes) «list.txt».
- Inside "list.txt" we have to add the names of the videos (they can be more than two). For example:
- We save the file list.txt and exit.
- In the last step, we will write a command in the terminal, which will be the following:
ffmpeg -f concat -i lista.txt -c copy -bsf:a aac_adtstoasc nombre_del_video.mp4
- We wait a moment and, at the end and in this case, we will have a video with the two parts joined called name_del_video.mp4 in the same folder where we had the two parts.
It is true that it is not the simplest way, partly because it is not so easy to remember the command than to do a couple of clicks in a tool with GUI, but it is very fast, and we can always copy and paste the command every time. we need.