From 7c4eed68f9eea91537efa06bf50665c286b1bf09 Mon Sep 17 00:00:00 2001 From: Romain Biard Date: Tue, 20 Dec 2016 18:47:40 -0300 Subject: [PATCH] We change the way we execute this filter. --- src/FFMpeg/Filters/Video/PadFilter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FFMpeg/Filters/Video/PadFilter.php b/src/FFMpeg/Filters/Video/PadFilter.php index 551604c..df19a2d 100644 --- a/src/FFMpeg/Filters/Video/PadFilter.php +++ b/src/FFMpeg/Filters/Video/PadFilter.php @@ -53,7 +53,7 @@ class PadFilter implements VideoFilterInterface $commands = array(); $commands[] = '-vf'; - $commands[] = 'pad=' . $this->dimension->getWidth() . ':' . $this->dimension->getHeight() . ':(' . $this->dimension->getWidth() . '-iw)/2:(' . $this->dimension->getHeight() .'-ih)/2'; + $commands[] = 'scale=iw*min(' . $this->dimension->getWidth() . '/iw\,' . $this->dimension->getHeight() .'/ih):ih*min(' . $this->dimension->getWidth() . '/iw\,' . $this->dimension->getHeight() .'/ih),pad=' . $this->dimension->getWidth() . ':' . $this->dimension->getHeight() . ':(' . $this->dimension->getWidth() . '-iw)/2:(' . $this->dimension->getHeight() .'-ih)/2'; return $commands; }