2

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.

4
  • there is no fromDisk method anywhere in the source code. Commented Aug 13, 2017 at 12:53
  • Are you using this package github.com/pascalbaljetmedia/laravel-ffmpeg Commented Aug 13, 2017 at 14:09
  • @RabahG then what should do? Commented Aug 14, 2017 at 5:31
  • @ARIFMAHMUDRANA yes. Commented Aug 14, 2017 at 5:31

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.