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

Resizing videos while maintaining the aspect ratio #502

Open tato-rj opened 11 months ago

tato-rj commented 11 months 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 10 months 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'])