From 5ff0b24230a170ecfcf6c53c7ce8d76668629a6e Mon Sep 17 00:00:00 2001 From: Romain Biard Date: Wed, 11 Jan 2017 11:15:22 -0300 Subject: [PATCH] Here is the stable version of the filter, all bugs fixed. --- src/FFMpeg/Filters/Video/ExtractMultipleFramesFilter.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/FFMpeg/Filters/Video/ExtractMultipleFramesFilter.php b/src/FFMpeg/Filters/Video/ExtractMultipleFramesFilter.php index bb26bc9..e3db5b9 100644 --- a/src/FFMpeg/Filters/Video/ExtractMultipleFramesFilter.php +++ b/src/FFMpeg/Filters/Video/ExtractMultipleFramesFilter.php @@ -11,6 +11,7 @@ namespace FFMpeg\Filters\Video; +use FFMpeg\FFProbe; use FFMpeg\Exception\InvalidArgumentException; use FFMpeg\Media\Video; use FFMpeg\Format\VideoInterface; @@ -81,7 +82,11 @@ class ExtractMultipleFramesFilter implements VideoFilterInterface try { // Get the duration of the video - $duration = $format()->get('duration'); + foreach ($video->getStreams()->videos() as $stream) { + if ($stream->has('duration')) { + $duration = $stream->get('duration'); + } + } // Get the number of frames per second we have to extract. if(preg_match('/(\d+)(?:\s*)([\+\-\*\/])(?:\s*)(\d+)/', $this->frameRate, $matches) !== FALSE){