Editing video with mplayer / mencoder      2004.03.04 @ 6:55:25 PM
I have purchased a MainActor license years ago. It was great back then, but I can't use it anymore due to glibc incompatibilities. So I downloaded the v5 preview, but unfortunately all I get is a segfault on my 500Mhz Celeron : ( 
I really needed to edit and merge some wmf videos captured in a windows box. The resulting video was supposed to play on a windows box as well, for which I could have used a windows machine to edit them.. but

1- I couldn't find any free video editor for W2000, unless you want a watermark or ads on your video.
2- I wasn't in the mood for the agravation of dealing with a windows system.

Mplayer and Mencoder were already installed in my laptop. It only took me a few minutes to crop and merge these videos into something readable by a windows box. Here is the recipe:

Cropping videos with mencoder:
You can use the -ss and -endpos parameters to specify start and end point, but you have to add some keyframes to the video first if you look for precision. Also, I needed to specify the fps, otherwise the wmv looked weird.

mencoder -oac copy -ovc lavc -lavcopts keyint=5 -ofps 24 video1.wmv -o video2.avi

Now you can crop video2.avi. For example will skip the first 3.2 seconds and will take 2 seconds of video (until second 5.5)

mencoder -ss 3.2 -endpos 2 -oac copy -ovc copy video2.avi -o video1.avi

The resulting video1.avi has already been cropped. Repeat the procedure with all the pieces of video you need to merge. Rename all videos numerically, for example take01.avi take02.avi, etc,

Merging videos with mencoder:
cat *avi | mencoder -oac copy -ovc copy -o myvideo.avi -

This would simply concatenate all avi files in the current directory into a new video called myvideo.avi, maintaining the original audio and video codecs.

If you want this video to be viewable in a windoze machine (this part is not easy), then use the following codecs:
cat *avi | mencoder -oac pcm -ovc lavc -lavcopts vcodec=msmpeg4 -o myvideo.avi -

All knowledge and software published in this website is released under the GNU General Public License (GPL)