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:
parent
a9341e801b
commit
f6251983cc
@ -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];
|
||||||
|
Loading…
Reference in New Issue
Block a user