From 9f970c5d5a90ee9303a5e86af5dc5dca0458594a Mon Sep 17 00:00:00 2001 From: Romain Biard Date: Wed, 16 Nov 2016 12:29:56 -0300 Subject: [PATCH] Creation of a waveform method in FFMpeg\Media\Video --- .../Filters/Waveform/WaveformFilterInterface.php | 2 +- src/FFMpeg/Filters/Waveform/WaveformFilters.php | 8 ++++---- .../Filters/Waveform/WaveformRatioFixerFilter.php | 2 +- src/FFMpeg/Media/Video.php | 10 ++++++++++ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/FFMpeg/Filters/Waveform/WaveformFilterInterface.php b/src/FFMpeg/Filters/Waveform/WaveformFilterInterface.php index 7cabdd3..51e69bc 100644 --- a/src/FFMpeg/Filters/Waveform/WaveformFilterInterface.php +++ b/src/FFMpeg/Filters/Waveform/WaveformFilterInterface.php @@ -3,7 +3,7 @@ /* * This file is part of PHP-FFmpeg. * - * (c) Alchemy + * (c) Strime * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/FFMpeg/Filters/Waveform/WaveformFilters.php b/src/FFMpeg/Filters/Waveform/WaveformFilters.php index 6ef4043..703220f 100644 --- a/src/FFMpeg/Filters/Waveform/WaveformFilters.php +++ b/src/FFMpeg/Filters/Waveform/WaveformFilters.php @@ -3,7 +3,7 @@ /* * This file is part of PHP-FFmpeg. * - * (c) Alchemy + * (c) Strime * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -23,16 +23,16 @@ class WaveformFilters } /** - * Fixes the display ratio of the output frame. + * Fixes the display ratio 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. * - * @return FrameFilters + * @return WaveformFilters */ public function fixDisplayRatio() { - $this->frame->addFilter(new DisplayRatioFixerFilter()); + $this->waveform->addFilter(new DisplayRatioFixerFilter()); return $this; } diff --git a/src/FFMpeg/Filters/Waveform/WaveformRatioFixerFilter.php b/src/FFMpeg/Filters/Waveform/WaveformRatioFixerFilter.php index 61d558b..ec40205 100644 --- a/src/FFMpeg/Filters/Waveform/WaveformRatioFixerFilter.php +++ b/src/FFMpeg/Filters/Waveform/WaveformRatioFixerFilter.php @@ -3,7 +3,7 @@ /* * This file is part of PHP-FFmpeg. * - * (c) Alchemy + * (c) Strime * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/FFMpeg/Media/Video.php b/src/FFMpeg/Media/Video.php index 9200f49..3338b51 100644 --- a/src/FFMpeg/Media/Video.php +++ b/src/FFMpeg/Media/Video.php @@ -181,4 +181,14 @@ class Video extends Audio { return new Frame($this, $this->driver, $this->ffprobe, $at); } + + /** + * Gets the waveform of the video. + * + * @return Waveform + */ + public function waveform() + { + return new Waveform($this, $this->driver, $this->ffprobe); + } }