Skip to content

Commit 5ff0b24

Browse files
author
Romain Biard
committed
Here is the stable version of the filter, all bugs fixed.
1 parent ca8eea7 commit 5ff0b24

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/FFMpeg/Filters/Video/ExtractMultipleFramesFilter.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace FFMpeg\Filters\Video;
1313

14+
use FFMpeg\FFProbe;
1415
use FFMpeg\Exception\InvalidArgumentException;
1516
use FFMpeg\Media\Video;
1617
use FFMpeg\Format\VideoInterface;
@@ -81,7 +82,11 @@ public function apply(Video $video, VideoInterface $format)
8182

8283
try {
8384
// Get the duration of the video
84-
$duration = $format()->get('duration');
85+
foreach ($video->getStreams()->videos() as $stream) {
86+
if ($stream->has('duration')) {
87+
$duration = $stream->get('duration');
88+
}
89+
}
8590

8691
// Get the number of frames per second we have to extract.
8792
if(preg_match('/(\d+)(?:\s*)([\+\-\*\/])(?:\s*)(\d+)/', $this->frameRate, $matches) !== FALSE){

0 commit comments

Comments
 (0)