You did not specify what language you would prefer, so I assume C# is OK.
Take a look at
AForge.NET[
^]
It contains and assembly Video.VFW which contains an AVIReader class.
It also contains Video.FFMPEG which can write video using the MPEG4 codec.