In this article, we are going to discuss about How to upload and convert video into FLV format using FFMpeg in Codeigniter. FFMpeg commands are running only in Linux environment. If you want to use it in windows, you need download ffmpeg.exe file. Click here to download FFMpeg.exe. Download the FFmpeg executable file and place it in your root folder. If you are using Linux server, Use print phpinfo() function to check whether your hosting server has FFmpeg installed or you need it to be installed.

Use the below code for uploading and converting the video file in Codeigniter.

exec("ffmpeg -i ".$directory_path_full." ".$directory_path.$file_name.".flv"); // $file_name is same file name that is being uploaded but you can give your custom video name after converting So use something like myfile.flv.