我知道如何使用 FFMpeg 从视频中创建和保存图像,但我的目标是返回图像文件,而不是保存它!
我有这个返回 System.in
实例的函数:
FFMpeg/Media/Frame
我的目标是将它与 Laravel Storage 的 private function generateVideoThumbnail($file){
$seconds = 15;
$ffmpeg = FFMpeg::create();
$video = $ffmpeg->open($file);
$frame = $video->frame(TimeCode::fromSeconds($seconds));
//$frame->save('thumbnail.jpg'); <------- This saves the image
return $frame;
}
函数一起使用。