Merge pull request #324 from HaveAGitGat/bug_fix

Catch lowercase bug
This commit is contained in:
HaveAGitGat 2022-08-09 00:55:41 +02:00 committed by GitHub
commit 71ca75fa52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View file

@ -249,7 +249,13 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
// Go through each stream in the file.
for (let i = 0; i < file.ffProbeData.streams.length; i++) {
// Check if stream is a video.
if (file.ffProbeData.streams[i].codec_type.toLowerCase() === 'video') {
let codec_type = '';
try {
codec_type = file.ffProbeData.streams[i].codec_type.toLowerCase();
} catch (err) {
// err
}
if (codec_type === 'video') {
// Check if codec of stream is mjpeg/png, if so then remove this "video" stream.
// mjpeg/png are usually embedded pictures that can cause havoc with plugins.
if (file.ffProbeData.streams[i].codec_name === 'mjpeg' || file.ffProbeData.streams[i].codec_name === 'png') {

View file

@ -216,7 +216,13 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
// Go through each stream in the file.
for (let i = 0; i < file.ffProbeData.streams.length; i++) {
// Check if stream is a video.
if (file.ffProbeData.streams[i].codec_type.toLowerCase() === 'video') {
let codec_type = '';
try {
codec_type = file.ffProbeData.streams[i].codec_type.toLowerCase();
} catch (err) {
// err
}
if (codec_type === 'video') {
// Check if codec of stream is mjpeg/png.
// If so then remove this "video" stream.
// mjpeg/png are usually embedded pictures that can cause havoc with plugins.