Здесь 'моя ситуация: я использую laravel ffmpeg и larvel queue для перекодирования видео.Кажется, все работает нормально.Работа идет отлично, но я замечаю, что когда она сохраняет конвертированное видео и сжимает его, сохраняя его в общедоступной папке приложения, но я хотела сохранить конвертированные видео в моем хранилище amazon s3. Может кто-нибудь помочь с этим
//This is my controller
public function store(StoreVideoRequest $request){
$path=str_random(16). '.' . $request->video->getClientOriginalName();
$request->video->move(public_path('app'), $path);
$video=Video::create([
'disk'=>'app',
'original_name'=>$request->video->getClientOriginalName(),
'path'=>$path,
'title'=>$request->title,
]);
ConvertVideoForStreaming::dispatch($video);
return redirect('uploader')->with('message','Your video will be available shortly after we process it');
}
//This the job
public function handle()
{
// create a video format...
$lowBitrateFormat = (new X264('libmp3lame', 'libx264'))->setKiloBitrate(500);
$converted_name = $this->getCleanFileName($this->video->path);
// open the uploaded video from the right disk...
FFMpeg::fromDisk('local')
->open($this->video->path)
// add the 'resize' filter...
->addFilter(function ($filters) {
$filters->resize(new Dimension(320, 250));
})
// call the 'export' method...
->export()
// tell the MediaExporter to which disk and in which format we want to export...
->toDisk('s3')
->inFormat($lowBitrateFormat)
// call the 'save' method with a filename...
->save($converted_name);
$imageName = Storage::disk('s3')->url($converted_name);
// update the database so we know the convertion is done!
$this->video->update([
'converted_for_streaming_at' => Carbon::now(),
'processed' => true,
'stream_path' => $imageName
]);
}