I use transcode to convert wmv to xvid4. You could just change xvid4 to mpeg4 and movie.avi to movie.mpg if you want to, but xvid4 is just as good or better (and it's open source). This command line has all the options you could ever need. You may also need to change a few things like size, framerate, audio stuff, etc. The transcode man page is great. You also need mplayer and w32codecs installed to decode the wmv. A more simplified one is given below, but no guarantee that it will work. Both of these use two pass encoding and should give you a very high quality transcode (assuming you change the necessary parameters to match your video).
Code:
transcode -i movie.wmv -f 24 -g 320x240 -y xvid4 -x mplayer,mplayer --export_fps 24 -N 0x50 -b 160,0,5,0 -E 44100,0,2 -e 44100,16,2 -J filter=hqdn3d:luma=4:chroma=3:luma_strength=6:chroma_strength=4.5:pre=1 -R 1,vid.log -o /dev/null --video_max_bitrate 3000 && transcode -i movie.wmv -f 24 -g 320x240 -y xvid4 -x mplayer,mplayer --export_fps 24 -N 0x50 -b 160,0,5,0 -E 44100,0,2 -e 44100,16,2 -J filter=hqdn3d:luma=4:chroma=3:luma_strength=6:chroma_strength=4.5:pre=1 -R 2,vid.log -o movie.avi --video_max_bitrate 3000
Code:
transcode -i movie.wmv -y xvid4 -x mplayer,mplayer -N 0x50 -b 160 -R 1,vid.log -o /dev/null --video_max_bitrate 3000 && transcode -i movie.wmv -y xvid4 -x mplayer,mplayer -N 0x50 -b 160 -R 2,vid.log -o movie.avi --video_max_bitrate 3000