how to convert any type of video to mp4?

user3076412 picture user3076412 · Dec 14, 2013 · Viewed 37.8k times · Source

how can i let users upload video to mp4 using php code? I've been trying to find a code that converts video to mp4 automatically no mater what type of video format it is this possible?

Answer

Aditya picture Aditya · Dec 14, 2013

If you are trying this at your server/ not using any online tool. You can use FFmpeg for this. Sample code for conversion:

ffmpeg -i {input}.mov -vcodec h264 -acodec aac -strict -2 {output}.mp4

FFmpeg is most widely used tool for this purpose and you can download the same here.