我正在使用Laravel5.6中的FFMPEG Laravel从视频中生成一个图像帧。如果我对视频文件使用本地路径,它可以正常工作,但是当直接使用时,它会产生一个错误。我想使用存储在s3桶中的视频。
在路径上找不到的文件: https:/xxxxx.cloudfront.net/uploaded_videos/filename.mp4
我的代码如下。
$videoFile = env('CLOUDFRONT')."/".$resultStatusValue[0]->video_url;
FFMpegFacade::fromDisk('s3')
->open($videoFile)
->getFrameFromSeconds($timeToSecond)
->export()
->toDisk('s3')
->save($s3Path);以后生成的图像应该上传到s3桶中。
提前谢谢。
发布于 2018-09-03 04:23:01
如果将disk指定为s3,只需使用key名称即可。
$videoFile = $resultStatusValue[0]->video_url; //= upload/video1.mp4
FFMpegFacade::fromDisk('s3')
->open($videoFile)
->getFrameFromSeconds($timeToSecond)
->export()
->toDisk('s3')
->save($s3Path);如果您希望将文件上传到公众,请在附加的中添加。在visibility上指定config/filesystems.php
's3' => [
'driver' => 's3',
'key' => 'your-key',
'secret' => 'your-secret',
'region' => 'your-region',
'bucket' => 'your-bucket',
'visibility' => 'public',
],https://stackoverflow.com/questions/52131976
复制相似问题