[英]how to convert any type of video to mp4?
how can i let users upload video to mp4 using php code?如何让用户使用 php 代码将视频上传到 mp4? 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?
我一直在试图找到一个代码,无论是什么类型的视频格式,它都可以自动将视频转换为 mp4 吗?
If you are trying this at your server/ not using any online tool.如果您在服务器上尝试此操作/不使用任何在线工具。 You can use FFmpeg for this.
您可以为此使用FFmpeg 。 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 . FFmpeg 是用于此目的的最广泛使用的工具,您可以在此处下载相同的工具。
//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");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.