Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.)

share|improve this question

marked as duplicate by Daniel Beck, Diago Dec 30 '10 at 18:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Possible dupe: superuser.com/questions/173300/… –  afrazier Dec 30 '10 at 16:16
add comment

2 Answers

up vote 4 down vote accepted

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

  2. MP4Box

    MP4Box -add file1.mp4 -add file2.mp4 output.mp4

share|improve this answer
    
I had to tweak these to get it to work: 1) mencoder can't use "-oac copy" on AAC streams for whatever reason; I have to tell it to re-encode on the fly. 2) I ended up using MP4Box, but the example provided overlays the two video and audio streams. The following command works (use -cat instead of -add for second file): "MP4Box -add file1.mp4 -cat file2.mp4 output.mp4" In the end it made the audio out of sync though, so I still have no good solution. –  Jer Jan 3 '11 at 16:35
add comment

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.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.