Support resize and watermark in ordering. (#343)

* Support multiple -vf commands

Marge Filters into one command

* Ordering Scale

Using -vf to scale instead of -s to have ordering

* Correct the ResizeFilterTest

* Remove useless comments

* Fixed filter bug

Add checking on filters if only one process.

* Fixed typo error
This commit is contained in:
Kyle Tse 2017-06-28 05:18:22 +08:00 committed by Romain Biard
commit 4cfcabd7b5
3 changed files with 76 additions and 24 deletions

View file

@ -98,8 +98,10 @@ class ResizeFilter implements VideoFilterInterface
if (null !== $dimensions) {
$dimensions = $this->getComputedDimensions($dimensions, $format->getModulus());
$commands[] = '-s';
$commands[] = $dimensions->getWidth() . 'x' . $dimensions->getHeight();
// Using Filter to have ordering
$commands[] = '-vf';
$commands[] = '[in]scale=' . $dimensions->getWidth() . ':' . $dimensions->getHeight() . ' [out]';
}
return $commands;