如何在laravel中使用ffmpeg压缩视频文件大小

时间:2018-06-30 20:01:47

标签: laravel ffmpeg

这是我第一次使用ffmpeg。我不知道是否有关于如何在laravel中使用ffmpeg压缩视频的教程。有人可以帮我吗?

   $pro=new User;
    $pro->company_name=$request->Business_name;
    $pro->cityandstate=$request->city;
    $pro->zipcode=$request->zip_code;
    $pro->phonenumber=$request->Phone_Number;
    $pro->website=$request->Website;

    $pro->tags=$request->tags;
    $pro->category=$request->categories;
    $pro->other=$request->other;

    $vid = $request->file('video');
      $filename = uniqid().$vid->getClientOriginalName();
      $path = $vid->storeAs(
'introvideo',
$filename);
      $location = public_path('/vids',$filename);
      $vid->move($location);
      $pro->intro_video= $filename;







    $pro->save();

2 个答案:

答案 0 :(得分:1)

您可以在此处找到文档。它不难理解。 ffmpeg documentation from laravel 有什么想法就问

答案 1 :(得分:0)

好吧,ffmpg使用终端命令,所以只要您能那样做就可以。您有很多选择。一些示例是: http://php.net/manual/ru/function.shell-exec.php http://symfony.com/doc/current/components/process.html

或参阅此Laravel文档 https://laravel.com/docs/5.6/artisan

相关问题