I’ve been trying to convert my console command to work with the Laravel FFMpeg package. The issue that I’ve been running into is that the available Filters are not really well documented.
This is the Laravel code that is not working. The only part that does not work is the addFilter part.
FFMpeg::fromDisk('local')
->open([$backgroundImage, $audioFile])
->export()
->toDisk('local')
->addFilter(function (FrameFilters $filters) {
$filters->custom('scale=1920:1080');
})
->addFormatOutputMapping(
new X264,
Media::make('local', $newVideoPath),
['0:v', '1:a']
)
->addFilter(function ($filters) use ($srtFile, $fontFile) {
$filter = "pad=1920:1080:0:0:color=black,subtitles={$srtFile}:force_style='Fontname={$fontFile},Alignment=10,Fontsize=36,BorderStyle=3,Outline=1,OutlineColour=&HFFFFFF&,PrimaryColour=&H008d7f00&'";
$filters->custom('0:v', '0:v', $filter);
})
->save();
The command which I used to use in the console using Symphony Process was:
'-vf', "pad=1920:1080:0:0:color=black,subtitles=$srtFile:si=0:force_style='Fontname=$fontFile,Alignment=10,Fontsize=36,BorderStyle=3,Outline=1,OutlineColour=&HFFFFFF&,PrimaryColour=&H008d7f00&'"
Is there anyone who has experience doing this?