Search code examples
laravelffmpeg

(Laravel) Call to undefined method FFMpeg\FFMpeg::fromDisk() OR Unable to load FFMpeg


Call to undefined method FFMpeg\FFMpeg::fromDisk() & OR Unable to load FFMpeg

I'm building a web application to upload a video and store it in cloud. I want to get the duration of the uploaded video. I tried to install laravel/FFMpeg package. After doing all the steps, I'm getting the above error.


Solution

  • The solution is : first of all you have to install FFmpeg on your device. This video may help (https://youtu.be/IECI72XEox0)

    then you should call this in your Controller

    use ProtoneMedia\LaravelFFMpeg\Support\FFMpeg;
    

    after that just go to your (config\laravel-FFmpeg) file in your project and change the defaults to the exact path in c: folder

    'ffmpeg' => [
    'binaries' => env('FFMPEG_BINARIES', 'C:\ffmpeg\bin\ffmpeg.exe'),
    'threads'  => 12,
     ],
     'ffprobe' => [
     'binaries' => env('FFPROBE_BINARIES', 'C:\ffmpeg\bin\ffprobe.exe'),
     ],
    

    Then restart youre computer