1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-22 18:32:34 +01:00

improve error msg

This commit is contained in:
Mikael Finstad 2022-11-22 22:10:30 +08:00
parent a9341e801b
commit f6251983cc
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

View File

@ -12,6 +12,7 @@ function mapInputToOutputCodec(inputCodec) {
// eslint-disable-next-line import/prefer-default-export // eslint-disable-next-line import/prefer-default-export
export async function getSmartCutParams({ path, videoDuration, desiredCutFrom, streams }) { export async function getSmartCutParams({ path, videoDuration, desiredCutFrom, streams }) {
const videoStreams = getRealVideoStreams(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'); if (videoStreams.length > 1) throw new Error('Can only smart cut video with exactly one video stream');
const videoStream = videoStreams[0]; const videoStream = videoStreams[0];