Good stuff for programming geeks
[ start | index | login or register ]
start > TR Joining movies

TR Joining movies

Created by tmoertel. Last edited by tmoertel 1442 days ago. Viewed 2771 times. #5
[diff] [history] [edit] [rdf]
labels
See alsoTom's Bash shell code
attachments

Here's how to concatenate movies using mplayer's mencoder and its "copy" audio and video codecs to pass thru streams untouched:

cat in1.avi in2.avi … > in-merged.avi
mencoder -oac copy -ovc copy -o output.avi in-merged.avi

Source: >>http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-fix-avi.html

For a shell script that automates this process (and also cleans up the input files), see join-avi-files in Tom's Bash shell code.

Icon-Comment pastyr, 1010 days ago. Icon-Permalink

And what about the A/V sync problem? You get significant delays between audio and video in the second part of output.avi if you do it this way and the audio track in input files is encoded in mp3 (which is usually the case).

Icon-Comment tmoertel, 1007 days ago. Icon-Permalink

Pastyr, I use the Joining-Movies recipe to join webcam/security videos, which don't have audio, and thus I haven't experienced the A/V-sync problem.

My guess is that the first movie's audio track may by slightly longer than the corresponding video track. So when the first frame of the second movie starts playing, the last bits of the first movie's audio track haven't yet finished, delaying the second movie's audio.

I'm not sure of the best way to fix such a problem. Maybe you could process the audio and video separately, joining them as the final step: extract the audio tracks, truncate each to perfectly match the corresponding video track, join them, and then combine them with the already-joined video-only movie.

Please login to post a comment.
community.moertel.com | Copyright © 2003–07 Moertel Consulting