Tech

How to join multiple avi files using ffmpeg without any editing software



Let’s say you have multiple avi files and you want to combine them into a single video. If you use video editing software, you can accomplish this goal by arranging multiple videos in a timeline and exporting them, but it takes a lot of time and effort.

However, if you use the ffmpeg software I am going to introduce here, you can do this with just a few lines of commands as long as you have the environment ready.

I am on Twitter. Or Contact us here.

How to install ffmpeg

  1. Go to the ffmpeg download page.
  2. Click the “Download” button.
  3. Select the OS that suits your PC.
    ※This article is based on Windows, so select Windows.
  4. From “Windows EXE Files”, select “Windows builds by Zeranoe”.
  5. Select “Windows builds by Zeranoe” from “Windows EXE Files”.
    ※There is no need to change the basic settings since they are automatically selected.
  6. If you download the file as it is, a zip file called “ffmpeg-20200115-0dc0837-win64-static” will be downloaded, so extract it.
    Next, rename the extracted folder to “ffmpeg” and save it in “C:\Program Files”.

    It is not necessary to save the file in “C:\Program Files”, but it will make it easier to work with later.

  7. If you can confirm that there is a folder called “ffmpeg” in “C:\Program Files”, the ffmpeg download process is complete.

Setting up after downloading

  1. Display the “System” screen.

    Press “Control Panel” – “System and Security” – “System”.
    Press “Control Panel” – “System” – “Security” – “System” or “Win + Pause/Break” key simultaneously.

  2. “Select “Advanced System Settings.
  3. Select “Environment Variables (N)” in the “Advanced” tab.
  4. With “Path” selected, select the “Edit (E)” button.
  5. “Click the [New] button and select the folder “C:\Program Files\ffmpeg\bin” that you just saved and select the [OK] button.
  6. The basic settings are described above, but let’s check the following steps to make sure the settings are correct.
  7. At the command prompt, type “ffmpeg -version”.
  8. If you get the following result, you have successfully configured the settings.

Use ffmpeg to combine avi files

Working Environment

Assume that you are logged in as user “test” and you want to merge two files, “image01.avi” and “image02.avi”, which are located in the folder “movie” on your desktop.

The command to be executed depends on your user name, the name of the video file you are going to work on, and the folder where the file is stored, so please be flexible and change it.

  1. Create a text file called “files.txt” on your desktop.
  2. The contents should be described as follows.
    file 'C:\Users\test\Desktop\movie\Image01.avi' file 'C:\Users\test\Desktop\movie\Image02.avi'
  3. Open a command prompt and execute the following command.
    ffmpeg -safe 0 -f concat -i "C:\Users\test\Desktop\files.txt" -c:v copy -c:a copy -c:s copy -map 0:v -map 0:a -map 0:s? "C:\Users\test\Desktop\output.avi"
    At this time, the options should be set as follows.

    • If there is no audio in the avi file, delete “-map 0:a” from the above command.
    • If the avi file does not have subtitles, delete “-map 0:s?” from the above command.
    • If there is no audio or subtitles in the avi file, delete “-map 0:a -map 0:s?” from the above command.
    • If the avi file does not have audio or subtitles, delete “-map 0:a -map 0:s?” from the above command.
      ※In other words, the code introduced here is an example of an avi file with audio and subtitles.
  4. When you see the file “output.avi” saved on your desktop and the contents properly merged, you are done.

conclusion

It is a bit time-consuming considering the initial setup from downloading, but once the setup is done, you can easily merge by just executing commands.

This is a recommended method for those who regularly have to merge multiple video files.

https://www.xdomain.ne.jp/

I am Japanese, and my computer is set up in Japanese. Because I am Japanese and my computer is set up in Japanese, there may be some differences in the names of buttons and windows.

I try to keep the information on this site (tamocolony) up-to-date, but please be aware that the information on this site may not be the most up-to-date, or the information itself may be incorrect. We take no responsibility for the content of this site. If you have any questions about an article or need to make corrections, please contact us via the Contact Us page.