Cutting any DivX, AVI or ASF file can be done without problems using
VirtualDub. But to cut ASF files you will need VirtualDub version 1.3c
because Microsoft put the thumb screws on Avery Lee and so he took it
out of all his later versions. Another great program that can chop some
mpeg formats is TMPGEnc. Again, all these utilities are free.

As a word of warning, please do not use AVIChop, Pecks Power Join
or AVI Devil to try and chop an AVI because you are likely to get
corrupt files. The following will describe how to cut and join Divx
files, but the same method will work with any AVI, MJPEG, ASF or
popular format that VirtualDub can open. The exception to this is
Mpeg-1 & 2 but I'll explain how to do that in another article
=). This method doesn't require that we re-encode any file,
all we are doing is cutting them.

Note:
ASF's are a very twitchy format and don't seem to be fully supported
by anything much except Microsoft Media Encoder. If you have trouble
chopping up an ASF file in VirtualDub try Windows Media Indexer
instead, it can be downloaded Here.
If you have trouble joining two ASF files try opening them in VirtualDub
and resaving them again using the Direct Stream Copy option for
both Audio and Video. Then you should be able to join them together
without problems. If the ASF doesn't open at all there is not much
you can do, perhaps its just a corrupted file? The following guide
will show you how to do everything spoken of here anyway.

Make sure all previous options you have selected, such as filters etc.,
in VirtualDub are not selected. The best way to do this is to shutdown
VirtualDub and then load it again.

SET IT TO COPY

Select File > Open

Go to Video > Direct stream copy. (Note
that VirtualDub puts a dot by the options we select)

Go to Audio > Direct stream copy.

SELECT WHERE TO CUT

VirtualDub doesn't actually cut a file in half at a certain point,
instead it just lets us save any part. So to cut a movie in half
we must select the first have, save it, then select the second half
and save that. The beauty of this cutting method is we can select
exactly where we want to cut it. All the old cutting methods just
cut the movie exactly in half at a certain point. The problem with
that was it often cut it in the middle of an action scene and totally
spoil the movie because we would have to change CD's. With this
method you can select to cut it wherever you like. Naturally it
is best to cut a movie where one scene ends and another starts.
The only thing you have to watch is that each half is not too large
for the CD after it is cut =).

If you are unfamiliar with VirtualDubs controls take a look at the picture
below. No, its not an alphabet revision. If we look a (A)
we have our basic video controls: stop and play. There are two play buttons,
one plays the input movie and the other plays both the input and output
movies together. If you click on the pictures you can stop them playing,
and if you right-click on the picture you can select to zoom in or out.
This, of course, is just for viewing purposes. Next (B)
we have the jump to start and jump to end of the movie buttons. And (C)
allows us to move frame by frame either way.

To cut the movie in half we must move to the middle. First move to the
end of the movie by pressing the jump to end button (B).
Divide in half the number of frames it then shows at (H).
This gives me something like frame number: 77229. So I use the slider
bar (E) to move very close to that
number, which will be the middle of the movie. Now this is the important
point we must use the move by keyframe buttons (D)
to select where to cut our movie. If you don't you could end up with a
few seconds of corrupted video where the cut was made! For more information
on why check out my article in the appendix called "Key Frames
& Delta Frames Explained". In short, if move using the keyframe
buttons you cannot cut it wrong!

Okay, so we are at the point we wish to cut the movie. Write down
the frame number you have selected to cut the movie, I have selected
frame 77575 because it fades to black here. Hit the 'mark end point'
button (G) (also called the
"mark out" button). Next, press the jump to the start
button (B). Then press the 'mark
start point' (also called "mark in"). You will notice
that the slider bar (E) now
shows a blue line next to it - this is your selection. You have
marked from the middle to the start of the movie.

Then we save it: File > Save AVI...

Bingo! Now if you look at the file you just saved it will be the
first half of your movie.

Next go to the middle again to the same frame number you cut it
before; for me this was: 77575. Hit the 'mark start point' button
(F). Then press the 'jump to
end' button (B). And finally
the 'mark end point' button (G).

And again we select: File > Save AVI...

Look at the file you just saved it will be the second half of
your movie. That's it! You have cut a DivX movie in half!

