Skip to content

Commit

Permalink
improve error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Nov 22, 2022
1 parent a9341e8 commit f625198
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/smartcut.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit f625198

Please sign in to comment.