'providers' => [
...
Pbmedia\LaravelFFMpeg\FFMpegServiceProvider::class,
...
];
'aliases' => [
...
'FFMpeg' => Pbmedia\LaravelFFMpeg\FFMpegFacade::class
...
];
使用artisan CLI工具发布配置文件:
php artisan vendor:publish --provider =“ Pbmedia \ LaravelFFMpeg \ FFMpegServiceProvider”
$artist = $req->input('artist_id');
$audition = $req->input('audition_id');
$id=Crypt::encrypt($audition);
$vid1 = $req->file("video");
$file = "vid1".time().'.'.$vid1->getClientOriginalExtension();
$file1 = FFMPEG\FFMpeg::open($file);
$ffmpeg = FFMpeg\FFMpeg::create();
$video = $ffmpeg->open($file);
$video
->filters()
->resize(new FFMpeg\Coordinate\Dimension(320, 240))
->synchronize();
$vid1->move(public_path('/auditions'),$video);