Combine MP4/M4V Files in Linux/Ubuntu

(1 vote, average 5.00 out of 5)

You may want to combine multiple mp4/m4v video files into one continuous video. In order to do this, you need to install the gpac library of programs onto Ubuntu. Open up Terminal and run:

sudo apt-get install gpac

 

This will install the gpac library. One of the programs included with it is MP4Box, which you can use to concatenate the video files. If you are using 64 bit Linux or get an error like MP4Box: error while loading shared libraries: libgpac.so: cannot open shared object file: No such file or directory, then you need to link the shared library to /usr/lib:

sudo ln -s /usr/local/lib64/libgpac.so /usr/lib/libgpac.so

 

Now to convert your files, add -cat filename.mp4 for each of your files to this command, with -new combinedfile.mp4 as your output, combined file:

MP4Box -cat vid1.mp4 -cat vid2.mp4 -cat vid3.mp4 -new combinedfile.mp4

 

Once the process finishes, your combined video file will be in combinedfile.mp4.

Partner Links:
 
Related Articles

» Redirect STDOUT And Other File Descriptors To A File in Bash

It is possible to redirect the output of a single command in Bash to a file using the > convention. For example, to redirect the STDOUT output to a file, use: ls -l > myfile.txt  However sometimes it would be better to redirect all output from multiple commands to a single file. This can be used by modifying the file descriptor, 1. First, we save a backup of the file handle for STDOUT and then change it to point to the desired file. We can then later restore STDOUT from the...

» How to Completely Remove Skype and Other Applications from your Computer

Sometimes uninstalling programs is not as straight forward as going to the 'Add/Remove Programs' or using the uninstall link provided with the program.  Skype is a great application, but for certain reasons you may want to completely get rid of it from your computer.  This article is going to focus on removing Skype from a Windows 7 based PC, but the steps should be very similar for Vista or XP.  Note: You may be able to follow the steps in this guide to completely remove other...

» Make the Linux or Mac OS X Command Line Easier with .bashrc

Starting to use the command line (or terminal) in Linux or Mac OS X can be very daunting. It is indeed a complex task to learn all of the commands and how to use them together properly. Despite the learning curve, using the command line can make a lot of tasks significantly faster and easier. One way to make the terminal easier to use is by creating a .bashrc file.Most Linux distributions (and Mac OS X) use the as the default terminal shell (although I've heard some ). When initializing, Bash...