A few hours I deal with the library https://github.com/PHP-FFMpeg/PHP-FFMpeg I can not figure out how to take screenshots with a given frame size ie. In 1 image a few small snapshots of the video. The first stage is to create video snapshots. The code below generates 10 frames per second instead of the supposedly specified FRAMERATE_EVERY_60SEC (every 60 seconds).
$video ->filters() ->extractMultipleFrames(FFMpeg\Filters\Video\ExtractMultipleFramesFilter::FRAMERATE_EVERY_60SEC, '/path/to/destination/folder/') ->synchronize(); $video ->save(new FFMpeg\Format\Video\X264(), '/path/to/new/file'); And this one works, but I don’t know how to change the size of frames, full-size ones are generated.
$video = $ffmpeg->open($video_file); $interval = 200; // Пример for($i=0; $i < 12; $i++) { $img = .jpg'; $frame = $video->frame(\FFMpeg\Coordinate\TimeCode::fromSeconds($interval * $i)); $frame->save($img); $result[] = $img; } The second stage is to glue all the frames into 1 image. How to do this, too, I do not know. Can anyone help in this matter?