Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load FFMpeg #510

Open
vladislavzubetcs opened this issue Nov 22, 2023 · 6 comments
Open

Unable to load FFMpeg #510

vladislavzubetcs opened this issue Nov 22, 2023 · 6 comments

Comments

@vladislavzubetcs
Copy link

vladislavzubetcs commented Nov 22, 2023

use ProtoneMedia\LaravelFFMpeg\Support\FFMpeg;

Route::get('/test', function () {
    $image = \App\Models\Product\ProductImage::where('type', \App\Enums\MediaTypes::VIDEO)->firstOrFail();

    FFMpeg::fromDisk('s3')
        ->open($image->url) // products/{hash}.mp4
        ->export()
        ->toDisk('s3')
        ->inFormat(\App\Enums\VideoFormats::WEBM->getFFMpegFormat()) // new \FFMpeg\Format\Video\WebM
        ->save(sprintf('%s%s', $image->url, \App\Enums\VideoFormats::WEBM->value)); // .webm
});

Returns:

FFMpeg\ Exception\ExecutableNotFoundException
PHP 8.2.12
Laravel 10.33.0

Unable to load FFMpeg

root@e1f6f4a83d02:/var/www# which ffmpeg
/usr/bin/ffmpeg
root@e1f6f4a83d02:/var/www# which ffprobe
/usr/bin/ffprobe

.env:

FFMPEG_BINARIES=/usr/bin/ffmpeg
FFPROBE_BINARIES=/usr/bin/ffprobe

ProtoneMedia\LaravelFFMpeg\Support\ServiceProvider::class, published
'FFMpeg' => ProtoneMedia\LaravelFFMpeg\Support\FFMpeg::class added

ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers

@cy-alonzo
Copy link

cy-alonzo commented May 10, 2024

Hello! Have you resolved this one?
I'm currently experiencing the same issue Unable to load FFMpeg

@vladislavzubetcs
Copy link
Author

vladislavzubetcs commented May 16, 2024

@0xCyyy3000 Yeah, I resolved that. But it's been so long, I honestly don't remember how, coz I haven't worked on this project in a long time. But I can give you something.

Packages:

"pbmedia/laravel-ffmpeg": "^8.3",
"php-ffmpeg/php-ffmpeg": "^1.1",

Usage:

use ProtoneMedia\LaravelFFMpeg\Support\FFMpeg;

FFMpeg::fromDisk('s3')
      ->open($this->url)
      ->export()
      ->toDisk('s3')
      ->inFormat($this->videoFormat->getFFMpegFormat()) // new \FFMpeg\Format\Video\WebM()
      ->save(sprintf(
          '%s%s',
          $this->url,
          $this->videoFormat->value
      ));

Try giving permissions to:

FFMPEG_BINARIES=/usr/bin/ffmpeg
FFPROBE_BINARIES=/usr/bin/ffprobe

Also check if you have ffmpeg and ffprobe installed and PHP has access to them.

That's all I have and all I remember, unfortunately.

@cy-alonzo
Copy link

I already resolved my problem, I just ran this command to retrieve the bin path which ffmpeg
But thanks for sharing mate, appreciate your response!

@AbelGoncalo
Copy link

which ffmpeg

how did you solve

@cy-alonzo
Copy link

cy-alonzo commented Jul 15, 2024

You should add the bin path of your ffmpeg to your .env file.
You can identify it by running this command from your terminal:

  • which ffmpeg / which ffprobe for Unix
  • where ffmpeg / where ffprobe for windox

Then in your .env
FFMPEG_BINARIES={{ffmpeg_bin_path}
FFPROBE_BINARIES={{ffprobe_bin_path}}

@Marziul01
Copy link

Thank you . It was really helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants