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.67k stars 194 forks source link

Resizing videos while maintaining the aspect ratio #502

Open tato-rj opened 1 year ago

tato-rj commented 1 year ago

How can I resize a video but keep the aspect ratio? I am using

->resize(640, 480)

but it stretches the image. Any ideas?

Klaudijus1996 commented 1 year ago

How can I resize a video but keep the aspect ratio? I am using

->resize(640, 480)

but it stretches the image. Any ideas?

Instead of ->resize try using ->addFilter(['-vf', 'scale=-2:480'])