Modification of the filters
This commit is contained in:
parent
a331632725
commit
e1625f1f94
9 changed files with 794 additions and 14 deletions
|
|
@ -14,15 +14,19 @@ namespace FFMpeg\Filters\Waveform;
|
|||
use FFMpeg\Exception\RuntimeException;
|
||||
use FFMpeg\Media\Waveform;
|
||||
|
||||
class WaveformRatioFixerFilter implements WaveformFilterInterface
|
||||
class WaveformDownmixFilter implements WaveformFilterInterface
|
||||
{
|
||||
|
||||
/** @var boolean */
|
||||
private $downmix;
|
||||
/** @var integer */
|
||||
private $priority;
|
||||
|
||||
// By default, the downmix value is set to FALSE.
|
||||
public function __construct($downmix = FALSE)
|
||||
public function __construct($downmix = FALSE, $priority = 0)
|
||||
{
|
||||
$this->downmix = $downmix;
|
||||
$this->priority = $priority;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -33,6 +37,14 @@ class WaveformRatioFixerFilter implements WaveformFilterInterface
|
|||
return $this->downmix;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getPriority()
|
||||
{
|
||||
return $this->priority;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
@ -23,16 +23,15 @@ class WaveformFilters
|
|||
}
|
||||
|
||||
/**
|
||||
* Fixes the display ratio of the output waveform.
|
||||
* Sets the downmix of the output waveform.
|
||||
*
|
||||
* In case the sample ratio and display ratio are different, image may be
|
||||
* anamorphozed. This filter fixes this by specifying the output size.
|
||||
* If you want a simpler waveform, sets the downmix to TRUE.
|
||||
*
|
||||
* @return WaveformFilters
|
||||
*/
|
||||
public function fixDisplayRatio()
|
||||
public function setDownmix()
|
||||
{
|
||||
$this->waveform->addFilter(new DisplayRatioFixerFilter());
|
||||
$this->waveform->addFilter(new DownmixFilter());
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue