简体   繁体   English

无法使用 protonemedia / laravel-ffmpeg 为上传的视频添加水印

[英]Unable to Watermark an Uploaded Video Using protonemedia / laravel-ffmpeg

I am trying to watermark a video to prevent users from downloading the original video.我正在尝试为视频添加水印以防止用户下载原始视频。

Below is my code for uploading a video, followed by watermarking it:下面是我上传视频的代码,然后加水印:

public function watermarkpost(Request $request)
{

    if ($file = $request->file('watermark')) 
    {      
       $name = time().str_replace(' ', '', $file->getClientOriginalName());
       $file->move('assets/images/products',$name);           
    }
        FFMpeg::open(asset('assets/images/products/'.$name))->addWatermark(function(WatermarkFactory $watermark) {
            $watermark
            ->open(asset('assets/images/1571567292logo.png') )
            ->right(25)
            ->bottom(25);
        });
   
    // return asset('assets/images/products/'.$name);
}

The error:错误:

Alchemy\\BinaryDriver\\Exception\\ExecutableNotFoundException(code: 0): Executable not found, proposed : ffmpeg at F:\\xampp\\htdocs\\GeniusCart\\project\\vendor\\alchemy\\binary-driver\\src\\Alchemy\\BinaryDriver\\AbstractBinary.php:159)

How to resolve this issue?如何解决这个问题?

Installation安装

You need to install ffmpeg and ffprobe on your system.您需要在系统上安装ffmpegffprobe
You can download the required release of these based on your os from this url您可以根据您的操作系统从url下载所需的版本

Configuration配置

After installing them, you should give the path to their executive binaries.安装它们后,您应该提供它们的执行二进制文件的路径。 Laravel ffmpeg provides a config for this purpose. Laravel ffmpeg 为此提供了一个配置。 Give it the proper address to the ffmpeg and ffprobe binaries in your.env file.在 your.env 文件中为 ffmpeg 和 ffprobe 二进制文件提供正确的地址。

FFMPEG_BINARIES=
FFPROBE_BINARIES=

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM