6

Possible Duplicate:
How can I merge or concatenate two or more MP4 files creating another MP4 file?

I recently ripped my DVD collection to play them on my media center PC, and several of them are two-disc movies (i.e. The Lord of the Rings). Since I ripped each DVD individually, that gives me two video files for some movies.

I am using Ubuntu Linux - how can I concatenate these two MP4/H.264 videos into a single MP4 video file? Preferably from the command line, and without re-encoding everything during the process (although I can try figuring out a video editor like Pitivi if that's the only solution.)

Jer
  • 63

2 Answers2

14

There are two ways you can do this.

  1. Using Mencoder
mencoder file1.mp4 file2.mp4 -ovc copy -oac copy -of lavf format=mp4 -o output.mp4
  1. MP4Box
MP4Box -add file1.mp4 -cat file2.mp4 output.mp4 

Note the use of '-add' for the first file and '-cat' for second file; if you mistakenly use '-add' for the second file - you will lose the first file's content.

Trect
  • 103
tHeSiD
  • 387
1

Hunt down or build mp4box for your system. It's cli. I don't know of any linux guis for it, but I'm sure some exist.

Install MP4Box

sudo apt install gpac
Trect
  • 103
afrazier
  • 23,505