Join two h.264 movie files, merging chapters?

3

1

I have two h.264 encoded .m4v files, generated with Handbrake 0.9.3. They used the same Handbrake preset. How can I merge the two files into one movie, and do I need to do anything special to preserve chapter marks?

In case anyone is wondering, they are "An Evening with Kevin Smith", discs 1 and 2. I also own an older copy of "Se7en" which has the movie split between two sides, so I'll run into this issue eventually when I rip/encode that movie.

Bob King

Posted 2009-07-21T02:26:55.237

Reputation: 996

Answers

1

Do you have QuickTime Pro?

It's possible to copy and paste H.264 timelines and merge them together with requiring a re-encode.

Chealion

Posted 2009-07-21T02:26:55.237

Reputation: 22 932

2

I can suggest converting these to mpeg1 first and using a simple concatenate:

cat vid1.mpeg vid2.mpeg > combined.mpeg

More details in: ffmpeg faq. Handbrake uses ffmpeg.

Evert

Posted 2009-07-21T02:26:55.237

Reputation: 206

And then do I just rerun this through Handbrake? Will that degrade quality too much? – Bob King – 2009-07-21T02:55:39.183

I would personally just do everything with ffmpeg. Re-encoding a file multiple times will absolutely degrade the quality.

If it was pretty high quality at the start, and you're using 'good' settings I would doubt you will see a big difference though. You need to have a pretty trained eye :) – Evert – 2009-07-21T03:48:33.880

1

I made a list of various joining utilities. https://spreadsheets.google.com/ccc?key=0AjWmZ0umsuZHdHNzZVhuMTkxTHdYbUdCQzF3cE51Snc&hl=en in general Enjoy!

rogerdpack

Posted 2009-07-21T02:26:55.237

Reputation: 1 181

1

This is the script I use to join my iPhone movies into ONE iPhone movie.

!#bin/bash

SOURCE_DIR=/mnt/media/images/iPhone

for f in `find $SOURCE_DIR -iname '*.mov' | sort`; do
    clip_name=`basename $f .MOV`.dv
    ffmpeg -i $f -y -target pal-dvd -s 1280x720 $clip_name
done;

cat *.dv > out.mov

HandBrakeCLI -i out.mov -o out.m4v --preset="iPhone 4" --quality=30

Bjarte Brandt

Posted 2009-07-21T02:26:55.237

Reputation: 206

1Does it still look good? You're basically compressing twice here. – slhck – 2011-11-21T23:47:52.830

You are right, but the end-result is good. – Bjarte Brandt – 2011-11-22T07:42:21.320