This article shows you how to convert a video from one format to an another with ffmpeg
Once, you have installed it, you can run the following command.
The command is pretty simple
ffmpeg -i input.mp4 output.avi
The command may also add more information such as the codec
ffmpeg -i {in-video}.mov -vcodec h264 -acodec aac {out-video}.mp4
See How to use ffmpeg in a web page ?