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

A facade root has not been set #76

Closed SergeyKozlov closed 6 years ago

SergeyKozlov commented 6 years ago

Hey. I use the product laravel-ffmpeg. Here's my attempt to use the code:

require $_SERVER['DOCUMENT_ROOT'] . '/vendor/autoload.php';
$exporter = Pbmedia\LaravelFFMpeg\FFMpegFacade::open($$_GET['file'])
    ->exportForHLS()
    ->onProgress(function ($percentage) {
        echo "$percentage % transcoded";
    });

But I get the error: Fatal error: Uncaught RuntimeException: A facade root has not been set. in /usr/share/nginx/html/vendor/illuminate/support/Facades/Facade.php:218 Stack trace:

0 /usr/share/nginx/html/system/test/ffmpeg_hls2.php(87): Illuminate\Support\Facades\Facade::__callStatic('open', Array)

#1 {main} thrown in /usr/share/nginx/html/vendor/illuminate/support/Facades/Facade.php on line 218

What did I do wrong? Thank you.

pascalbaljet commented 6 years ago

In what kind of class do you use this code? It doesn’t seem Laravel related.

SergeyKozlov commented 6 years ago

I just want to transcode the video file into the HLS format. What do you need to do for this?

SergeyKozlov commented 6 years ago

The question is how do I use the product laravel-ffmpeg without Laravel?

pascalbaljet commented 6 years ago

This project should be used with Laravel. You should use the underlying package: https://github.com/PHP-FFMpeg/PHP-FFMpeg

SergeyKozlov commented 6 years ago

When I use the PHP-FFMpeg. I'm getting a conflict of versions in the composer

SergeyKozlov commented 6 years ago

It's my composer.json: { "require": { ... "php-ffmpeg/php-ffmpeg": "dev-master", "pbmedia/laravel-ffmpeg": "dev-master", ... } }

2018-03-12 08-46-25

https://packagist.org/packages/silex/silex