From 8324988ad3bf1c3c1a62bf5df171ac0470fadf95 Mon Sep 17 00:00:00 2001 From: Boosh1 <45874141+Boosh1@users.noreply.github.com> Date: Sat, 26 Oct 2024 14:06:09 +0100 Subject: [PATCH] Adding validation against Dolby vision files Done more testing & confirmed, dolby vision files are normally not converted properly so we'll filter these out now. The output usually doesn't have evident issues, it's only when tested on a Dolby vision TV that issues present & it's highly dependant on the source material. i.e I think if the file has the correct HDR10 fallback info then it will play fine on a Dolby vision TV (just can't play Dovi proper), but a lot of files I've had don't have this info & after conversion the Dovi TV will display a pink blown out version. It'll be better to just prevent Dovi conversions & I guess there's the question of why compress a Dovi file? I don't think it fits the work flow of a bitrate based re-encode. --- .../Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js b/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js index 6b168dd..ce61750 100644 --- a/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js +++ b/Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js @@ -633,9 +633,10 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { hdrEnabled = true; } - // Had at least one case where a file contained no evident HDR data but was marked as HDR content - // meaning transcode OR plex would butcher the file + // VALIDATE HDR - Ignore Dolby vision & badly formatted files if (hdrEnabled !== true) { + // Had at least one case where a file contained no evident HDR data but was marked as HDR content + // meaning transcode OR plex would butcher the file try { if (typeof file.mediaInfo.track[i + 1].HDR_Format !== 'undefined') { response.infoLog += '==ERROR== This file has Media data implying it is HDR ' @@ -647,6 +648,19 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } catch (err) { // Catch error - Ignore & carry on - If check can bomb out if tags don't exist... } + } else { + // If specifically marked Dolby Vision + try { + if (file.mediaInfo.track[i + 1].HDR_Format.search('Dolby Vision') >= 0) { + response.infoLog += '==ERROR== This file has Media data implying it is Dolby Vision ' + + `(${file.mediaInfo.track[i + 1].HDR_Format}), ` + + 'Currently we cannot safely convert this HDR format and retain the Dolby Vision format. ' + + 'Aborting!\n'; + return response; + } + } catch (err) { + // Catch error - Ignore & carry on - If check can bomb out if tags don't exist... + } } // Check if codec of stream is HEVC, Vp9 or AV1