这是我第一次使用ffmpeg。我不知道是否正确下载了ffmpeg或我做错了。我是从这里https://github.com/pascalbaljetmedia/laravel-ffmpeg
下载的我做到了
$this->validate($request,array(
'Company'=>'required',
'video' => 'required|mimes:mp4,flv,wmv,avi,mov,qt|max:110000',
));
$user_id=Auth::user()->id;
$pro=User::find($user_id);
$pro->company_name=$request->Company;
if($request->video) {
$vid = $request->file('video');
$filename = uniqid().$vid->getClientOriginalName();
$vid = $request->file('video');
//$filename = uniqid().$vid->getClientOriginalName();
//$path = $vid->storeAs('introvideo', $filename);
$t = Storage::disk('s3')->put($filename, file_get_contents($vid), 'public');
$imageName = Storage::disk('s3')->url($filename);
//ffmpeg binaries
$ffmpeg = FFMpeg\FFMpeg::create(array(
'ffmpeg.binaries' => "C:\xampp\htdocs\laravel\blog\public\ffmpeg-20181004-03123e4-win64-static\ffmpeg-20181004-03123e4-win64-static\bin\ffmpeg.exe",
'ffprobe.binaries' => "C:\xampp\htdocs\laravel\blog\public\ffmpeg-20181004-03123e4-win64-static\ffmpeg-20181004-03123e4-win64-static\bin\ffprobe.exe"
));
//$vid->move($location);
$v=FFMpeg::fromDisk('s3')->open($imageName)->export()->toDisk('s3')->inFormat(new \FFMpeg\Format\Audio\Aac)->save($imageName.'mp4');
$pro->video = $v;
然后我收到错误消息,提示“无法加载FFProbe”,就像我不知道发生了什么。有人可以请我帮忙,因为我不知道发生了什么事
答案 0 :(得分:0)
因此,根据您的代码:
public class PropertyRequestHandler : IRequestHandler<NewPropertyRequest, string>
{
public PropertyRequestHandler(IPropertyManager propertyManager, IMapper mapper)
{
Ensure.That(mapper).IsNotNull();
_mapper = mapper;
}
private IMapper _mapper { get; }
public string Handle(NewPropertyRequest message)
{
var newProperty = _mapper.Map<PropertyDto>(message.NewProperty);
...other stuff...
}
}
$ffmpeg = FFMpeg\FFMpeg::create(array(
'ffmpeg.binaries' => '/ffmpeg',
'ffprobe.binaries' => '/ffprobe'
));
二进制文件应该安装在ffmpeg
中,但是在您的注释中,您声明“我将它们保存在laravel公用文件夹中”。将/
参数设置为它们所在的完整路径。