Combine MP4/M4V Files in Linux/Ubuntu

by Andrew Martin @http://www.thetechrepo.com/

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.

source: http://www.thetechrepo.com/main-articles/530-combine-mp4m4v-files-in-linuxubuntu

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s