protonemedia / laravel-ffmpeg

This package provides an integration with FFmpeg for Laravel. Laravel's Filesystem handles the storage of the files.
https://protone.media/en/blog/how-to-use-ffmpeg-in-your-laravel-projects
MIT License
1.67k stars 195 forks source link

Non-static method Pbmedia\LaravelFFMpeg\FFMpeg::fromDisk() should not be called statically #7

Closed saleh-old closed 7 years ago

saleh-old commented 7 years ago

Hi there, thank you for creating this package. I've just installed it on a Laravel 5.4, and this is the error I get: Non-static method Pbmedia\LaravelFFMpeg\FFMpeg::fromDisk() should not be called statically

this is my code:

use Illuminate\Support\Facades\Storage;

public function upload()
    {
        $file = request()->file('gif');
        $name = time() . '.gif';

        $file->storeAs('gifs', $name);

        FFMpeg::fromDisk('local')
                    ->open('gifs/' . $name)
                    ->export()
                    ->inFormat(new \FFMpeg\Format\Video\X264)
                    ->save('export-x264.mp4');

        return back();
    }
saleh-old commented 7 years ago

never mind, found it. Should have used it as: use Pbmedia\LaravelFFMpeg\FFMpegFacade as FFMpeg;

Could be nice if you could mention this in the docs. Thanks again

pascalbaljet commented 7 years ago

The use of facades is described really well in the Laravel Documentation :)