/** * 영상에서 snapshot 추출 * * @param string $content media content * @param int $fromSecond 영상에서의 시간(초 단위) * @return string */ public function getSnapshot($content, $fromSecond = 10) { $videoFile = $this->temp->create($content); $imgPathname = $this->temp->getTempPathname(); $video = $this->ffmpeg->open($videoFile->getPathname()); $video->frame(TimeCode::fromSeconds($fromSecond))->save($imgPathname); $imageContent = file_get_contents($imgPathname); $videoFile->destroy(); @unlink($imgPathname); return $imageContent; }