Home > Article > Backend Development > php convert video format
A project made with php, the uploaded video is in mp4 format, how to convert the video to flv and ogg
A project made with php, the uploaded video is in mp4 format, how to convert the video to flv and ogg
There is no pure PHP solution other than using a 3rd party web service (I don't think there are any free ones). If you have a web space/web server with command line access, try ffmpeg.
You can call ffmpeg using exec(), but there are also wrapper classes for PHP. here. There is also a PHP extension that provides an interface to ffmpeg, but it must be installed on the server.
Various clouds, don’t mess around
Video transcoding is very resource-intensive. If you don’t have a powerful server, give up this idea. Alibaba Cloud and Baidu Cloud both have cloud transcoding services, but they cost money.