Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.6: Merging videos with cat and QuickTime X Apps
Snow Leopard only hintQuickTime 7 had this great feature of merging two videos together just by dragging a video file from the Finder to another QuickTime video. Unfortunately this is not possible in QuickTime X. But I still wanted to do it without installing additional software and came up with a solution that includes a small hack.

Assume we have 2 video files named video1.dv and video2.dv in the ~/Movies folder that we want to merge.

Open the Terminal and navigate to Movies folder

$ cd Movies

Concatenate two files

$ cat video1.dv video2.dv > video3.dv

This step will take a while and the result is a strange (I don't really want to say corrupted as it is just split in two MPEG containers) file, which will still play in most video players (I tried VLC and QuickTime X).

Open the new file in QuickTime X and re-save it.
  • File » Save As and select one of the available formats or use
  • File » Save for web and choose the desired quality
QuickTime X will re-save the file frame by frame with a proper (e.g. MOV or MP4) container.

It is of course possible to use other software (e.g. ffmpeg) and procedures.

[crarko adds: I haven't tested this one.]
    •    
  • Currently 4.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[14,551 views]  

10.6: Merging videos with cat and QuickTime X | 9 comments | Create New Account
Click here to return to the '10.6: Merging videos with cat and QuickTime X' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Merging videos with cat and QuickTime X
Authored by: ndpete21 on Nov 08, '10 08:18:47AM
I've used the same process to join mp3's. Had a directory of 100+ mp3's of an audio book so i ran cat file*.mp3 > combined.mp3 works great had no problems playing in iTunes or on the iPod.

[ Reply to This | # ]
10.6: Merging videos with cat and QuickTime X
Authored by: lowbatteries on Nov 08, '10 08:36:09AM

Nice hint! Probably works with other video editing software too.

Note that if anybody is missing features from QuickTime 7, you can still download it at http://support.apple.com/kb/dl923 (they even still sell QuickTime Pro).



[ Reply to This | # ]
10.6: Merging videos with cat and QuickTime X
Authored by: applemandesign on Nov 08, '10 08:41:13AM

it works as advertised .



[ Reply to This | # ]
10.6: Merging videos with cat and QuickTime X
Authored by: glusk on Nov 08, '10 08:48:03AM

As you noted, sometimes multiple files don't play when concatenated together. Thanks for the note on QuickTime 10, though, I'll try it more often.

One of the tools I use to fix these files is MPEG Streamclip. In addition to the usual tools VLC and Mplayer of course.



[ Reply to This | # ]
10.6: Merging videos with cat and QuickTime X
Authored by: asmeurer on Nov 08, '10 09:22:10AM

So does this only work with .dv files, or will it work with other movie formats too?



[ Reply to This | # ]
10.6: Merging videos with cat and QuickTime X
Authored by: mkuron on Nov 08, '10 09:46:11AM

I'm guessing this only works on container formats that don't have header information etc. so that the file just contains the video stream. So transport streams and DV streams are the only thing I'd expect to work.



[ Reply to This | # ]
10.6: Merging videos with cat and QuickTime X
Authored by: lar3ry on Nov 09, '10 07:02:07AM

I've found concatenation works on MPEG-container files. It never occurred to me to have QuickTime re-"save" the resulting file. Good hint!



[ Reply to This | # ]
10.6: Merging videos with cat and QuickTime X
Authored by: lsequeir on Nov 10, '10 05:52:25AM

As someone mentioned MPEGStreamClip, I remembered that I used to do this kind of stuff in it.

It can save time by avoiding copying everything twice.
Here is how it can be done, for, say, concatenating Movie2 at the end of Movie1:

- Open Movie2 in MPEGStreamClip. Mark the section of the movie that you want (for the whole thing, you can type I (for in) at the beginning, then scrub to the end and type O (for out)) and Cmd-C to copy it
- Open Movie1 in MPEGStreamClip. Scrub to the end and do Cmd-V to paste
- Save under a new name

---
Luís



[ Reply to This | # ]
10.6: Merging videos with cat and QuickTime X
Authored by: EatingPie on Nov 11, '10 08:09:47PM

This will work with transport stream based formats. That includes HDV, .ts and .m2ts (blu-ray). Program Stream like .vobs on DVDs won't work. I'm not sure what .dv is, but I'm pretty sure it's a .ts file.

---
-Pie



[ Reply to This | # ]