Recompressing already heavily compressed material is usually pretty complex since the encoder tends to spend a lot of time trying to reproduce compression artifacts that it has no idea are not part of the data.
If the AVI's are already MPEG-4/DivX you might just be able to demux/ and remux them as MP4/M4V.
B