Editing AVI files is easily done through VirtualDub but for .wmv, .flv and .mpg files the tools are less easily available.
Some very good command line tools are available for editing these files viz. AsfBin (A very well done editor for Windows media files) and MpgTx (A tool being developed largely for POSIX apps). FLVtool is a flv metadata updater. Movica is a graphical user interface that uses these command line utilities for editing video files