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.62k stars 193 forks source link

Can't concetenate two videos #489

Open HeadStudios opened 1 year ago

HeadStudios commented 1 year ago

I am using the following code to try to concetenate two videos:

 public function handle()
    {
        dump("We have the map. Go!");
        FFMpeg::openUrl('https://rent-roll-devour-bucket-a1.s3.ap-southeast-2.amazonaws.com/videos/audits/conversion_rate_audit.mp4')
            ->openUrl('https://rent-roll-devour-bucket-a1.s3.ap-southeast-2.amazonaws.com/videos/audits/outro_generic.mp4')
            ->addFilter('[0:v]', 'scale=1152:720:force_original_aspect_ratio=decrease,pad=1152:720:(ow-iw)/2:(oh-ih)/2:black,fps=30', '[v0]')
            ->addFilter('[1:v]', 'scale=1152:720:force_original_aspect_ratio=decrease,pad=1152:720:(ow-iw)/2:(oh-ih)/2:black,fps=30', '[v1]')
            ->addFilter('[v0][0:a][v1][1:a]', 'concat=n=2:v=1:a=1', '[out]')
            ->export()
            ->addFormatOutputMapping(new \FFMpeg\Format\Video\X264, \ProtoneMedia\LaravelFFMpeg\Filesystem\Media::make('s3', $this->path), ['out'])
            ->save($this->path);
    }

Getting this error: https://gist.github.com/HeadStudios/3d41aafb344014a2234e4af8fc36a1b1

What am I doing wrong?