fix smart cut bug

coincidentially discovered in #1190
pull/1233/head
Mikael Finstad 3 years ago
parent 00c2771996
commit c204354446
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

@ -18,9 +18,7 @@ export async function getSmartCutParams({ path, videoDuration, desiredCutFrom, s
async function readKeyframes(window) {
const frames = await readFrames({ filePath: path, aroundTime: desiredCutFrom, streamIndex: videoStream.index, window });
const keyframes = frames.filter((frame) => frame.keyframe);
if (keyframes.length < 1) throw new Error('Unable to find keyframe');
return keyframes;
return frames.filter((frame) => frame.keyframe);
}
let keyframes = await readKeyframes(10);

Loading…
Cancel
Save