less than 1 minute read

To merge two videos into one, one can leverage this cool command line tool ffmpeg.

The usage:
ffmpeg -i video1.mov -i video2.mov -filter_complex "vstack=inputs=2" video-combined.mov

FFmpeg

FFmpeg is a highly versatile framework, available for pretty much any operating system, including Linux, Mac OS X, Windows, etc., that offers functionality to work with multimedia, audio and video, of any format.

My case

I needed to vertically include two videos of my screen recording into a single one on Mac (Tahoe), so that both can be played at the same time.

My case was very simple, and that’s why I wanted a very simple way to do it quickly.

So basically, the following two lines were all I had to do, and FFmpeg did exactly I needed it to do on the very first go.

brew install ffmpeg
ffmpeg -i video1.mov -i video2.mov -filter_complex "vstack=inputs=2" video-combined.mov

The first line assumes the Homebrew is installed.

The result:

Other cases

Of course, this is only one specific example out of the vast number of features this framework provides. Check the following links to see other use cases possible with ffmpeg.

Comments