Install GPAC first, easily from ubuntu repository:
$ sudo apt-get install gpac
Then using one of GPAC’s tool, named MP4Box, we can join or merge multiple mp4 files by concatenating into one file. With concatenating we save a huge amount of processing time which is usually spent for rendering/re-encoding.
$ MP4Box -cat file1.mp4 -cat file2.mp4 -cat file3.mp4 OutputFile.mp4