From f6251983cc6730b347e854da9b41e6c1bc8b66fc Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Tue, 22 Nov 2022 22:10:30 +0800 Subject: [PATCH] improve error msg --- src/smartcut.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/smartcut.js b/src/smartcut.js index 6f409534..e7d54924 100644 --- a/src/smartcut.js +++ b/src/smartcut.js @@ -12,6 +12,7 @@ function mapInputToOutputCodec(inputCodec) { // eslint-disable-next-line import/prefer-default-export export async function getSmartCutParams({ path, videoDuration, desiredCutFrom, streams }) { const videoStreams = getRealVideoStreams(streams); + if (videoStreams.length === 0) throw new Error('Smart cut only works on videos'); if (videoStreams.length > 1) throw new Error('Can only smart cut video with exactly one video stream'); const videoStream = videoStreams[0];