'Laravel FFMPEG: unable to save frame
I am running Laravel 8.0 app on Ubuntu 20.04. For video processing I am using Laravel FFMPEG package.
Along with video processing I also want save a video frame as image in webp format in AWS S3 bucket. I am able to do so in localhost but on server when I try to save image in webp format I get the following error
Could not get frame filename number 2 from pattern. Use '-frames:v 1' for a single image, or '-update' option, or use a pattern such as %03d within the filename.
But when I try to save image as jpg or png, it works.
I can assure that the path where I am saving the image exists and has write permission as suggested in this answer because other file formats are being saved except webp.
Here is my code which export the video frame
FFMpeg::fromDisk($this->video->disk)
->open($this->video->path . $this->video->file_name)
->getFrameFromSeconds(10)
->export()
->addFilter(function (FrameFilters $filters) {
$filters->custom('scale=1280:720');
})
->toDisk('s3.public')
->save($this->frame_path);
Update
As suggested by the @kesh in the comment, adding -update 1 in the command is really working but how can I add it through Laravel FFMPEG package?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
