chengwei
chengwei

Reputation: 147

Laravel FFmpeg error Call to undefined method FFMpeg\FFMpeg::fromDisk()

I'm using laravel ffmpeg to create a thumnail fot the video, but when i run the code, it return me

Call to undefined method FFMpeg\FFMpeg::fromDisk()

I don't know what happen to this error, i'm follow the instruction in github. here is my code.

use FFMpeg\FFMpeg;
use FFMpeg\FFProbe;

$thumbnail_name =  md5($request->video_name).'_thumbnail.jpg';
$thumbnail_path = '/assets/' . $request->video_name;
FFMpeg::fromDisk('videos')
        ->open($export_as)
        ->getFrameFromSeconds(10)
        ->export()
        ->toDisk('thumnails')
        ->save($thumbnail_path);

i tried the fromFilesystem method, but it is not working, i also change the value in fromDisk() to public/assets even from c drive like C:\xampp\htdocs\vidpuz\public\assets but also not working, it keep return undefined method error.

Upvotes: 2

Views: 5825

Answers (1)

Tadeo Rod
Tadeo Rod

Reputation: 594

You could use this:

use Pbmedia\LaravelFFMpeg\FFMpeg;

but you are using:

use FFMpeg\FFMpeg;

So you are not using the Laravel package but FFMpeg directly...

If you installed the package correctly. You can even omit the use Pbmedia\LaravelFFMpeg\FFMpeg; and use the facade directly.

Upvotes: 2

Related Questions