Final Note: You may have
noticed that cutting movies using the keyframe buttons can produce a repeated
keyframe both at the start of the second file and the end of the first!
But, considering there are 25 frames to every second of a movie, this
will not even notice, especially when we are splitting a movie onto two
CD's anyway =). If you want to delete this, use the 'frame by frame' buttons
(C) to do so. The only rule to remember
here is to never delete a keyframe from the start of a movie clip always
delete it off of the end of the clip.

JOINING DIVX FILES

Joining together Divx, AVI or ASF clips is just as easy with VirtualDub
once you get the hang of it. Again, if you are cutting up files you must
do so on the keyframe to avoid corrupt files. But to join the clips just
open them in VirtualDub in the correct order and use the append option.
For example:

Open the first file by File > Open video file...

Then to join each file to the previous one. You open them one at a time
by going to: File > Append video segment...

WHAT CAN & CANNOT BE JOINED?

It is very very important that the files you join together are exactly
the same format! You cannot join files of two different codecs. For example
an DivX will never join with an MJPEG, one of the two must be recompressed
first into the others format. Neither will movie clips of two different
sizes join together. So you cannot join a 352 x 288 movie clip with a
352 x 240 clip! You cannot join two movie clips together if the audio
is a different format. So if one Divx uses Mp3 audio and the other uses
WMA audio they will not join and so on. Finally, VirtualDub doesn't support
the editing or the joining of Mpeg-1 or Mpeg-2 files yet. To edit them
you will need to use TMPGEnc, for that see my guide: "Cutting
& Joining VCD (Mpeg-1 / 2)".

To find out exactly what format a file uses just open it in VirtualDub.

And choose File > File Information...

To join any file to any other all you need to do is write down the file
information from one and re-encode the other (preferably the shortest
clip) with the same setting.

JOINING AND AUDIO SYNCHRONIZATION

Sometimes when you join two files together the second file will go out
of synchronization. I think this is because sometimes the audio is clipped
too short and doesn't match the video file length. Often you can get around
this by creating an offset. To do this, open the first file you wish to
join in VirtualDub.

Select File > Open

Go to Video > Direct stream copy. (Note
that VirtualDub puts a dot by the options we select)

Go to Audio > Direct stream copy.

Go to Select Range...

In the 'End offset' of the picture below (encircled in red) type in about
15 frames.

Then save your newly created first file.

That's it. Now open this new file as your first file to join. Then open
the next file you wish to join to it with the Append video segment option
as already explained.

15 frames should be enough of an offset to keep it in synch. But you
may need to increase or decrease this number a little. If the offset is
too much you will get a jump in the movie as it skips a keyframe. If it
is too small the picture will freeze and the audio will continue going!
So please make sure it is correct before you save your final movie.

COOL THINGS YOU CAN DO WITH JOINING

One of the things I have found fun to do with this joining method I created
is to re-add the cut scenes from movies. These cut scenes are usually
added to the DVD as specials. But I thought it would be a great idea to
put them back in and create my own special edition movies =). For example,
I have added all the cut scenes from the Alien movie to my DivX including
that Cocoon scene everyone is talking about.

I would also love to add the other Cocoon scene from Aliens, but that
was not on the DVD specials as expected. If anyone has it on video from
a documentary please compress it and send it my way :). Here is a photo
from a magazine:

ADDING THE SPECIALS

Sometimes adding the specials is not as easy as it sounds. So, just for
you, I'll let you in on a few tricks I have used that will also help you
join specials or compile lists of any files seamlessly.

First thing to do is to get the specials off of the DVD. SmartRipper
can extract individual chapters and Vobs so this shouldn't be too difficult.
Since most specials are very short its best to either encode them as uncompressed
avi, or if hard drive space is limited, as highest quality MJPEG with
the Huffyuv or PicVideo codecs etc. This is mainly because we can do perfect
frame by frame editing with these formats. It is also an idea to do use
PCM audio until all editing has been done. This way we will avoid
sound degradation and audio synch problems. Finally, watch out for interlacing
effects on special which were not on the main movie, and if necessary,
deinterlace them.

CROPPING

It's hell trying to match a movie to a special if both have black bars
on them! Ideally you should crop both the specials and the original movie
to exactly the same size so no boarders exist at all! If the specials
are smaller than the movie when cropped, resize them larger and crop them
to the same size the original movie was encoded to. This may loose a bit
more of the picture than we wanted but won't notice on the final version.

