Skip to content

Commit

Permalink
Adding validation against Dolby vision files
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Boosh1 committed Oct 26, 2024
1 parent 1591e68 commit 8324988
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Community/Tdarr_Plugin_bsh1_Boosh_FFMPEG_QSV_HEVC.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
Expand All @@ -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
Expand Down

0 comments on commit 8324988

Please sign in to comment.