$filename = basename($input_file); $filename_minus_ext = substr($filename, 0, strrpos($filename, '.')); // set the input file $ok = $toolkit->setInputFile($input_file); // check the return value in-case of error if (!$ok) { // if there was an error then get it echo $toolkit->getLastError() . "<br />\r\n"; $toolkit->reset(); exit; } // $toolkit->setFormat(PHPVideoToolkit::FORMAT_MPEGVIDEO); $toolkit->setVideoOutputDimensions(PHPVideoToolkit::SIZE_QVGA); // loop through the files to process foreach ($files_to_process as $file) { $toolkit->addVideo($file); } // set the output details and overwrite if nessecary $ok = $toolkit->setOutput($video_output_dir, $filename_minus_ext . '-joined.mpeg', PHPVideoToolkit::OVERWRITE_EXISTING); // check the return value in-case of error if (!$ok) { // if there was an error then get it echo $toolkit->getLastError() . "<br />\r\n"; $toolkit->reset(); exit; } // execute the ffmpeg command and log the calls and PHPVideoToolkit results $result = $toolkit->execute(false, true); // get the last command given // $command = $toolkit->getLastCommand(); // echo $command[0]."<br />\r\n";