Converting extension from avi to mp4:
File.Move(filePath, string.Format(@"{0}\{1}.mp4",
Path.GetDirectoryPath(filePath),
Path.GetFileName(filePath));
All jokes aside, I don't think you realize the size of your question. But if you really want code that can convert between the two I would look at
FFmpeg[
^]