laravel-ffmpeg icon indicating copy to clipboard operation
laravel-ffmpeg copied to clipboard

ffmpeg failed to execute command '/opt/homebrew/bin/ffmpeg' '-version'

Open dhruva81 opened this issue 2 years ago • 0 comments

Hi

I am using this package first time.

I am receiving following error

Message ffmpeg failed to execute command '/opt/homebrew/bin/ffmpeg' '-version': Error Output:
Type   Alchemy\BinaryDriver\Exception\ExecutionFailureException
image

I am using the example posted in your blog https://protone.media/en/blog/how-to-use-ffmpeg-in-your-laravel-projects

 public function handle()
    {
        // create some video formats...
        $lowBitrateFormat  = (new X264)->setKiloBitrate(500);
        $midBitrateFormat  = (new X264)->setKiloBitrate(1500);
        $highBitrateFormat = (new X264)->setKiloBitrate(3000);

        // open the uploaded video from the right disk...
        FFMpeg::fromDisk($this->video->disk)
            ->open($this->video->path)

            // call the 'exportForHLS' method and specify the disk to which we want to export...
            ->exportForHLS()
            ->toDisk('streamable_videos')

            // we'll add different formats so the stream will play smoothly
            // with all kinds of internet connections...
            ->addFormat($lowBitrateFormat)
            ->addFormat($midBitrateFormat)
            ->addFormat($highBitrateFormat)

            // call the 'save' method with a filename...
            ->save($this->video->id . '.m3u8');

        // update the database so we know the convertion is done!
        $this->video->update([
            'converted_for_streaming_at' => Carbon::now(),
        ]);
    }

Kindly help.

dhruva81 avatar Jul 11 '22 14:07 dhruva81