osx - Concatenating videos (mp4) in Mac

  • Sridhar Ratnakumar

    I got a bunch of mp4 videos (different parts of a same film) downloaded from YouTube. Is there a way to join them to make a single video? I have a Macbook.

  • Answers
  • Sridhar Ratnakumar

    Since those youtube videos probably come in a codec Apple software understands, you could open iMovie (comes with every mac), drag the mp4 files to the program and then concatenate them, with the addition of being able to edit the clips, adjust their sounds, etc.

    1. Start with an empty project in iMovie.
    2. Drag one file into iMovie.
    3. Drag another one into iMovie.
    4. Now that both are imported, you can arrange them in the timeline of your project.

    Check the iMovie manual for more information on how to do this.

    The problem with iMovie is that during importation the files are recompressed into Apple's intermediate codec, exploding the required file size for the project (tends to go into the GB range).

    Similar software to what has already been suggested is MPEG Streamclip, which allows you to open a video, select all, copy it to the clipboard, then open another one and paste it. It also allows minimal edition features withour requiring intermediate recompression of the source files, but the interface is not polished and easy to use as iMovie.

  • mouviciel

    Quicktime 7 Pro is able to concatenate videos.

    Alternatively, you can write a SMIL file describing a movie composed of a sequence of your videos:

        <root-layout width="640" height="480" background-color="gray" />
        <region id="main" width="100%" height="100%" fit="fill" />
    <video region="main" src="myVideo001.mov" />
    <video region="main" src="myVideo002.mov" />
    <video region="main" src="myVideo003.mov" />
    <video region="main" src="myVideo004.mov" />

    SMIL is a format readable by Quicktime.

  • Simon Sheehan

    I wanted to add how to do it with recent Quicktime Versions (i. e. the one shipped with Lion), so users who find this thread looking for a solution (like I was) find a current answer.

    Just open the first clip and select from the menu: "EDIT" -> "Add clip at the end..." (or so, my menu is German). Select the movie you wanna add. Repeat for the other parts.

    Then select "FILE" -> "Export". This might take a while and can change the encoding of your videos, but it works without installing anything and is pretty easy.

  • T. Kaltnekar

    You can try ffmpeg. There is a Mac GUI named ffmpegX that includes ffmpeg among other things.

  • Xetius

    I use VisualHub, which is no longer produced, sold or maintained, but there are various methods of still getting hold of it.

  • Josh K

    with Mplayer: http://www.mplayerhq.hu

    you could do:

    mencoder -oac copy -ovc copy -idx -o output.mp4 video1.mp4 video2.mp4 video3.mp4

    "-oac copy" copies the audio codec "-ovc copy" copies the video codec "-idx" build the index for the resulting video

    on linux is ok, i think also on mac!

  • Related Question

    windows - How do I add another audio stream to an MP4 file?
  • RandomEngy

    I've got an MP4 video file and I want to add another AAC audio track to it. I've tried YAMB and MeGUI (frontends for MP4Box) and it plays correctly in Zoom Player, but it picks the wrong track in WMP and plays both at once in Quicktime. I think this might have to do with designating the default audio track somehow.

    Does anyone know how to specify the default audio track with YAMB/MeGUI or know of another way of adding a track to an MP4 file?

  • Related Answers
  • RandomEngy

    After a lot of scavenging around, I've found the best answer I believe. You need to use the Mp4Box command line interface to mux your MP4 file:

    mp4box -new -add original_video.mp4 -add extra_track.m4a:disable output_file.mp4

    This disable option will cause Quicktime to ignore that track and only play the main one. Quicktime doesn't have the ability to pick audio tracks because it's an awful piece of software, so that's the best you can do.

    For WMP, you can switch audio tracks, by going to full screen mode, and then right clicking on the video. It's just that it picks the wrong track by default and you have to live with that. It's a bug in WMP.

  • John T

    Avidemux2 supports MP4 editing and adding audio streams.

    Audacity should also let you do this, you will need the 1.3 Beta and FFMpeg. Instructions for installing both can be found here.