- AVIFile API exists in all versions of Windows but can only create AVI files. They can contain any data format
- DirectShow - writes AVI, writes MP4 (as well as MKV, MOV etc) through third party components (worth mentioning: http://gdcl.co.uk/mpeg4), no support in Windows RT due to legacy status of the API
- Media Foundation - "successor" to DirectShow, limited availability in Windows versions before Windows 7
All have open source wrappers for .NET
Media Foundation MPEG-4 File Sink in particular:
The MPEG-4 file sink creates MP4 files. For more information about the MP4 file format, refer to the following standards documents: