Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

//This code convert video to mp4 format.
//for that you have to install HandBrakeCLI on your linux server
system("HandBrakeCLI -i ".$currfileName." -o ".$new_convertedvideo.".mp4 -v -m -E aac,ac3 -e x264");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top