0

I am trying to concatenate videos into one using PHP and FFMpeg.

The URL of each video are in the array $files_aux[].

$video = $ffmpeg->open($files_aux[0]); 
$video->filters()->synchronize();
$video
   ->concat($files_aux)
   ->saveFromSameCodecs(__DIR__ . $newfilename, true, true);

It works well, but I want to add a fade effect in between each video. Can someone help?

Thanks in advance

Corboss
  • 1
  • 1
  • i think you're going to have to save the last few frames of one video, and the first of the next and do it on something like a frame-by-frame basis. (I could be wrong). I've got a repo where I do this sort of thing IN PYTHON... which might(might not) help. https://github.com/andy-preston/PythonPillowPovProcessor – Andy Preston Mar 09 '23 at 16:07
  • FFmpeg has an `xfade` filter, https://ffmpeg.org/ffmpeg-filters.html#xfade - but I don't know if that is implemented in the PHP lib yet. https://github.com/ikorolev72/ffmpeg-transition-samples/blob/master/crossfade.php shows an example of how it can be done if you are able to use the actual ffmpeg binary via `exec`. – CBroe Mar 10 '23 at 09:41

0 Answers0