The simplest case of video merging is concatenation — joining clips in sequence where all clips have identical codecs, resolutions, frame rates, and audio format. In this case, FFmpeg's concat demuxer can combine them nearly instantly without any re-encoding.
When clips differ in format, resolution, or codec, they must first be decoded and normalised to a common specification before concatenation. This re-encoding step takes time proportional to the total clip length but ensures a seamless, glitch-free output.