how to convert any type of video to mp4?

微笑、不失礼 提交于 2019-12-18 04:18:09

问题


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?


回答1:


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.




回答2:


//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");


来源:https://stackoverflow.com/questions/20580370/how-to-convert-any-type-of-video-to-mp4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!