Can anyone tell me why I get
Error: Class "FFMpeg\Format\video\X264" not found in"
even with the dependency installed and binary installed.
Below is my implementation.
I have the dependency in vendor and the binary in the container installed
<?php
namespace App\Services;
use App\Http\Traits\UploadFiles;
use App\Models\OtherVideoFormat;
use ProtoneMedia\LaravelFFMpeg\Support\FFMpeg;
class VideoServiceSecond
{
use UploadFiles, SetPath;
protected $otherVideoFormat, $data;
public function __construct(array $data, $method = 'create')
{
$this->otherVideoFormat = app(OtherVideoFormat::class);
$this->data = $data;
if ($method == 'create')
$this->convertFormatVideoFirst();
else
$this->convertFormatVideoFirstUpdate();
}
public function convertFormatVideoFirst()
{
FFMpeg::openUrl($this->data['url_signed'])
->export()
->toDisk('public')
->inFormat(new \FFMpeg\Format\video\X264)
->resize(config('dimensions-videos.second-width'), config('dimensions-videos.second-height'))
->save('video-resize-' . config('dimensions-videos.second-width') . 'x'
. config('dimensions-videos.second-height') . config('files-extensions.video'));
$response = $this->uploadFileConvert(
Storage::disk('public')
->get("video-resize-" . config('dimensions-videos.second-width') . 'x'
. config('dimensions-videos.second-height') . config('files-extensions.video')),
"video-resize-" . config('dimensions-videos.second-width') . 'x'
. config('dimensions-videos.second-height') . '-' . Str::uuid() . config('files-extensions.video')
);
$this->data['url'] = $response;
$this->data['url_signed'] = $this->getAuthorizationToDownloadFile($this->data['url']);
$this->data['created_at'] = Carbon::now()->toDateString();
$this->data['updated_at'] = Carbon::now()->toDateString();
$this->data['video_id'] = $this->data['video_id'];
$this->data['format'] = config('dimensions-videos.second-width') . 'x'
. config('dimensions-videos.second-height');
FFMpeg::openUrl($this->data['url_signed'])
->getFrameFromSeconds(config('time-capture-thumb.seconds'))
->export()
->toDisk('public')
->save("video-thumb-" . config('dimensions-thumb.second-width') . 'x'
. config('dimensions-thumb.second-height') . config('files-extensions.thumb'));
$url_file = $this->uploadPublicFileCompress(
Storage::disk('public')
->get("video-thumb-" . config('dimensions-thumb.second-width') . 'x'
. config('dimensions-thumb.second-height') . config('files-extensions.thumb')),
"video-thumb-" . config('dimensions-thumb.second-width') . 'x'
. config('dimensions-thumb.second-height') . '-' . Str::uuid() . config('files-extensions.thumb')
);
$this->removeImagePublicDisk("video-thumb-" . config('dimensions-thumb.second-width') . 'x'
. config('dimensions-thumb.second-height') . config('files-extensions.thumb'));
$this->removeImagePublicDisk("video-resize-" . config('dimensions-videos.second-width') . 'x'
. config('dimensions-videos.second-height') . config('files-extensions.video'));
$this->data['thumbnail_url'] = $url_file;
$this->otherVideoFormat->create($this->data);
}
?>
I've tried several options, and I can't find the reason for the problem