COLOUR MATCHING

Okay, open VirtualDub twice! Once with the Divx you wish to splice the
extra scenes into and once with the cut scenes. Find the original scene
in the movie, or think of a good place you could cut your new scene into
and go to it. Specials and cut scenes are usually good quality video conversions
and hence will not always look the same as the main DVD movie. The colours,
saturation and brightness' of scenes may be a little different to match.
Colour matching is absolutely vital if they are to look natural. Things
you should look out for to make the files match. For detailed explanations
on video editing with VirtualDub see the articles I have written in the
advanced VirtualDub section.

You should be aware of:

1. Brightness, Contrast & Levels: Try and get the overall
tones to match the original movie.

2. Hue & Saturation: Sometimes there will be too much
colour flair in the image and reducing the saturation a bit helps.
Also, at least in the case of the movie Alien, I needed to cut out
some of the red to match the more blue-green trend of the original
DVD.

3. Sharpness: Specials are almost always slightly more blurred
than the original DVD. The unsharp mask filter gives us the most control
here and is probably the one to use.

4. Noise & Clarity: Specials usually have more noise
than original movies. Using such filters as the 2D cleaner can do
wonders in this area.

You probably will not need to adjust all of the above, but these are
the things to look out for. Try each filter and compare the cut scene
with the original. When you are happy save the filter settings ready for
when you encode from AVI to Divx

SPLICING

Ideally we want frame by frame accuracy. But as you know this will corrupt
your Divx so you must edit from keyframe to keyframe. We could encode
the whole movie to uncompressed AVI but at something like 1GB per minuet
this is not possible. Just to clarify, if you set your keyframes to 1
every second when you encoded your original Divx you should be able to
splice in most parts without frame by frame accuracy. This may require
you chop out a second or two here or there from the special or original
move. But for those tricky scenes try this method.

Open the original movie in VirtualDub and use the keyframe buttons to
chop the movie into three parts using nothing but the keyframe
buttons!

1. From the start to where you want to insert the cut scene.

2. The area where the cut scene will be (i.e. perhaps 5-10 seconds)

3. The part from after the cut scene to the end of the movie.

The second in the above list may be a little confusing at first but you'll
see what I mean. Imagine you have found a scene change perhaps, for example,
a scene that flicks from the office to one walking home. You think, 'this
is the perfect place to add this cut scene'. So we cut out 5-10 seconds
of it using the keyframe buttons. So we have a little bit of the office
and a little bit of walking home in this clip. Then open the clip again
and resave it as an uncompressed AVI or MJPEG.

Bingo! Now it can be edited it frame by frame. Chop it into two parts:

1. Before the change

2. After the change

Finally, open the 'Before the change' in VirtualDub. Append the new cut
scene you wanted to put in-between. And append the after the change. Resave
and compress it to Divx using the exact same settings you did for your
original movie.

MATCHING THE AUDIO

Nearly done! Just one more thing needed to create the perfect seamless
join. Sometimes the audio doesn't quite fit right. For example, the background
music may carry on from one scene to another and the cut scene may not
have any background music at all! To solve this we must open the audio
file in an audio editing program such as Cool Edit or sound Forge. This
is another good reason to keep the audio as uncompressed PCM until the
cut scenes are done. Save the audio from the newly joined cut scene by
opening it in VirtualDub and choosing:

File > Save Wav...

Open it in Cool Edit and find the part where the music, noise, etc.,
is located. And select just before the change like this:

Then with that part selected use: Amplitude >
Amplify...

Up pops this crazy box. Just hit the fade out button and press ok.

If you selected the area correctly the background music / noise etc.,
will be faded out. Then, if necessary, select the bit after the scene
change but this time choose 'fade in'. This will make the background music
fade smoothly in and out between the two scenes leaving no final traces
of editing =). Once done just choose File > Save.

To add this audio back to the clip open the clip in VirtualDub. And choose:

Video > Direct stream copy

Audio > Wav Audio...

Browse for your altered wave file and press Open:

Audio > Direct stream copy

Save it baby!

THE FINAL JOIN

Finally, we can join our seamless clip back to the original cut Divx
movie by joining: