Question: Download the php-ffmpeg library (If not downloaded)?
composer require php-ffmpeg/php-ffmpeg
Question: How to change the video resolution from 1280 X 720 to 600 X 400?
//load the library require_once 'ffmpeglib/vendor/autoload.php'; $ffmpeg = FFMpeg\FFMpeg::create(); //format of new video $format = new FFMpeg\Format\Video\X264(); $format->setAudioCodec("aac"); //path of folder where video exist $videoFolderPath='folder'; //change the resolution $width=600; $height=400; //load the video in ffmpeg $videoObj = $ffmpeg->open($videoFolderPath.'/input_video.mp4'); //filter the video with height/width $videoObj->filters()->resize(new FFMpeg\Coordinate\Dimension($width, $height), FFMpeg\Filters\Video\ResizeFilter::RESIZEMODE_INSET, true); //save the video $videoObj->save($format, $videoFolderPath.'/output_video.mp4');