We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca8eea7 commit 5ff0b24Copy full SHA for 5ff0b24
src/FFMpeg/Filters/Video/ExtractMultipleFramesFilter.php
@@ -11,6 +11,7 @@
11
12
namespace FFMpeg\Filters\Video;
13
14
+use FFMpeg\FFProbe;
15
use FFMpeg\Exception\InvalidArgumentException;
16
use FFMpeg\Media\Video;
17
use FFMpeg\Format\VideoInterface;
@@ -81,7 +82,11 @@ public function apply(Video $video, VideoInterface $format)
81
82
83
try {
84
// Get the duration of the video
- $duration = $format()->get('duration');
85
+ foreach ($video->getStreams()->videos() as $stream) {
86
+ if ($stream->has('duration')) {
87
+ $duration = $stream->get('duration');
88
+ }
89
90
91
// Get the number of frames per second we have to extract.
92
if(preg_match('/(\d+)(?:\s*)([\+\-\*\/])(?:\s*)(\d+)/', $this->frameRate, $matches) !== FALSE){
0 commit comments