Skip to content

Commit 5807653

Browse files
author
Romain Biard
committed
We change the way we deal with the number of digits in the filename
1 parent 4d76b26 commit 5807653

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/FFMpeg/Filters/Video/ExtractMultipleFramesFilter.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,14 @@ public function apply(Video $video, VideoInterface $format)
104104
}
105105

106106
// Set the number of digits to use in the exported filenames
107-
$nbDigitsInFileNames = ceil( $duration * $nbFramesPerSecond );
108-
if($nbDigitsInFileNames < 10)
109-
$nbDigitsInFileNames = '0' . (string)$nbDigitsInFileNames;
107+
$nbImages = ceil( $duration * $nbFramesPerSecond );
108+
109+
if($nbImages < 100)
110+
$nbDigitsInFileNames = "02";
111+
elseif($nbImages < 1000)
112+
$nbDigitsInFileNames = "03";
113+
else
114+
$nbDigitsInFileNames = "06";
110115

111116
// Set the parameters
112117
$commands[] = '-vf';

0 commit comments

Comments
 (0)