Add error warning if no streams info (#298)

This commit is contained in:
HaveAGitGat 2022-05-07 17:33:40 +02:00 committed by GitHub
parent ba2dbf4470
commit 99ad3b334d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -95,6 +95,11 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
infoLog: '',
};
if (!Array.isArray(file.ffProbeData.streams)) {
throw new Error('FFprobe was unable to extract any streams info on this file.'
+ 'This may be due to a corrupt file or permissions issue when scanning the file.');
}
let { streams } = JSON.parse(JSON.stringify(file.ffProbeData));
streams.forEach((stream, index) => {