Estado inicial: frontend React + backend Laravel

This commit is contained in:
Xavier Oliveira
2026-05-15 15:57:54 +01:00
commit 41c5f87d5b
216 changed files with 29916 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
<?php
namespace App\Services;
use FFMpeg\FFMpeg;
use FFMpeg\Coordinate\TimeCode;
class VideoService
{
public function generateThumbnail(string $videoPath): string
{
$ffmpeg = FFMpeg::create([
'ffmpeg.binaries' => 'C:/Users/Livetech/AppData/Local/Microsoft/WinGet/Packages/Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe/ffmpeg-8.1-full_build/bin/ffmpeg.exe',
'ffprobe.binaries' => 'C:/Users/Livetech/AppData/Local/Microsoft/WinGet/Packages/Gyan.FFmpeg_Microsoft.Winget.Source_8wekyb3d8bbwe/ffmpeg-8.1-full_build/bin/ffprobe.exe',
]);
$video = $ffmpeg->open(storage_path('app/public/' . $videoPath));
$frame = $video->frame(TimeCode::fromSeconds(5));
$thumbnailPath = 'thumbnails/' . uniqid() . '.jpg';
$fullPath = storage_path('app/public/' . $thumbnailPath);
dd($thumbnailPath);
$frame->save($fullPath);
return $fullPath;
}
}